Commit Graph

4204 Commits

Author SHA1 Message Date
Bruno Oliveira bc0af99e5e
Merge pull request #8383 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-21.2.0
build(deps): bump twisted from 20.3.0 to 21.2.0 in /testing/plugins_integration
2021-03-02 17:33:35 -03:00
dependabot[bot] 897b5a3bd6
build(deps): bump twisted in /testing/plugins_integration
Bumps [twisted](https://github.com/twisted/twisted) from 20.3.0 to 21.2.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/twisted-21.2.0/NEWS.rst)
- [Commits](https://github.com/twisted/twisted/compare/twisted-20.3.0...twisted-21.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 03:02:50 +00:00
dependabot[bot] 62ef875796
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/agronholm/anyio/releases)
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst)
- [Commits](https://github.com/agronholm/anyio/compare/2.1.0...2.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 03:02:48 +00:00
Simon K b7f2d7ca61
Fixed an issue where `getpass.getuser()` contained illegal characters for file directories (#8365)
* retry writing pytest-of dir when invalid chars are in directory name

* add unit tests for getbasetemp() and changelog

* patch _basetemp & _given_basetemp for testing basetemp()

* Tweak changelog for #8317, tidy up comments
2021-02-25 08:28:57 +00:00
pre-commit-ci[bot] 3b7fc2c9c8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-02-23 17:02:50 +00:00
Florian Bruhin 54a154c86f Allow Class.from_parent to forward custom parameters to the constructor
Similarly to #7143, at work we have a project with a custom pytest.Class
subclass, adding an additional argument to the constructor.

All from_parent implementations in pytest accept and forward *kw, except
Class (before this change) and DoctestItem - since I'm not familiar with
doctest support, I've left the latter as-is.
2021-02-23 18:00:56 +01:00
dependabot[bot] 060cbef260
build(deps): bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 3.1.6 to 3.1.7.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.6...3.1.7)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 03:01:27 +00:00
Ran Benita 1003beaffa
Merge pull request #8323 from bluetech/setupstate-refactor-3
runner: a few more tweaks to SetupState
2021-02-08 13:56:04 +02:00
Bruno Oliveira 7b91302b33
Merge branch 'master' into dependabot/pip/testing/plugins_integration/django-3.1.6 2021-02-08 08:03:23 -03:00
dependabot[bot] ef14f286a3
build(deps): bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.1.5...3.1.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 03:02:01 +00:00
dependabot[bot] e8d7a7b843
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 2.0.2 to 2.1.0.
- [Release notes](https://github.com/agronholm/anyio/releases)
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst)
- [Commits](https://github.com/agronholm/anyio/compare/2.0.2...2.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 03:01:58 +00:00
Ran Benita f42b68ccaa runner: rename SetupState.prepare -> setup
This is the usual terminology we use, and matches better with
`teardown_exact()` and `pytest_runtest_setup()`.
2021-02-06 20:46:08 +02:00
Ran Benita afea190797 Remove some no longer needed type-ignores 2021-01-29 20:40:43 +02:00
Bruno Oliveira 6a5d47a243
Merge pull request #8260 from nicoddemus/faulthandler-mode-X-8258 2021-01-28 13:03:24 -03:00
Bruno Oliveira 33861098d9 Only re-enable fauthandler during unconfigure if it was enabled before 2021-01-25 12:28:00 -03:00
dependabot[bot] 83ee1a1f3b
build(deps): bump pytest-cov in /testing/plugins_integration
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.10.1 to 2.11.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.10.1...v2.11.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-25 03:16:50 +00:00
Ran Benita c30feeef8b runner: add docstring to SetupState and improve variable naming a bit 2021-01-24 14:29:54 +02:00
Ran Benita 637300d13d testing: fix some tests to be more realistic
Perform the operations in the order and context in which they can
legally occur.
2021-01-24 14:08:39 +02:00
Ran Benita c83d030028 testing/test_runner: make SetupState tests use a proper SetupState
Previously the tests (probably unintentionally) mixed a fresh SetupState
and the generated item Session's SetupState, which led to some serious
head scratching when prodding it a bit.
2021-01-24 14:08:39 +02:00
Ran Benita d1fcd425a3 runner: inline SetupState._pop_and_teardown()
This will enable a simplification in the next commit.
2021-01-24 14:08:39 +02:00
Ran Benita 2b14edb108 runner: express SetupState.teardown_all() in terms of teardown_exact() and remove it
Makes it easier to understand with fewer methods.
2021-01-24 14:08:39 +02:00
Ran Benita ceb4d6f6d5 runner: inline a couple of SetupState methods
Code is clearer this way.
2021-01-24 14:08:39 +02:00
Bruno Oliveira adc0f29b8f Always handle faulthandler stderr even if already enabled
It seems the code that would not install pytest's faulthandler support
if it was already enabled is not really needed at all, and even detrimental
when using `python -X dev -m pytest` to run Python in "dev" mode.

Also simplified the plugin by removing the hook class, now the hooks
will always be active so there's no need to delay the hook definitions anymore.

Fix #8258
2021-01-20 10:29:05 -03:00
Bruno Oliveira bda9ce4e0f
Merge pull request #8250 from daq-tools/fix-twisted-capture 2021-01-20 09:45:58 -03:00
Andreas Motl 9ba1821e91 Fix faulthandler for Twisted Logger when used with "--capture=no"
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-18 17:51:08 +01:00
Ran Benita 25e657bfc1 Deprecate raising unittest.SkipTest to skip tests during collection
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-15 00:05:33 +02:00
Anton 42d5545f42
unittest: cleanup unexpected success handling (#8231)
* unittest: cleanup unexpected success handling

* update comment
2021-01-13 17:02:26 -08:00
Bruno Oliveira 7a5a6cb51c
Merge pull request #8235 from 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-11 08:24:47 -03:00
dependabot[bot] cfa0c3b0d9
build(deps): bump django in /testing/plugins_integration
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-11 03:16:03 +00:00
dependabot[bot] af78efc7fa
build(deps): bump pytest-mock in /testing/plugins_integration
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-11 03:15:59 +00:00
Ran Benita 5336ba28cc
Merge pull request #8218 from bluetech/reports2
Misc small code improvements
2021-01-04 22:47:32 +02:00
bengartner 8e00df4c4b
Add dot prefix if file makefile extension is invalid for pathlib (#8222) 2021-01-04 15:58:11 +02:00
Ran Benita 8ee6d0a866 Always use getfixturemarker() to access _pytestfixturefunction
Keep knowledge of how the marker is stored encapsulated in one place.
2021-01-01 23:22:10 +02:00
Ran Benita bbd22e1769
Merge pull request #8214 from sousajf1/sousajo_patch_8204_1
pytest-dev#8204 migrate tests on testing/code/test_source to tmp_path
2021-01-01 20:44:40 +02:00
sousajo ac428f67eb pytest-dev#8204 migrate tests on testing/code/test_source to tmp_path 2021-01-01 16:55:03 +00:00
sousajf1 20c59e3aa4
pytest-dev#8204 migrate some tests to tmp_path fixture (#8209)
migrating some tests from tmpdir to tmp_path fixture
2021-01-01 17:25:11 +02:00
Ran Benita 7d306e9e86 reports: BaseReport.{passed,failed,skipped} more friendly to mypy
Not smart enough to understand the previous code.
2021-01-01 15:22:05 +02:00
Anton 48c9a96a03
Fix failing staticmethod tests if they are inherited (#8205)
* Fix failing staticmethod tests if they are inherited

* add comments, set default=None
2020-12-30 19:00:37 -08:00
Ran Benita 7585221d55
Merge pull request #8195 from christophebedard/add-missing-space-version-option-help-message
Add missing space in '--version' help message
2020-12-30 11:57:02 +02:00
pre-commit-ci[bot] ee03e31831
[pre-commit.ci] pre-commit autoupdate (#8201)
* [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-30 11:56:09 +02:00
Christophe Bedard bf9b59b3c8 Add missing space in '--version' help message 2020-12-28 10:50:06 -05:00
Ran Benita bd76042344 python: export pytest.Metafunc for typing purposes
The type cannot be constructed directly, but is exported for use in type
annotations, since it is reachable through existing public API.
2020-12-26 21:05:02 +02:00
Ran Benita d8d2df7e6f
Merge pull request #8174 from bluetech/py-to-pathlib-5
More py.path -> pathlib conversions
2020-12-26 15:01:07 +02:00
Ran Benita ca4effc822 Convert most of the collection code from py.path to pathlib 2020-12-22 21:09:36 +02:00
Ran Benita 4faed28261 testing: convert some tmpdir to tmp_path
The tmpdir fixture (and its factory variant) is soft-deprecated in favor
of the tmp_path fixture.
2020-12-22 21:08:25 +02:00
Ran Benita 170a2c5040 testing/test_config: check inipath instead of inifile
inifile is soft-deprecated in favor of inipath.
2020-12-22 21:08:25 +02:00
Ran Benita 8b220fad4d testing/test_helpconfig: remove unclear comment 2020-12-22 21:08:25 +02:00
Ran Benita 92ba96b061 code: convert from py.path to pathlib 2020-12-22 21:08:25 +02:00
Ran Benita 813ce45985
Merge pull request #8179 from bluetech/typing-public-mark
mark: expose Mark, MarkDecorator, MarkGenerator under pytest for typing purposes
2020-12-22 16:32:02 +02:00
dependabot[bot] 1839713b71
build(deps): bump pytest-mock in /testing/plugins_integration
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.3.1 to 3.4.0.
- [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.3.1...v3.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 03:07:23 +00:00