pytest icon indicating copy to clipboard operation
pytest copied to clipboard

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing

Results 573 pytest issues
Sort by recently updated
recently updated
newest added

- [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...

type: bug
topic: collection

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...

type: bug
status: help wanted
topic: reporting

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`...

status: needs information
bot:chronographer:provided

This PR closes #9431 with minimal changes to the docs.

needs backport

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)

type: enhancement
type: proposal
plugin: cache

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...

type: enhancement
type: docs
topic: fixtures

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...

type: bug
topic: fixtures

**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...

type: bug
plugin: pytester