pytest
pytest copied to clipboard
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
- [x] When I test doctest in my own package, if I use `pytest --doctest-modules`, then it will raise this error. But If I do the doctest on each individual...
When the teardown fails, the last test case gets reported twice, both with it's own verdict, and with the error of the teardown. This also happens in the junitxml, but...
This is a less trivial but (arguably) more powerful alternative to #9350. It fixes #8914. For a review, please follow the commit series and messages. **Situation**: Both `reorder_items` and `FixtureDef.execute`...
Addresses #7342 I dabbled on a solution for this, taking a few different approaches and settling on this one. This is a bit of a compromise with all the concerns...
https://github.com/pytest-dev/pytest/blob/f6aa9d661dde036a362c470930d89c9a01d45883/src/_pytest/cacheprovider.py#L480-L481 adds a utterly hackish way to have pytest-cache by tox env we should make it more nuanced and aware of more types of session (nox ,hatch, virtualenvwrapper)
A very old and common question is "how can I use fixtures for parametrization?" (#349). During the 2016 sprint we had a discussion which resulted in a [proposal](https://docs.pytest.org/en/latest/proposals/parametrize_with_fixtures.html), but neither...
CI fails with `ImportError: cannot import name 'environmentfilter' from 'jinja2'` ([example](https://github.com/pytest-dev/pytest/runs/5726444207)). Bumping Sphinx as described in https://github.com/sphinx-doc/sphinx/issues/10291
`test\conftest.py` ```python import pytest @pytest.fixture(scope='function') # @pytest.fixture(scope='session') def fixture_1(): return None @pytest.hookimpl(tryfirst=True) def pytest_fixture_setup(fixturedef, request): print('Fixture setup: ', fixturedef.argname) ``` `test/test_1.py` ```python def test_1(fixture_1): assert 1 ``` If we run...
**Python:** 3.10.2 and 3.9.12 **pytest:** 7.1.2 **google-api-core:** 2.8.0 **Brief description:** There seems to be some compatibility issue when using both pytester and google.api_core.exceptions in a case where google.api_core.exceptions is loaded...