@@ -65,8 +65,9 @@ async def test_update_repo(tmp_path_factory):
6565 assert dest_commit == src_commit
6666
6767
68- async def test_github_webhook_errors (aiohttp_client , monkeypatch ):
68+ async def test_github_webhook_errors (aiohttp_client , monkeypatch , tmp_path ):
6969 """Test invalid inputs to webhook."""
70+ monkeypatch .setenv ('SITE_DIR' , str (tmp_path ))
7071 client = await aiohttp_client (create_app ())
7172
7273 # Only /gh/<repo-name> exists.
@@ -142,12 +143,12 @@ async def test_github_webhook_errors(aiohttp_client, monkeypatch):
142143
143144async def test_github_webhook_valid (aiohttp_client , monkeypatch , tmp_path ):
144145 """Test valid input to webhook."""
146+ monkeypatch .setenv ('SITE_DIR' , str (tmp_path ))
145147 client = await aiohttp_client (create_app ())
146148
147149 # Do no actual work, since that's tested above.
148150 monkeypatch .setattr (webhook , 'verify_signature' ,
149151 mock .Mock (verify_signature , return_value = True ))
150- monkeypatch .setenv ('SITE_DIR' , str (tmp_path ))
151152 ur_mock = mock .Mock (update_repo , return_value = None )
152153 monkeypatch .setattr (webhook , 'update_repo' , ur_mock )
153154
0 commit comments