pytest
pytest copied to clipboard
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
When adding multiple plugins to `pytester.plugins` only the first one is added as a `-p ` to the command line invocation in `pytester.runpytest_subprocess()`. ## Minimal example: ``` # Content of...
Summary ---- The doc page ["Writing hook functions"](https://docs.pytest.org/en/stable/how-to/writing_hook_functions.html) seems to suggest that `conftest.py` hooks are available at `pytest_addoption()` time, which isn't the case; only hooks installed by other third-party plugins...
This PR adds an ability to access the exceptions that happened during teardown in other teardowns. Motivation: some plugins (playwright-pytest) must rely on current teardown status to properly execute their...
**a detailed description of the bug or problem you are having, MWE** I have parametrized tests that take input data from a config, e.g., a list of matrices. It may...
By default, only the parameter's values make it into parametrized test IDs. The parameter names don't. Since parameter values do not always speak for themselves, the test function + test...
The current behavior on the released pytest version is: 1. if `match` fails, `pytest.raises` raises an `AssertionError` 2. if the type differs, the exception propagates through. 3. if no exception...
given this test: ``` python def test_example(pytester): pytester.makepyfile(""" def test_dummy1(): def func(): pass print(func.__qualname__) """) r = pytester.runpytest("-s") assert r.ret.value == 0 assert "test_example.py test_dummy1..func" in r.stdout.str() pytester.makepyfile(""" def test_dummy2():...
(This is basically #2430 again, for warnings configured in `pytest_configure`) I ran into a nasty problem with pytest-based testing today. We are using pytest since version 2.5 and it usually...
#8516 verifies that tmpdir and tmp_path etc. are owned by the user. This fails on filesystems that do not track ownership. In my use case, I am using [Buildbarn's](https://github.com/buildbarn/bb-storage) FUSE...