@@ -50,7 +50,7 @@ def wd(wd: WorkDir, monkeypatch: pytest.MonkeyPatch, debug_mode: DebugMode) -> W
50
50
51
51
52
52
@pytest .mark .parametrize (
53
- "given, tag, number, node, dirty" ,
53
+ ( "given" , " tag" , " number" , " node" , " dirty") ,
54
54
[
55
55
("3.3.1-rc26-0-g9df187b" , "3.3.1-rc26" , 0 , "g9df187b" , False ),
56
56
("17.33.0-rc-17-g38c3047c0" , "17.33.0-rc" , 17 , "g38c3047c0" , False ),
@@ -158,7 +158,8 @@ def test_version_from_git(wd: WorkDir) -> None:
158
158
assert wd .get_version () == "0.1.dev0+d20090213"
159
159
160
160
parsed = git .parse (str (wd .cwd ), Configuration (), git .DEFAULT_DESCRIBE )
161
- assert parsed is not None and parsed .branch in ("master" , "main" )
161
+ assert parsed is not None
162
+ assert parsed .branch in ("master" , "main" )
162
163
163
164
wd .commit_testfile ()
164
165
assert wd .get_version ().startswith ("0.1.dev1+g" )
@@ -285,7 +286,8 @@ def test_git_dirty_notag(
285
286
tag = datetime .now (timezone .utc ).date ().strftime (".d%Y%m%d" )
286
287
else :
287
288
tag = ".d20090213"
288
- assert version .startswith ("0.1.dev1+g" ) and version .endswith (tag )
289
+ assert version .startswith ("0.1.dev1+g" )
290
+ assert version .endswith (tag )
289
291
290
292
291
293
@pytest .mark .issue (193 )
@@ -300,7 +302,7 @@ def test_git_worktree_support(wd: WorkDir, tmp_path: Path) -> None:
300
302
assert str (worktree ) in res .stdout
301
303
302
304
303
- @pytest .fixture
305
+ @pytest .fixture ()
304
306
def shallow_wd (wd : WorkDir , tmp_path : Path ) -> Path :
305
307
wd .commit_testfile ()
306
308
wd .commit_testfile ()
@@ -461,7 +463,7 @@ def test_gitdir(monkeypatch: pytest.MonkeyPatch, wd: WorkDir) -> None:
461
463
462
464
def test_git_getdate (wd : WorkDir ) -> None :
463
465
# TODO: case coverage for git wd parse
464
- today = date . today ()
466
+ today = datetime . now ( timezone . utc ). date ()
465
467
466
468
def parse_date () -> date :
467
469
parsed = git .parse (os .fspath (wd .cwd ), Configuration ())
@@ -492,7 +494,7 @@ def test_git_getdate_badgit(
492
494
assert git_wd .get_head_date () is None
493
495
494
496
495
- @pytest .fixture
497
+ @pytest .fixture ()
496
498
def signed_commit_wd (monkeypatch : pytest .MonkeyPatch , wd : WorkDir ) -> WorkDir :
497
499
if not has_command ("gpg" , args = ["--version" ], warn = False ):
498
500
pytest .skip ("gpg executable not found" )
@@ -519,14 +521,14 @@ def signed_commit_wd(monkeypatch: pytest.MonkeyPatch, wd: WorkDir) -> WorkDir:
519
521
520
522
@pytest .mark .issue ("https://github.com/pypa/setuptools_scm/issues/548" )
521
523
def test_git_getdate_signed_commit (signed_commit_wd : WorkDir ) -> None :
522
- today = date . today ()
524
+ today = datetime . now ( timezone . utc ). date ()
523
525
signed_commit_wd .commit_testfile (signed = True )
524
526
git_wd = git .GitWorkdir (signed_commit_wd .cwd )
525
527
assert git_wd .get_head_date () == today
526
528
527
529
528
530
@pytest .mark .parametrize (
529
- "expected, from_data" ,
531
+ ( "expected" , " from_data") ,
530
532
[
531
533
(
532
534
"1.0" ,
0 commit comments