2020
2121@pytest .fixture
2222def environ () -> Iterator [None ]:
23- env = os .environ .copy ()
24- env .update (
25- dict (
26- GIT_AUTHOR_NAME = AUTHOR_NAME ,
27- GIT_AUTHOR_EMAIL = AUTHOR_EMAIL ,
28- GIT_COMMITTER_NAME = AUTHOR_NAME ,
29- GIT_COMMITTER_EMAIL = AUTHOR_EMAIL ,
30- GITHUB_API_TOKEN = "unittest_token" ,
31- )
23+ add_values = dict (
24+ GIT_AUTHOR_NAME = AUTHOR_NAME ,
25+ GIT_AUTHOR_EMAIL = AUTHOR_EMAIL ,
26+ GIT_COMMITTER_NAME = AUTHOR_NAME ,
27+ GIT_COMMITTER_EMAIL = AUTHOR_EMAIL ,
28+ GITHUB_API_TOKEN = "unittest_token" ,
3229 )
33- with patch .dict (os .environ , env ):
30+ with patch .dict (os .environ , add_values ):
3431 yield
3532
3633
3734@pytest .fixture (params = ["@" ])
3835def new_cookie (
39- request : pytest .FixtureRequest , environ : None , temp_dir : str
36+ request : pytest .FixtureRequest , environ : None , temp_dir : Path
4037) -> Iterator [Path ]:
4138 testargs = [
4239 "new-cookie" ,
4340 "--local" ,
44- temp_dir ,
41+ str ( temp_dir ) ,
4542 "--" ,
4643 "-d" ,
4744 "-y" ,
@@ -60,7 +57,7 @@ def new_cookie(
6057 ]
6158 with patch .object (sys , "argv" , testargs ):
6259 new_cookie_main ()
63- yield Path ( temp_dir ) / PROJECT_NAME
60+ yield temp_dir / PROJECT_NAME
6461
6562
6663@pytest .fixture (autouse = True )
@@ -86,7 +83,7 @@ def mock_pygithub(new_cookie: Path) -> Iterator[MagicMock]:
8683
8784
8885@pytest .fixture
89- def new_cookie_with_lock (new_cookie : Path , temp_dir : str ) -> Iterator [Path ]:
86+ def new_cookie_with_lock (new_cookie : Path , temp_dir : Path ) -> Iterator [Path ]:
9087 for cmd in (
9188 ["poetry" , "sync" ],
9289 ["git" , "add" , "poetry.lock" ],
0 commit comments