Registry / testing / pytest-xfiles

pytest-xfiles

JSON →
library0.2.0pypypiunverified

pytest-xfiles provides fixtures that read test data from files named after the test function, module, or package (xfiles). Current version 0.2.0, with no recent updates; likely in maintenance mode.

pip install pytest-xfiles
INSTALL
IMPORT
SIG · PYTEST-XFILES
P
pytest-xfiles
testingpythonv0.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

xfiles
from pytest_xfiles import xfiles
from pytest_xfiles import xfiles

Basic usage: declare the 'xfiles' fixture parameter to read an xfile for the test function.

import pytest def test_read_func_xfile(xfiles): """Test function-level xfile.""" # The fixture returns a reader function data = xfiles() assert data is not None
Debug
Known issues
deprecatedpytest-xfiles has not been updated since 2016; may not work with newer pytest versions (>5).
fix
Consider alternative fixtures or pin pytest version.
affects: 0.2.0
gotchaThe xfiles fixture returns a function, not the file content directly. You must call it.
fix
Use xfiles() to read the content, not just reference the fixture.
affects: all
gotchaXfile naming convention expects specific file extensions and paths; deviation leads to FileNotFoundError.
fix
Ensure xfile follows the naming pattern: test_func.xfile or test_func/*.xfile.
affects: all
Upgrade
Version history
0.2.0latest on PyPI · released Feb 27, 2018
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
pytest-xfiles — pip install pytest-xfiles · libregistry