pytest
pytest copied to clipboard
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
#### What's the problem this feature will solve? I am the author of [next-actions/pytest-mh](https://github.com/next-actions/pytest-mh) which is a multihost testing plugin for pytest. We are doing some black magic to dynamically...
#### What's the problem this feature will solve? [SlipCover](https://github.com/plasma-umass/slipcover) and soon also [Coverage.py](https://github.com/nedbat/coveragepy) modify the AST while loading modules, including test modules, to facilitate measuring branch coverage. However, pytest's assertion...
## EDIT: Using `py.test --pyargs mypackage` does not seem to work for `.egg` distributed packages. Adding ``` [easy_install] zip_ok = False ``` to `setup.cfg` seems to be a viable fix...
### Problem description A bug was noticed when displaying failing tests on CI with the `-vv` flag: the ASCII color characters are being printed inside the detailed diff.  The...
[The documentation on "Conditions as strings instead of booleans"](https://docs.pytest.org/en/8.2.x/historical-notes.html#conditions-as-strings-instead-of-booleans) ends by showing how to rewrite a condition string that uses `config` as a boolean expression that uses `pytest.config`. However, as...
With pytest 8.3.2 as well as the current `main`, when creating a `repro/test_x.py` in the pytest repo: ```python import pytest @pytest.mark.parametrize("a", ["x/y", "/", "//"]) def test_x(a): assert False ``` and...
Fixes https://github.com/pytest-dev/pytest/pull/11916#issuecomment-2313758038 Importing `Self` from `typing` breaks the return type on Python 3.9 and under. You should be using `from typing_extension import Self` instead. For example, the following code: ```py...
This adds back the classifier as it was removed by accident, and I also added the config to avoid pyproject-fmt from removing it again. See https://github.com/pytest-dev/pytest/pull/12321#issuecomment-2311805015 for context.
#### What's the problem this feature will solve? Jest and Vitest JUnit Reporters do this, they include: `jest tests` and `vitest tests` as the value of the `testsuites` element's `name`...
Hi folks, Currently in https://github.com/pytest-dev/pytest-xdist/issues/789 it has come up that users were asking to be able to configure `--dist` in the configuration file. While the usual solution is to use...