6363"""
6464
6565
66+ @pytest .fixture
67+ def command () -> str :
68+ return "install"
69+
70+
6671@pytest .fixture
6772def poetry (project_factory : ProjectFactory ) -> Poetry :
6873 return project_factory (name = "export" , pyproject_content = PYPROJECT_CONTENT )
6974
7075
7176@pytest .fixture
7277def tester (
73- command_tester_factory : CommandTesterFactory , poetry : Poetry
78+ command_tester_factory : CommandTesterFactory , command : str , poetry : Poetry
7479) -> CommandTester :
75- return command_tester_factory ("install" )
80+ return command_tester_factory (command )
7681
7782
7883def _project_factory (
@@ -443,6 +448,7 @@ def test_install_logs_output_decorated(
443448@pytest .mark .parametrize ("error" , ["module" , "readme" , "" ])
444449def test_install_warning_corrupt_root (
445450 command_tester_factory : CommandTesterFactory ,
451+ command : str ,
446452 project_factory : ProjectFactory ,
447453 with_root : bool ,
448454 error : str ,
@@ -461,7 +467,7 @@ def test_install_warning_corrupt_root(
461467 if error != "module" :
462468 (poetry .pyproject_path .parent / f"{ name } .py" ).touch ()
463469
464- tester = command_tester_factory ("install" , poetry = poetry )
470+ tester = command_tester_factory (command , poetry = poetry )
465471 tester .execute ("" if with_root else "--no-root" )
466472
467473 if error and with_root :
@@ -481,6 +487,7 @@ def test_install_warning_corrupt_root(
481487)
482488def test_install_path_dependency_does_not_exist (
483489 command_tester_factory : CommandTesterFactory ,
490+ command : str ,
484491 project_factory : ProjectFactory ,
485492 fixture_dir : FixtureDirGetter ,
486493 project : str ,
@@ -489,7 +496,7 @@ def test_install_path_dependency_does_not_exist(
489496 poetry = _project_factory (project , project_factory , fixture_dir )
490497 assert isinstance (poetry .locker , TestLocker )
491498 poetry .locker .locked (True )
492- tester = command_tester_factory ("install" , poetry = poetry )
499+ tester = command_tester_factory (command , poetry = poetry )
493500 if options :
494501 tester .execute (options )
495502 else :
@@ -500,6 +507,7 @@ def test_install_path_dependency_does_not_exist(
500507@pytest .mark .parametrize ("options" , ["" , "--extras notinstallable" ])
501508def test_install_extra_path_dependency_does_not_exist (
502509 command_tester_factory : CommandTesterFactory ,
510+ command : str ,
503511 project_factory : ProjectFactory ,
504512 fixture_dir : FixtureDirGetter ,
505513 options : str ,
@@ -508,7 +516,7 @@ def test_install_extra_path_dependency_does_not_exist(
508516 poetry = _project_factory (project , project_factory , fixture_dir )
509517 assert isinstance (poetry .locker , TestLocker )
510518 poetry .locker .locked (True )
511- tester = command_tester_factory ("install" , poetry = poetry )
519+ tester = command_tester_factory (command , poetry = poetry )
512520 if not options :
513521 tester .execute (options )
514522 else :
@@ -519,6 +527,7 @@ def test_install_extra_path_dependency_does_not_exist(
519527@pytest .mark .parametrize ("options" , ["" , "--no-directory" ])
520528def test_install_missing_directory_dependency_with_no_directory (
521529 command_tester_factory : CommandTesterFactory ,
530+ command : str ,
522531 project_factory : ProjectFactory ,
523532 fixture_dir : FixtureDirGetter ,
524533 options : str ,
@@ -528,7 +537,7 @@ def test_install_missing_directory_dependency_with_no_directory(
528537 )
529538 assert isinstance (poetry .locker , TestLocker )
530539 poetry .locker .locked (True )
531- tester = command_tester_factory ("install" , poetry = poetry )
540+ tester = command_tester_factory (command , poetry = poetry )
532541 if options :
533542 tester .execute (options )
534543 else :
@@ -538,6 +547,7 @@ def test_install_missing_directory_dependency_with_no_directory(
538547
539548def test_non_package_mode_does_not_try_to_install_root (
540549 command_tester_factory : CommandTesterFactory ,
550+ command : str ,
541551 project_factory : ProjectFactory ,
542552) -> None :
543553 content = """\
@@ -546,7 +556,7 @@ def test_non_package_mode_does_not_try_to_install_root(
546556"""
547557 poetry = project_factory (name = "non-package-mode" , pyproject_content = content )
548558
549- tester = command_tester_factory ("install" , poetry = poetry )
559+ tester = command_tester_factory (command , poetry = poetry )
550560 tester .execute ()
551561
552562 assert tester .status_code == 0
0 commit comments