pytest
pytest copied to clipboard
The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
The ExceptionGroup class is only available in Python 3.11 and later versions. If you're using an older version of Python, that's why you're seeing this NameError.
- `pytester` tests that require `pexpect` are silently skipped if `pexpect` is unavailable: https://github.com/pytest-dev/pytest/blob/f373974707f57a0b28d12563e4d03c7cd54c70d9/src/_pytest/pytester.py#L1513 - We default to not installing `pexpect` even on CI, only having it as an optional...
With 8.3.3 (as well as the current `main`, f373974707f57a0b28d12563e4d03c7cd54c70d9), something like ```python import pytest def test_stuff(fixt): pass @pytest.fixture def fixt(request): yield # e.g. store screenshots on failures for GUI tests...
`pytest tests/test_foo.py:42` should run the (nearest) test at line 42 in `tests/test_foo.py`. When it also ignores a trailing colon it would allow for easy copy'n'pasting from failures. Via #5973: >...
- [X] a detailed description of the bug or problem you are having - [ ] output of `pip list` from the virtual environment you are using (not using pip)...
Currently, at both -1 and -2 the test cases reporting uses the "sea of dots". For test suites which are both very large and relatively slow, this representation is not...
With https://github.com/pytest-dev/pytest/pull/12875/files#r1796219568 I noticed that `src/pytest` is not displayed in Codecov. I've since discovered that the configuration of Coveragepy is quite ancient, and here's my attempt to update it in...
I am using pytest.main function call to create a flask test command ``` python @app.cli.command() @click.option('-c', '--cov-report', type=click.Choice(['term', 'term-missing']), help="Turn on coverage reporting") @click.option('-d', '--debug', is_flag=True, help="Enter pdb on test...
"The handle is invalid" error when trying to use a std stream saved before teh call to `pytest.main`
Hi, it seems there's an issue when trying to use a standard system output stream that was saved before calling pytest.main on MS-Windows ``` E OSError: [WinError 6] The handle...
potentially closes #12081(and more!) - [x] Include documentation when adding new features. - [x] Include new tests or update existing tests when applicable. - [X] Allow maintainers to push and...