63
63
"""
64
64
65
65
66
+ @pytest .fixture
67
+ def command () -> str :
68
+ return "install"
69
+
70
+
66
71
@pytest .fixture
67
72
def poetry (project_factory : ProjectFactory ) -> Poetry :
68
73
return project_factory (name = "export" , pyproject_content = PYPROJECT_CONTENT )
69
74
70
75
71
76
@pytest .fixture
72
77
def tester (
73
- command_tester_factory : CommandTesterFactory , poetry : Poetry
78
+ command_tester_factory : CommandTesterFactory , command : str , poetry : Poetry
74
79
) -> CommandTester :
75
- return command_tester_factory ("install" )
80
+ return command_tester_factory (command )
76
81
77
82
78
83
def _project_factory (
@@ -443,6 +448,7 @@ def test_install_logs_output_decorated(
443
448
@pytest .mark .parametrize ("error" , ["module" , "readme" , "" ])
444
449
def test_install_warning_corrupt_root (
445
450
command_tester_factory : CommandTesterFactory ,
451
+ command : str ,
446
452
project_factory : ProjectFactory ,
447
453
with_root : bool ,
448
454
error : str ,
@@ -461,7 +467,7 @@ def test_install_warning_corrupt_root(
461
467
if error != "module" :
462
468
(poetry .pyproject_path .parent / f"{ name } .py" ).touch ()
463
469
464
- tester = command_tester_factory ("install" , poetry = poetry )
470
+ tester = command_tester_factory (command , poetry = poetry )
465
471
tester .execute ("" if with_root else "--no-root" )
466
472
467
473
if error and with_root :
@@ -481,6 +487,7 @@ def test_install_warning_corrupt_root(
481
487
)
482
488
def test_install_path_dependency_does_not_exist (
483
489
command_tester_factory : CommandTesterFactory ,
490
+ command : str ,
484
491
project_factory : ProjectFactory ,
485
492
fixture_dir : FixtureDirGetter ,
486
493
project : str ,
@@ -489,7 +496,7 @@ def test_install_path_dependency_does_not_exist(
489
496
poetry = _project_factory (project , project_factory , fixture_dir )
490
497
assert isinstance (poetry .locker , TestLocker )
491
498
poetry .locker .locked (True )
492
- tester = command_tester_factory ("install" , poetry = poetry )
499
+ tester = command_tester_factory (command , poetry = poetry )
493
500
if options :
494
501
tester .execute (options )
495
502
else :
@@ -500,6 +507,7 @@ def test_install_path_dependency_does_not_exist(
500
507
@pytest .mark .parametrize ("options" , ["" , "--extras notinstallable" ])
501
508
def test_install_extra_path_dependency_does_not_exist (
502
509
command_tester_factory : CommandTesterFactory ,
510
+ command : str ,
503
511
project_factory : ProjectFactory ,
504
512
fixture_dir : FixtureDirGetter ,
505
513
options : str ,
@@ -508,7 +516,7 @@ def test_install_extra_path_dependency_does_not_exist(
508
516
poetry = _project_factory (project , project_factory , fixture_dir )
509
517
assert isinstance (poetry .locker , TestLocker )
510
518
poetry .locker .locked (True )
511
- tester = command_tester_factory ("install" , poetry = poetry )
519
+ tester = command_tester_factory (command , poetry = poetry )
512
520
if not options :
513
521
tester .execute (options )
514
522
else :
@@ -519,6 +527,7 @@ def test_install_extra_path_dependency_does_not_exist(
519
527
@pytest .mark .parametrize ("options" , ["" , "--no-directory" ])
520
528
def test_install_missing_directory_dependency_with_no_directory (
521
529
command_tester_factory : CommandTesterFactory ,
530
+ command : str ,
522
531
project_factory : ProjectFactory ,
523
532
fixture_dir : FixtureDirGetter ,
524
533
options : str ,
@@ -528,7 +537,7 @@ def test_install_missing_directory_dependency_with_no_directory(
528
537
)
529
538
assert isinstance (poetry .locker , TestLocker )
530
539
poetry .locker .locked (True )
531
- tester = command_tester_factory ("install" , poetry = poetry )
540
+ tester = command_tester_factory (command , poetry = poetry )
532
541
if options :
533
542
tester .execute (options )
534
543
else :
@@ -538,6 +547,7 @@ def test_install_missing_directory_dependency_with_no_directory(
538
547
539
548
def test_non_package_mode_does_not_try_to_install_root (
540
549
command_tester_factory : CommandTesterFactory ,
550
+ command : str ,
541
551
project_factory : ProjectFactory ,
542
552
) -> None :
543
553
content = """\
@@ -546,7 +556,7 @@ def test_non_package_mode_does_not_try_to_install_root(
546
556
"""
547
557
poetry = project_factory (name = "non-package-mode" , pyproject_content = content )
548
558
549
- tester = command_tester_factory ("install" , poetry = poetry )
559
+ tester = command_tester_factory (command , poetry = poetry )
550
560
tester .execute ()
551
561
552
562
assert tester .status_code == 0
0 commit comments