Skip to content

Fix not working tmp path in unit tests #159

@vdusek

Description

@vdusek
  • seems tmp_path for (some) unit tests stopped working and unit tests are storing their content to the default location - ./storage
  • possibly something is wrong with this fixture:
# To isolate the tests, we need to reset the used singletons before each test case
# We also set the MemoryStorageClient to use a temp path
@pytest.fixture(autouse=True)
def _reset_and_patch_default_instances(
    monkeypatch: pytest.MonkeyPatch,
    tmp_path: Path,
    reset_default_instances: Callable[[], None],
) -> None:
    reset_default_instances()

    # This forces the MemoryStorageClient to use tmp_path for its storage dir
    monkeypatch.setenv('CRAWLEE_LOCAL_STORAGE_DIR', str(tmp_path))

Metadata

Metadata

Assignees

Labels

bugSomething isn't working.t-toolingIssues with this label are in the ownership of the tooling team.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions