summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-01-24runner: inline SetupState._pop_and_teardown()Ran Benita
This will enable a simplification in the next commit.
2021-01-24runner: express SetupState.teardown_all() in terms of teardown_exact() and ↵Ran Benita
remove it Makes it easier to understand with fewer methods.
2021-01-24runner: inline a couple of SetupState methodsRan Benita
Code is clearer this way.
2021-01-24runner: remove dead code in teardown_all()Ran Benita
When the stack is empty, the finalizers which are supposed to be attached to nodes in the stack really ought to be empty as well. So the code here is dead. If this doesn't happen, the assert will trigger.
2021-01-24runner: inline SetupState._teardown_towards()Ran Benita
Doesn't add much.
2021-01-24runner: reorder SetupState method to make more senseRan Benita
The setup stuff happens before the teardown stuff, so put it first so that reading the code from top to bottom makes more sense.
2021-01-24runner: use node's Store to keep private SetupState state instead of an ↵Ran Benita
attribute This way it gets proper typing and decoupling.
2021-01-24runner: complete type annotations of SetupStateRan Benita
2021-01-21Explain how to create binary files in the doc of `pytest.makefile`. (#8255)Hong Xu
2021-01-20Merge pull request #8250 from daq-tools/fix-twisted-captureBruno Oliveira
2021-01-19Fix pep8 import order in docs (#8253)Jeff Widman
2021-01-18Fix faulthandler for Twisted Logger when used with "--capture=no"Andreas Motl
The Twisted Logger will return an invalid file descriptor since it is not backed by an FD. So, let's also forward this to the same code path as with `pytest-xdist`.
2021-01-18Merge pull request #8242 from bluetech/deprecate-unittest-skip-collectionRan Benita
Deprecate raising unittest.SkipTest to skip tests during collection
2021-01-15Merge pull request #8241 from bluetech/skip-improvementsRan Benita
Minor code improvements in nose, unittest, skipping
2021-01-15Deprecate raising unittest.SkipTest to skip tests during collectionRan Benita
It is not very clear why this code exists -- we are not running any unittest or nose code during collection, and really these frameworks don't have the concept of collection at all, and just raising these exceptions at e.g. the module level would cause an error. So unless I'm missing something, I don't think anyone is using this. Deprecate it so we can eventually clear up this code and keep unittest more tightly restricted to its plugin.
2021-01-14Improve way in which skip location is fixed up when skipped by markRan Benita
When `pytest.skip()` is called inside a test function, the skip location should be reported as the line that made the call, however when `pytest.skip()` is called by the `pytest.mark.skip` and similar mechanisms, the location should be reported at the item's location, because the exact location is some irrelevant internal code. Currently the item-location case is implemented by the caller setting a boolean key on the item's store and the `skipping` plugin checking it and fixing up the location if needed. This is really roundabout IMO and breaks encapsulation. Instead, allow the caller to specify directly on the skip exception whether to use the item's location or not. For now, this is entirely private.
2021-01-14nose: type annotate with some resulting refactoringRan Benita
2021-01-14unittest: add clarifying comment on unittest.SkipTest -> pytest.skip codeRan Benita
I was tempted to remove it, until I figured out why it was there.
2021-01-14nose,fixtures: use the public item API for adding finalizersRan Benita
2021-01-13unittest: cleanup unexpected success handling (#8231)Anton
* unittest: cleanup unexpected success handling * update comment
2021-01-11Merge pull request #8235 from ↵Bruno Oliveira
pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.5 build(deps): bump django from 3.1.4 to 3.1.5 in /testing/plugins_integration
2021-01-11Merge pull request #8234 from ↵Bruno Oliveira
pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.5.1 build(deps): bump pytest-mock from 3.4.0 to 3.5.1 in /testing/plugins_integration
2021-01-11build(deps): bump django in /testing/plugins_integrationdependabot[bot]
Bumps [django](https://github.com/django/django) from 3.1.4 to 3.1.5. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/3.1.4...3.1.5) Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11build(deps): bump pytest-mock in /testing/plugins_integrationdependabot[bot]
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.4.0 to 3.5.1. - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.4.0...v3.5.1) Signed-off-by: dependabot[bot] <support@github.com>
2021-01-08Merge pull request #8232 from imrehg/docRan Benita
Add missing import into example script in documentation
2021-01-08Add missing import into example script in documentationGergely Imreh
2021-01-05Merge pull request #8225 from The-Compiler/training-updateBruno Oliveira
doc: Add note about training early bird discount
2021-01-05doc: Add note about training early bird discountFlorian Bruhin
2021-01-05Merge pull request #8220 from xuhdev/module-docBruno Oliveira
DOC: Mark pytest module
2021-01-04Merge pull request #8218 from bluetech/reports2Ran Benita
Misc small code improvements
2021-01-04Add dot prefix if file makefile extension is invalid for pathlib (#8222)bengartner
2021-01-02Merge pull request #8216 from xuhdev/testdir-pytesterRan Benita
DOC: Update multiple references to testdir to pytester
2021-01-02DOC: Mark pytest moduleHong Xu
Pytest document currently does not index the top-level package name `pytest`, which causes some trouble when building documentation that cross-refers to the pytest package via ``:mod:`pytest` ``.
2021-01-01python: inline a simple methodRan Benita
I don't think it adds much value!
2021-01-01Always use getfixturemarker() to access _pytestfixturefunctionRan Benita
Keep knowledge of how the marker is stored encapsulated in one place.
2021-01-01fixtures: type annotate FixtureRequest.keywordsRan Benita
2021-01-01fixtures: simplify FixtureRequest._get_fixturestack()Ran Benita
2021-01-01DOC: Update multiple references to testdir to pytesterHong Xu
In https://docs.pytest.org/en/stable/reference.html#testdir, it is suggested: > New code should avoid using testdir in favor of pytester. Multiple spots in the documents still use testdir and they can be quite confusing (especially the plugin writing guide).
2021-01-01Merge pull request #8214 from sousajf1/sousajo_patch_8204_1Ran Benita
pytest-dev#8204 migrate tests on testing/code/test_source to tmp_path
2021-01-01pytest-dev#8204 migrate tests on testing/code/test_source to tmp_pathsousajo
2021-01-01pytest-dev#8204 migrate some tests to tmp_path fixture (#8209)sousajf1
migrating some tests from tmpdir to tmp_path fixture
2021-01-01reports: improve a type annotationRan Benita
2021-01-01reports: BaseReport.{passed,failed,skipped} more friendly to mypyRan Benita
Not smart enough to understand the previous code.
2020-12-31Add missing fixture (#8207)mefmund
Co-authored-by: Florian Bruhin <me@the-compiler.org> Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-12-30Fix failing staticmethod tests if they are inherited (#8205)Anton
* Fix failing staticmethod tests if they are inherited * add comments, set default=None
2020-12-30Merge pull request #8195 from ↵Ran Benita
christophebedard/add-missing-space-version-option-help-message Add missing space in '--version' help message
2020-12-30[pre-commit.ci] pre-commit autoupdate (#8201)pre-commit-ci[bot]
* [pre-commit.ci] pre-commit autoupdate * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * manual fixes after configuration update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-12-29Merge pull request #8194 from bluetech/typing-public-3Ran Benita
Export pytest.Metafunc and pytest.Callinfo, hide NodeKeywords
2020-12-28Merge pull request #8188 from antonblr/subprocess-coverageRan Benita
coverage: Include code that runs in subprocesses
2020-12-28Add missing space in '--version' help messageChristophe Bedard