ambitious-petabyte-59095
02/17/2022, 4:39 PMdocker exec -t projectA-container pytest tests projectA)
, which is one session.
This is my current project structure:
projectA
- tests
- units
- __init__.py
- BUILD # tests
- test_task1.py
- utils
- __init__.py
- BUILD
- init_data.py
__init__.py
BUILD # test utils
conftest.py
this is the relevant part of my conftest.py
@pytest.fixture(scope="session", autouse=True)
def mongo():
client = MongoClient(settings.MONGO_URI)
db = client["test"]
yield db
client.drop_database("test")
I know that the tests are executed in parallel given enough cores so I was wondering if this could possibly affect the "session" scope? Any help to better understand this would be appreciated. Thanks so much!enough-analyst-54434
02/17/2022, 4:52 PMenough-analyst-54434
02/17/2022, 4:56 PMambitious-petabyte-59095
02/18/2022, 2:13 PM