Given a fixture, that creates a file in a temp directory, like this:
conftest.py
@pytest.fixture(scope="session")
def manifest(tmpdir_factory):
db_dir = tmpdir_factory.mktemp("artifact")
db_fn = db_dir.join("xxx.db")
db = os.path.join(db_fn.dirname, db_fn.basename)
Is it possible to open and read-only the file in question inside a test file?
The following does not work:
test_iface.py
def targets_to_try(tmpdir_factory):
tmpdir_factory.getbasetemp().join("artifact/xxx.db")
Because pytest renames the temp directory as artifact0, the 0 signifies the test run.
Could you please advise on the solution?