File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import datetime
22import secrets
33import time
4- from typing import Any , Generator
4+ from typing import Any
55from unittest .mock import MagicMock
66
77import boto3
1818REGION_NAME : BucketLocationConstraintType = "eu-central-1"
1919
2020
21- @pytest .fixture (scope = "session" )
22- def monkeypatch_module () -> Generator [pytest .MonkeyPatch , Any , None ]:
23- with pytest .MonkeyPatch .context () as mp :
24- yield mp
25-
26-
27- @pytest .fixture (autouse = True , scope = "function" )
28- def enqueueing_func (monkeypatch_module : pytest .MonkeyPatch ) -> MagicMock :
21+ @pytest .fixture (autouse = True )
22+ def enqueueing_func (monkeypatch : pytest .MonkeyPatch ) -> MagicMock :
2923 mock_enqueueing_function = MagicMock ()
30- monkeypatch_module .setitem (
24+ monkeypatch .setitem (
3125 app .dependency_overrides ,
3226 enqueueing_function_dep , # type: ignore
3327 lambda : mock_enqueueing_function ,
Original file line number Diff line number Diff line change 2828)
2929from api .main import app
3030from api .models import Job
31- from tests .conftest import REGION_NAME , RDSTestingInstance , S3TestingBucket
31+ from tests .conftest import RDSTestingInstance , S3TestingBucket
3232
3333
3434@pytest .fixture (scope = "session" )
@@ -109,24 +109,6 @@ def base_filesystem(
109109) -> Generator [FileSystem , Any , None ]:
110110 if env == "local" :
111111 base_user_dir = f"./{ base_user_dir } "
112-
113- monkeypatch_module .setattr (
114- settings ,
115- "user_data_root_path" ,
116- base_user_dir ,
117- )
118- monkeypatch_module .setattr (
119- settings ,
120- "s3_region" ,
121- REGION_NAME ,
122- )
123- monkeypatch_module .setattr (
124- settings ,
125- "filesystem" ,
126- "local" if env == "local" else "s3" ,
127- )
128-
129- if env == "local" :
130112 shutil .rmtree (base_user_dir , ignore_errors = True )
131113 yield LocalFilesystem (base_user_dir )
132114 shutil .rmtree (base_user_dir , ignore_errors = True )
You can’t perform that action at this time.
0 commit comments