Provides a pytest fixture `resource_path` that gives a pathlib.Path to a temporary directory with uniform access to test resources, copying test-resource directories from the test file's directory. Version 1.5.0 supports Python >=3.7.
pip install pytest-resource-pathNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage: the `resource_path` fixture provides a Path to a temporary directory containing resources that were co-located with the test file in a directory named `test-resource/`.
Rename your resource directory to `test-resource/` or configure via `--resource-path-dir` CLI option.
Use `resource_path` directly inside the test; avoid saving it to class-level variables.
Rename fixture to `resource_path` and use `pathlib.Path` methods instead of string concatenation.
Install with `pip install pytest-resource-path` and import as `from pytest_resource_path import resource_path`.
Ensure `pytest-resource-path` is installed in the current environment: `pip list | grep pytest-resource`.
Check that `resource_path` is a `pathlib.Path`. If not, ensure correct version of the package.
Create a directory named `test-resource` in the same folder as your test file and place the resource file inside.
No resource links recorded.