pytest
pytest copied to clipboard
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
Found during discussion of #11833 (I have reduced the size of the repro since I posted it in https://github.com/pytest-dev/pytest/pull/11833#issuecomment-1999818465) ```python import pytest @pytest.fixture(scope="module", params=["a", "b"]) def fixture_1(request): print("setup 1", request.param)...
I am having `import` issues with namespaces packages and pytest. Something along the lines of pytest already having the namespace imported and not looking deeper into the subpackage for the...
Description ======= I'd like to be able to use python's built-in logging, specifically to stream logging records to CLI and file, without having all log records stored in memory in...
Currently for each fixture which depends on another fixture, a "finalizer" is added to the list of the dependent fixture. For example: ```python def test(tmpdir): pass ``` `tmpdir`, as we...
When checking `assert path.exists()`, the output error message becomes very long. Could this be cleaned up and shortened somehow? test source code: ```py import pathlib import unittest PATH = pathlib.Path(__file__).parent...
## Issue Currently pytest's capfd/capsys fixtures (CaptureFixture) that allow stdout capturing via readouterr() consume stdout, meaning that logs are no longer available in the "Captured stdout call" up to the...
#### What's the problem this feature will solve? In my organisation, we have a lot of tests split between `unittest.mock.patch`, [pytest-mock](https://pypi.org/project/pytest-mock/) and monkeypatch. As we try to standardise usage to...
Parametrization with Variables Unexpectedly Changes Fixture Scope from Class-Level to Function-Level
I have a `setup` fixture that I've parameterized with class-level scope. When I directly specify the argument values as `[("chrome", "windows", "latest")]`, it works fine, maintaining the class-level scope. However,...
Environment ========== Pytest version: 5.2.1 Operating system: Kubuntu 18.04.3 LTS Pip list: ``` Package Version ------------------ ------- atomicwrites 1.3.0 attrs 19.3.0 importlib-metadata 0.23 more-itertools 7.2.0 packaging 19.2 pip 19.3.1 pluggy...