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
Ran Benita
6aa4d1c7ab
mark: export pytest.MarkGenerator 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-20 15:59:20 +02:00
Ran Benita
7aa2240832
testing/test_nodes: fix fake session to be more accurate
...
The type of _initialpaths is `FrozenSet[Path]`.
2020-12-19 14:52:40 +02:00
Ran Benita
042d12fae6
doctest: use Path instead of py.path where possible
2020-12-19 14:52:40 +02:00
Ran Benita
2c05a7babb
config: let main() accept any os.PathLike instead of just py.path.local
...
Really it ought to only take the List[str], but for backward
compatibility, at least get rid of the explicit py.path.local check.
2020-12-19 14:52:40 +02:00
antonblr
196b173c8a
address comments
2020-12-18 12:36:20 -08:00
antonblr
15156e94c4
tests: Migrate to pytester - final update
2020-12-18 11:02:38 -08:00
Ran Benita
d46ecbc18b
terminal: fix "(<Skipped instance>)" skip reason in test status line
2020-12-15 22:24:25 +02:00
Jakob van Santen
9ccbf5b899
python_api: handle array-like args in approx() ( #8137 )
2020-12-15 08:49:29 -03:00
Ran Benita
6c899a0afa
Merge pull request #8144 from bluetech/py-to-pathlib-4
...
hookspec: add pathlib.Path alternatives to py.path.local parameters in hooks
2020-12-15 13:06:06 +02:00
Anton
8eef8c6004
tests: Migrate to pytester - incremental update ( #8145 )
2020-12-15 13:02:32 +02:00
Ran Benita
592b32bd69
hookspec: add pathlib.Path alternatives to py.path.local parameters in hooks
...
As part of the ongoing migration for py.path to pathlib, make sure all
hooks which take a py.path.local also take an equivalent pathlib.Path.
2020-12-15 00:34:23 +02:00
Ran Benita
2cb34a99cb
Some py.path.local -> pathlib.Path
2020-12-15 00:29:13 +02:00