Olga Matoula
2ad1b589af
Add docs on pytest.warns(None) deprecation ( #9495 )
...
* Add docs on pytest.warns(None) deprecation
* Add new section for common warnings use cases
* Fix references for warnings use cases
* Fix reference link
2022-01-13 18:32:22 +00:00
Ran Benita
f1aa7a25de
Merge pull request #9493 from bluetech/conftesting
...
Some conftest changes
2022-01-12 10:38:14 +02:00
Ran Benita
a425f15330
Merge pull request #9494 from bluetech/instance-property
...
python: add back `instance` accessor to all python nodes, not just Function
2022-01-10 21:08:46 +02:00
dependabot[bot]
0d5f52b127
build(deps): Bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 4.0 to 4.0.1.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/4.0...4.0.1 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-01-10 03:02:30 +00:00
Ran Benita
161bc48117
config: get rid of _conftestpath2mod
...
It duplicates what PluginManager already knows, and no longer needed now
that symlinks are not resolved (see previous commit).
2022-01-09 12:33:45 +02:00
Ran Benita
f08a77de77
python: add back `instance` accessor to all python nodes, not just Function
...
Regressed in 062d91ab4
(pytest 7.0.0rc1 only).
Fix #9486 .
2022-01-09 12:14:46 +02:00
Ran Benita
ed83efaf4b
testing/test_monkeypatch: fix some patches leaking into pytest code
...
The tests patch `os.path.abspath` which can break some pytest internal
code since the patching is not undone immediately.
2022-01-09 00:13:40 +02:00
Bruno Oliveira
696f955ff8
Split wrappers and non-wrappers in test_load_initial_conftest_last_ordering
...
Seems better to test which one is which explicitly.
2022-01-04 10:03:30 -03:00
Bruno Oliveira
4038752bf3
Ensure Config.inifile is available during pytest_cmdline_main
...
Fix #9396
2022-01-04 10:03:28 -03:00
Anthony Sottile
b0aabe4081
fix mypy 0.930 errors
2021-12-30 06:19:29 -08:00
Hugo van Kemenade
61417b2551
Drop support for EOL Python 3.6
2021-12-30 13:25:34 +02:00
Hugo van Kemenade
1fd3601caa
Drop support for EOL Python 3.6
2021-12-30 12:37:18 +02:00
Ran Benita
b9663fed6f
Merge pull request #9442 from hramezani/drop_python_36
...
Drop Python3.6 in CI, setup.cfg, and readme.
2021-12-30 12:22:13 +02:00
dependabot[bot]
4eebfb2f19
build(deps): Bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.10 to 4.0.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.10...4.0 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-12-28 15:16:38 +00:00
Hasan Ramezani
77042f77cc
Remove breakpoint support checking since all python versions support it.
2021-12-28 10:11:45 +01:00
Hasan Ramezani
3d7cd77017
Update syntax to Python3.7+.
2021-12-28 10:11:35 +01:00
Kian Meng, Ang
55debfad1f
Fix typos ( #9424 )
2021-12-27 09:23:15 -03:00
Ran Benita
7fc2cf51c2
Merge pull request #9441 from bluetech/nose-setup-callable
...
python: skip nose setup/teardown fixtures if non-callable
2021-12-27 11:09:51 +02:00
Ran Benita
10e21dadee
python: skip nose setup/teardown fixtures if non-callable
...
Since commit 89f0b5b5a2
cases as in the
added test started to fail, like they do for the standard pytest names
(`setup_module` etc). But the name `setup` in particular is way too
common for us to start taking it over more aggressively, so restore the
previous behavior which required the object to be callable.
Fix #9391 .
2021-12-25 12:09:11 +02:00
Anthony Sottile
c69b84f236
fix typing issues in mypy 0.920
2021-12-21 20:42:32 -05:00
Bruno Oliveira
913439f5e5
Fix test_errors_in_xfail_skip_expressions for Python 3.10.1
...
Decided to remove the condition altogether as seems reasonable to state
that our own test suite requires Python 3.10.1.
Fix #9413
2021-12-16 10:18:07 -03:00
Yuval Shimon
3bbadda0cf
Merge pull request #9407 from yuvalshi0/remove-eq-format
...
Avoid specialized assert formatting when we detect that __eq__ is overridden
2021-12-14 10:53:56 +02:00
dependabot[bot]
a3cf2ad3bc
build(deps): Bump pytest-django in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.5.1...v4.5.2 )
---
updated-dependencies:
- dependency-name: pytest-django
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 03:02:33 +00:00
dependabot[bot]
4d6e8a310b
build(deps): Bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.9 to 3.2.10.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.9...3.2.10 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-12-12 14:26:36 +00:00
Yuval Shimon
0ea039db60
adding auto_detect=true test
2021-12-12 16:11:33 +02:00
Yuval Shimon
0c45065040
removing coverage on eq method
2021-12-12 15:39:30 +02:00
Yuval Shimon
7cf2b51d8e
Merge branch 'pytest-dev:main' into remove-eq-format
2021-12-12 15:16:58 +02:00
Yuval Shimon
897395afd5
fix 9326
2021-12-12 14:38:45 +02:00
Ran Benita
0c8a54ab77
Merge pull request #9310 from bluetech/test-main-same-mod
...
testing/test_session: add a regression test for an old bug
2021-12-11 22:26:28 +02:00
Ran Benita
ee93557ef3
Remove `PytestRemovedIn7Warning`
...
Fix #8838 .
2021-12-08 15:58:08 +02:00
Ran Benita
0f39f11d88
Remove deprecated `pytest.collect` module
2021-12-07 22:27:35 +02:00
Ran Benita
4a45a5e983
Remove deprecated `-k foobar:` syntax
2021-12-07 22:27:35 +02:00
Ran Benita
927d9d274f
Remove deprecated `-k -foobar` syntax
2021-12-07 22:27:35 +02:00
Ran Benita
41d8fb09ca
Remove deprecated `pytest_warning_captured` hook
2021-12-07 22:27:35 +02:00
Ran Benita
0b0e2d2dbb
Remove deprecated `_fillfuncargs` function
2021-12-07 22:27:35 +02:00
Yuval Shimon
dc7091502d
Fixed error message prints function decorators when using assert in Python 3.9 and above. ( #9359 )
2021-12-07 11:31:03 +02:00
dependabot[bot]
17e2ecb253
build(deps): Bump pytest-django in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.4.0 to 4.5.1.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.4.0...v4.5.1 )
---
updated-dependencies:
- dependency-name: pytest-django
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-12-06 03:02:03 +00:00
Bruno Oliveira
a335ade1f5
Rename pathlib hook parameters ( #9363 )
...
* Rename pytest_ignore_collect fspath parameter to collection_path
* Rename pytest_collect_file fspath parameter to file_path
* Rename pytest_pycollect_makemodule fspath parameter to module_path
* Rename pytest_report_header startpath parameter to start_path
* Rename pytest_report_collectionfinish startpath parameter to start_path
* Update docs with the renamed parameters
* Use pytest-flakes fork temporarily to prove it works
* Use pytest-flakes 4.0.5
2021-12-03 13:14:09 +01:00
dependabot[bot]
a0a37adfb2
build(deps): Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.3.4 to 3.4.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/3.3.4...3.4.0 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-11-29 03:02:13 +00:00
Ran Benita
df9e94fbca
Change deprecation warnings into errors for 7.0 release, using a new mechanism ( #9309 )
2021-11-21 17:13:44 +02:00
Bruno Oliveira
bd897513f2
Skip TestPyCacheDir.test_sys_pycache_prefix_integration on Windows + Python 3.9
...
Related to #9298
2021-11-19 11:22:08 -03:00
Ran Benita
43213add57
testing/test_session: add a regression test for an old bug
...
Nothing tests this currently. Make sure it doesn't regress if/when the
complex code in `Session.collect` is cleaned up.
2021-11-15 23:22:54 +02:00
Ran Benita
a172a4141b
Change PytestRemovedIn7Warning to error by default
...
Per our backward compatibility policy.
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-11-14 23:57:10 +02:00
Ran Benita
128f29ee35
Categorize deprecation warnings to `PytestRemovedInXWarning`
...
Closes #7480 .
This allows us to more easily follow our deprecation policy of turning
warnings into errors for the X.0 releases before complete removal in
X.1.
It also makes the deprecation timeline clear to both the users and
pytest developers -- it can be hard to keep track.
Note that the designation is not meant to be a binding contract - if the
time comes for removal of a specific deprecation but we decide it's too
soon, can just bump it to the next major.
Inspired by Django:
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/submitting-patches/#deprecating-a-feature
2021-11-14 23:57:10 +02:00
Ran Benita
062d91ab47
python: remove the `Instance` collector node
2021-11-13 14:03:44 +02:00
Florian Bruhin
5d87a27434
Elide pytest-internal paths for --fixtures ( #9281 )
...
* Elide pytest-internal paths for --fixtures
Fixes #8822
* Make flake8 happy
2021-11-10 15:16:41 +01:00
Ran Benita
f87df9c52e
nodes: keep plugins which subclass Item, File working for a bit more ( #9279 )
...
* nodes: keep plugins which subclass Item, File working for a bit more
Fix #8435 .
* Update src/_pytest/nodes.py
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Florian Bruhin <me@the-compiler.org>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-11-08 14:51:04 +00:00
Simon K
eb6c4493b2
Deprecation of `msg=` for both `pytest.skip()` and `pytest.fail()`. ( #8950 )
...
* porting pytest.skip() to use reason=, adding tests
* avoid adding **kwargs, it breaks other functionality, use optional msg= instead
* deprecation of `pytest.fail(msg=...)`
* fix bug with not capturing the returned reason value
* pass reason= in acceptance async tests instead of msg=
* finalising deprecations of `msg` in `pytest.skip()` and `pytest.fail()`
* Update doc/en/deprecations.rst
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
* Update doc/en/deprecations.rst
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
* fix failing test after upstream merge
* adding deprecation to `pytest.exit(msg=...)`
* add docs for pytest.exit deprecations
* finalising deprecation of msg for pytest.skip, pytest.exit and pytest.fail
* hold a reference to the Scope instance to please mypy
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-11-08 15:31:14 +01:00
dependabot[bot]
ff9e51c171
build(deps): Bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.8 to 3.2.9.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.8...3.2.9 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 03:01:45 +00:00
Ran Benita
89f0b5b5a2
nose: fix class- and module-level fixture behavior
...
Fixes #9272 .
Fixing the issue directly in the plugin is somewhat hard, so do it in
core. Since the plugin is going to be deprecated, I figure it's OK to
cheat a bit.
2021-11-06 14:45:24 +02:00
Ran Benita
a53abe93d8
Merge pull request #9208 from bluetech/legacypath-plugin
...
Add legacypath plugin, move py.path stuff there
2021-11-02 20:35:12 +02:00
denivyruck
0191563fd6
DoctTest line numbers not found due to method wrapping ( #8861 )
...
Closes #8796
2021-11-01 09:01:25 +02:00
Ran Benita
1de5c07b95
Merge pull request #9255 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-bdd-5.0.0
...
build(deps): Bump pytest-bdd from 4.1.0 to 5.0.0 in /testing/plugins_integration
2021-11-01 08:58:37 +02:00
Alexander King
31c207a0b5
Support forwardslash characters in identifiers ( #9249 )
...
Closes #8377 .
2021-11-01 08:54:18 +02:00
dependabot[bot]
8932970a68
build(deps): Bump pytest-bdd in /testing/plugins_integration
...
Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd ) from 4.1.0 to 5.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-bdd/releases )
- [Changelog](https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-bdd/compare/4.1.0...5.0.0 )
---
updated-dependencies:
- dependency-name: pytest-bdd
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 03:01:28 +00:00
Ran Benita
c3dff755af
Move Node.fspath to legacypath plugin
2021-10-28 21:51:51 +03:00
Ran Benita
ce7cff9f8e
Move pathlist support to legacypath plugin
2021-10-28 21:51:51 +03:00
Ran Benita
7c0011374c
Move FixtureRequest.fspath to legacypath plugin
2021-10-28 21:51:51 +03:00
Ran Benita
a1a605a63e
Move Cache.makedir to legacypath plugin
2021-10-28 21:51:51 +03:00
Ran Benita
5e883f5195
Move tmpdir to legacypath plugin
2021-10-28 21:51:51 +03:00
Ran Benita
1df28a4450
Move testdir to legacypath plugin
2021-10-28 21:51:51 +03:00
Ran Benita
b7fc0003fd
Merge pull request #9232 from bluetech/deprecate-node-fspath-args
...
Deprecate Node constuctor fspath argument, and other small changes/fixes
2021-10-27 09:26:57 +03:00
Ran Benita
7706fd6840
nodes: deprecate fspath arguments to node constructors
...
This is unfortunately a dependency on `py.path` which cannot be moved to
an external plugins or eased in any way, so has to be deprecated in
order for pytest to be able to eventually remove the dependency on `py`.
2021-10-27 08:36:10 +03:00
Ran Benita
99363ad7ff
recwarn: fix was -> were in DID NOT WARN message
2021-10-27 08:36:10 +03:00
Ran Benita
11e36c8493
Make transitive Pytester types public
...
Export `HookRecorder`, `RecordedHookCall` (originally `ParsedCall`),
`RunResult`, `LineMatcher`.
These types are reachable through `Pytester` and so should be public
themselves for typing and other purposes.
The name `ParsedCall` I think is too generic under the `pytest`
namespace, so rename it to `RecordedHookCall`.
The `HookRecorder`'s constructor is made private -- it should only be
constructed by `Pytester`.
`LineMatcher` and `RunResult` are exported as is - no private and no
rename, since they're being used.
All of the classes are made final as they are not designed for
subclassing.
2021-10-23 10:59:18 +03:00
Ran Benita
259cff59f5
Remove {pytester,testdir}.Session aliases
...
This causes `Session` documentation to be rendered again in full under
`pytester` and `testdir` in the API Reference. I tried but couldn't get
sphinx to hide it.
Since it's a pretty odd thing to have (should just use
`pytest.Session`), and I couldn't find any plugin which uses this, let's
just remove it.
2021-10-23 10:25:29 +03:00
Ran Benita
5fd182f3de
Use public API for adding config cleanup
...
No need to spuriously access the private internals of Config.
2021-10-22 11:03:27 +03:00
Bruno Oliveira
f5fd2fb176
Improve UX during errors while parsing warning filters
...
Fix #7864
Fix #9218
Closes #8343
Closes #7877
2021-10-21 13:15:41 -03:00
dependabot[bot]
080fc81971
build(deps): Bump pytest-asyncio from 0.15.1 to 0.16.0 in /testing/plugins_integration ( #9212 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 19:16:55 -03:00
dependabot[bot]
73fb797bbd
build(deps): Bump anyio[curio,trio] from 3.3.3 to 3.3.4 in /testing/plugins_integration ( #9211 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 19:16:16 -03:00
Cristian Vera
cbcfeca78c
Cache.set preserves key order when saving dicts ( #9206 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-10-18 19:15:34 -03:00
Ran Benita
a3b69d9d83
Remove py version printing, traceback filtering, freezing
...
Not so important anymore, and makes it easier to remove the py
dependency.
2021-10-16 12:01:31 +03:00
Ran Benita
bc2f20722c
testing: remove a few redundant py references
2021-10-16 11:58:35 +03:00
dependabot[bot]
110d70ec88
build(deps): bump django from 3.2.7 to 3.2.8 in /testing/plugins_integration ( #9190 )
...
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-10-11 12:44:28 +00:00
dependabot[bot]
d0cc45d723
build(deps): bump anyio[curio,trio] from 3.3.2 to 3.3.3 in /testing/plugins_integration ( #9189 )
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.3.2 to 3.3.3.
- [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/3.3.2...3.3.3 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-11 09:25:51 -03:00
Ran Benita
da3b3012b1
Merge pull request #9184 from bluetech/reportinfo-pathlike
...
[7.0] Change `Node.reportinfo()` return value from `py.path` to `str|os.PathLike[str]`
2021-10-11 14:33:03 +03:00
Ran Benita
14a879b6d1
Merge pull request #9183 from bluetech/rm-redundent-osfspath
...
Remove redundant explicit os.fspath calls
2021-10-09 19:14:55 +03:00
Bernát Gábor
3407fe63e2
Support the importlib.resources files API in rewritten files ( #9173 )
2021-10-09 10:54:44 -03:00
Ran Benita
7eee5c1634
Change `Node.reportinfo()` return value from `py.path` to `str|os.PathLike[str]`
...
`reportinfo()` is the last remaining py.path-only code path in pytest,
i.e. the last piece holding back py.path deprecation. The problem with
it is that plugins/users use it from both sides -- implementing it
(returning the value) and using it (using the return value). Dealing
with implementers is easy enough -- allow to return `os.PathLike[str]`.
But for callers who expect strictly `py.path` this will break and
there's not really a good way to provide backward compat for this.
From analyzing a corpus of 680 pytest plugins, the vast majority of
`reportinfo` appearances are implementations, and the few callers don't
actually access the path part of the return tuple.
As for test suites that might access `reportinfo` (e.g. using
`request.node.reportinfo()` or other ways), that is much harder to
survey, but from the ones I searched, I only found case
(`pytest_teamcity`, but even then it uses `str(fspath)` so is unlikely
to be affected in practice). They are better served with using
`node.location` or `node.path` directly.
Therefore, just break it and change the return type to
`str|os.PathLike[str]`.
Refs #7259 .
2021-10-09 15:02:03 +03:00
Ran Benita
5059b31a73
Remove redundant explicit os.fspath calls
...
Python calls it on its own.
2021-10-09 13:44:44 +03:00
Jeff Rasley
e84ba80301
Update pastebin URL from bpaste to bpa.st ( #9131 )
2021-10-06 08:12:48 -03:00
Ran Benita
cf4495ffe1
mark/structures: fix NodeKeywords.{__iter__,__len__} given duplicates
...
Regressed in c4b9b14a4
-- the `set` stuff had a reason which I had
missed.
2021-10-06 11:24:28 +03:00
Ran Benita
c9267af3bf
Merge pull request #9166 from bluetech/optimize-imply-path
...
nodes: micro-optimize _imply_path
2021-10-06 10:50:10 +03:00
Ran Benita
076ac901bb
nodes: micro-optimize _imply_path
2021-10-06 10:29:52 +03:00
Bruno Oliveira
14b79a66a3
Merge pull request #9025 from davidszotten/more_verbose_for_ci
2021-10-05 16:52:47 -03:00
Bruno Oliveira
9546fb713a
Merge pull request #9066 from eamanu/fix-8994
2021-10-05 16:52:08 -03:00
Bruno Oliveira
459e10b802
Merge pull request #9133 from okken/9113_deselected_assert_outcomes
2021-10-05 16:50:42 -03:00
Ran Benita
6a5211f369
rewrite: fixup end_lineno, end_col_offset of rewritten asserts
...
These are new additions in Python 3.8:
https://docs.python.org/3/whatsnew/3.8.html#ast
I'm not sure what's using them but we should set them anyway.
2021-10-05 10:51:09 +03:00
Brian Okken
c82bda259c
Add a `pythonpath` setting to allow paths to be added to `sys.path`. ( #9134 )
2021-10-05 09:36:38 +03:00
Ran Benita
e5468681b0
Use attr.s(auto_attribs=True) in more places
...
It's nicer to read without the attr.ib noise.
2021-10-04 19:24:12 +03:00
dependabot[bot]
c061412a8b
build(deps): bump pytest-cov in /testing/plugins_integration
...
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov ) from 2.12.1 to 3.0.0.
- [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.12.1...v3.0.0 )
---
updated-dependencies:
- dependency-name: pytest-cov
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 03:01:33 +00:00
Ran Benita
5fc3e35afb
Merge pull request #9144 from bluetech/py36_order_by_definition
...
py36+ tests are definition ordered [v2]
2021-10-01 16:17:37 +03:00
Brian Okken
6d6cfd839a
Add a `deselected` parameter to `assert_outcomes()`
2021-09-29 07:22:53 -07:00
Bruno Oliveira
e3efbd4b39
Merge pull request #9127 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-rerunfailures-10.2
...
build(deps): bump pytest-rerunfailures from 10.1 to 10.2 in /testing/plugins_integration
2021-09-27 08:13:15 -03:00
dependabot[bot]
222fdd4a58
build(deps): bump pytest-rerunfailures in /testing/plugins_integration
...
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures ) from 10.1 to 10.2.
- [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases )
- [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/10.1...10.2 )
---
updated-dependencies:
- dependency-name: pytest-rerunfailures
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 03:02:31 +00:00
dependabot[bot]
442abeafd0
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.3.1 to 3.3.2.
- [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/3.3.1...3.3.2 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 03:02:27 +00:00
Florian Bruhin
112204cf8d
Fix non-sensical error message ( #9077 )
...
* Fix non-sensical error message
Introduced in 12de92cd2b
/ #7698
* Add a test
* Put the unit back into unittest
* [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>
2021-09-24 06:15:53 +02:00
dependabot[bot]
87bbbaa0dc
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.3.0 to 3.3.1.
- [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/3.3.0...3.3.1 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 03:01:43 +00:00
Bruno Oliveira
4274af1c28
Merge pull request #9076 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2.7
...
build(deps): bump django from 3.2.5 to 3.2.7 in /testing/plugins_integration
2021-09-06 11:13:20 -03:00
dependabot[bot]
ba14a81c7f
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.5 to 3.2.7.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.5...3.2.7 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 03:01:53 +00:00
dependabot[bot]
af09415cd1
build(deps): bump pytest-twisted in /testing/plugins_integration
...
Bumps [pytest-twisted](https://github.com/pytest-dev/pytest-twisted ) from 1.13.3 to 1.13.4.
- [Release notes](https://github.com/pytest-dev/pytest-twisted/releases )
- [Commits](https://github.com/pytest-dev/pytest-twisted/compare/v1.13.3...v1.13.4 )
---
updated-dependencies:
- dependency-name: pytest-twisted
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 03:01:49 +00:00
Emmanuel Arias
59d314de3d
Show fullname on direct Node construction warning
...
This commit add the fullname on the Node construction warning.
Also add a test for this case.
2021-09-01 16:13:26 -03:00
Simon K
740abd9684
#9062 - Allow `--stepwise-skip` to implicitly enable `--stepwise` ( #9064 )
...
* #9062 - Allow `--stepwise-skip` to implicitly enable `--stepwise`
* Update changelog/9062.improvement.rst
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-08-30 19:24:14 +01:00
Kale Kundert
af42e7154a
Prevent approx from being used without a comparison ( #9061 )
...
Some of the top search-engine hits for pytest.approx use the function without actually comparing it to anything.
This PR will cause these tests to fail by implementing approx.__bool__() to raise an AssertionError that briefly explains how to correctly use approx.
2021-08-30 18:19:31 +00:00
Jakub Kulík
e146aaa2e2
Fix cwd removal on Solaris
2021-08-24 12:11:06 +02:00
David Szotten
d5c020d8c5
always show full diff in ci
...
follow-up to #1314 , for similar reasons
closes #9023
2021-08-19 20:17:43 +01:00
Éloi Rivard
7770dacb8d
pygments themes are customizable
2021-08-13 19:15:01 +02:00
Ran Benita
25c65616f4
mark/expression: allow backslash characters in identifiers
...
Fixes #8983 .
2021-08-08 11:56:17 +03:00
dependabot[bot]
c22bf3ff3e
build(deps): bump twisted in /testing/plugins_integration
...
Bumps [twisted](https://github.com/twisted/twisted ) from 21.2.0 to 21.7.0.
- [Release notes](https://github.com/twisted/twisted/releases )
- [Changelog](https://github.com/twisted/twisted/blob/trunk/NEWS.rst )
- [Commits](https://github.com/twisted/twisted/compare/twisted-21.2.0...twisted-21.7.0 )
---
updated-dependencies:
- dependency-name: twisted
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-08-02 03:01:59 +00:00
Bruno Oliveira
a83b359cf0
Refactor internal scope handling by introducing Scope enum
...
PR #8913
2021-08-01 06:11:56 -03:00
Simon K
ef5d81ad5c
add `assert_outcomes(warnings=)` functionality to `RunResult`
...
* expose `warnings=` to pytester `assert_outcomes()`
* fix test fallout from adding warnings= to assert_outcomes()
* #closes 8593 - Improve test and add a `changelog` entry for the change
2021-07-31 15:25:10 +01:00
Simon K
c27db3bd8e
Deprecate pytest_cmdline_preparse
...
Close #8592
PR #8956
2021-07-31 10:53:43 -03:00
Ran Benita
6247a95601
Merge pull request #8920 from bluetech/stabilize-store
...
Rename Store to Stash and make it public
2021-07-31 10:32:30 +03:00
Simon K
d5c62d0326
Making `--debug` more configurable for the pytest user ( #8955 )
...
Close #8954
2021-07-30 17:37:38 -03:00
Simon K
6d6bc97231
#7124 : Fix `--doctest-modules` crashing when `__main__.py` is present ( #8949 )
...
* Fix ``--doctest-modules`` crashing when ``__main__.py`` is present
2021-07-27 22:50:26 +01:00
Bruno Oliveira
90b70a7efe
Merge pull request #8942 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-twisted-1.13.3
...
build(deps): bump pytest-twisted from 1.13.2 to 1.13.3 in /testing/plugins_integration
2021-07-26 06:58:02 -03:00
dependabot[bot]
b35a3de006
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.2.1 to 3.3.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/3.2.1...3.3.0 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 03:01:29 +00:00
dependabot[bot]
de8ad53963
build(deps): bump pytest-twisted in /testing/plugins_integration
...
Bumps [pytest-twisted](https://github.com/pytest-dev/pytest-twisted ) from 1.13.2 to 1.13.3.
- [Release notes](https://github.com/pytest-dev/pytest-twisted/releases )
- [Commits](https://github.com/pytest-dev/pytest-twisted/compare/v1.13.2...v1.13.3 )
---
updated-dependencies:
- dependency-name: pytest-twisted
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 03:01:26 +00:00
Ran Benita
2aaea20cb2
Use {node,config}.stash instead of ._store
...
Use the public name. The `_store` name is only because some plugins
started using it anyway - will be removed at some point.
2021-07-24 17:40:08 +03:00
Ran Benita
5f39e31736
stash: implement __len__
...
Part of the MutableMapping abc (though we can't actually implement
that).
2021-07-18 15:32:52 +03:00
Ran Benita
5470d33e82
store: rename Store to Stash
...
The name "stash" is a bit more distinguishable and more evocative of the
intended usage.
2021-07-18 15:21:27 +03:00
Naveen-Pratap
febb978651
Update error message for module level skip to include 'allow_module_level' ( #8906 )
...
Co-authored-by: Naveen <NaveenPr1@microland.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-07-14 14:27:26 +00:00
Bruno Oliveira
69356d20cf
Merge pull request #8903 from nicoddemus/remove-fspath-deprecation
...
Revert fspath deprecation
2021-07-14 09:32:48 -03:00
Bruno Oliveira
828fde1156
Merge pull request #8858 from The-Compiler/update-doc-urls
2021-07-14 09:28:46 -03:00
Bruno Oliveira
794f467647
Merge pull request #8854 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2.5
2021-07-13 08:30:28 -03:00
Bruno Oliveira
913d0c2380
Merge pull request #8855 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-rerunfailures-10.1
...
build(deps): bump pytest-rerunfailures from 10.0 to 10.1 in /testing/plugins_integration
2021-07-13 08:30:13 -03:00
Bruno Oliveira
59b86cf328
Merge pull request #8856 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-bdd-4.1.0
...
build(deps): bump pytest-bdd from 4.0.2 to 4.1.0 in /testing/plugins_integration
2021-07-13 08:29:47 -03:00
Bruno Oliveira
2c4c57e135
Revert fspath deprecation
...
It is not clear yet how we should proceed with this deprecation
because `pytest.Item.reportinfo` is public API and returns a `py.path` object,
and is not clear how plugins and our examples should handle that.
Reverting just the deprecation aspect of #8251 so we can get a 7.0.0 release out.
We will reintroduce the deprecation later once we have a clear path moving forward with replacing `reportinfo`.
Closes #8445
Closes #8821
2021-07-13 08:24:39 -03:00
Graeme Smecher
5c04674e96
Generate useful parameterization IDs for complex() numbers.
2021-07-12 12:27:24 -07:00
Miro Hrončok
5165bf97c6
Revert "Adjust enum reprs for Python 3.10" ( #8896 )
...
This reverts commit 710446420c
.
The change was reverted in Python 3.10.0b4:
https://mail.python.org/archives/list/python-dev@python.org/message/LSTMFAPSPD3BGZ4D6HQFODXZVB3PLYKF/
2021-07-12 14:32:27 +00:00
Taneli Hukkinen
5987251407
Add a test for invalid TOML file
2021-07-06 16:53:32 +03:00
Florian Bruhin
953fdabaf0
Adjust doc links for new scheme
...
Closes #8831
2021-07-06 09:11:35 +02:00
Taneli Hukkinen
e942b12b94
Support TOML v1.0.0 syntax in `pyproject.toml`
2021-07-06 00:26:01 +03:00
dependabot[bot]
904637baa7
build(deps): bump pytest-bdd in /testing/plugins_integration
...
Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd ) from 4.0.2 to 4.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-bdd/releases )
- [Changelog](https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-bdd/compare/4.0.2...4.1.0 )
---
updated-dependencies:
- dependency-name: pytest-bdd
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 03:01:53 +00:00
dependabot[bot]
3e108012d9
build(deps): bump pytest-rerunfailures in /testing/plugins_integration
...
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures ) from 10.0 to 10.1.
- [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases )
- [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/10.0...10.1 )
---
updated-dependencies:
- dependency-name: pytest-rerunfailures
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 03:01:51 +00:00
dependabot[bot]
2d5990c443
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.4...3.2.5 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 03:01:49 +00:00
Florian Bruhin
8347b59295
Update remaining 7.0 references ( #8834 )
2021-07-04 10:27:43 +02:00
Bruno Oliveira
109312ba86
Make --version write to stdout rather than stderr
...
Fix #8246
2021-06-28 15:56:26 -03:00
dependabot[bot]
51742e14a1
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.2.0 to 3.2.1.
- [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/3.2.0...3.2.1 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-28 03:01:47 +00:00
Ronny Pfannschmidt
d7b0e17205
issue a warning when Item and Collector are used in diamond inheritance ( #8447 )
...
* issue a warning when Items and Collector form a diamond
addresses #8435
* Apply suggestions from code review
Co-authored-by: Ran Benita <ran@unusedvar.com>
* Return support for the broken File/Item hybrids
* adds deprecation
* ads necessary support code in node construction
* fix incorrect mypy based assertions
* add docs for deprecation of Item/File inheritance
* warn when a non-cooperative ctor is encountered
* use getattr instead of cast to get the class __init__ for legacy ctors
* update documentation references for node inheritance
* clean up file+item inheritance test
enhance docs
move import upwards
Co-authored-by: Ran Benita <ran@unusedvar.com>
2021-06-24 11:45:32 +02:00
Florian Bruhin
f573b56bb6
Improve cache test and fix it in Docker ( #8785 )
...
* cache: Move repetitive code to fixture
* cache: Explicitly test for chmod result
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix lint
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-06-23 20:28:09 +02:00
Florian Bruhin
ac10fe0679
tests: Use less conflicting name for directory
...
Otherwise, if e.g. /outside is used for a Docker container, the test will fail
2021-06-22 13:25:52 +02:00
dependabot[bot]
d2886b8d23
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.1.0 to 3.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/3.1.0...3.2.0 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 03:01:37 +00:00
Bruno Oliveira
7eb0792cba
Add pytest.version_tuple
...
This adds `pytest.version_tuple`, which makes it simpler for users to do something depending on the pytest version, such as declaring hooks which are introduced in later versions.
This feature was added originally in https://github.com/pypa/setuptools_scm/pull/475 .
Followup to https://github.com/pytest-dev/pytest/pull/7605 .
2021-06-14 09:04:14 -03:00
Bruno Oliveira
c85b21eaa0
Remove outdated docs about pytest.warns and DeprecatedWarning
...
Since #2908 , the user doesn't need to set warning filters to capture
`DeprecationWarning` with `pytest.warns`.
Fix #8666
2021-06-12 12:09:26 -03:00
dependabot[bot]
85faaf8a1d
Bump pytest-django from 4.3.0 to 4.4.0 in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.3.0...v4.4.0 )
---
updated-dependencies:
- dependency-name: pytest-django
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-11 00:18:17 +00:00
dependabot[bot]
b04aa015b9
Bump pytest-cov from 2.12.0 to 2.12.1 in /testing/plugins_integration
...
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov ) from 2.12.0 to 2.12.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.12.0...v2.12.1 )
---
updated-dependencies:
- dependency-name: pytest-cov
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 23:10:22 +00:00
dependabot[bot]
bce0ceafe4
Bump django from 3.2.3 to 3.2.4 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.3...3.2.4 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-07 03:01:43 +00:00
dependabot[bot]
20f00997ff
Bump pytest-rerunfailures in /testing/plugins_integration
...
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures ) from 9.1.1 to 10.0.
- [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases )
- [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/9.1.1...10.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-31 03:01:08 +00:00
Ran Benita
1b5f5326d7
Merge pull request #8695 from bluetech/export-parser
...
argparsing: export Parser and OptionGroup for typing purposes
2021-05-26 11:20:03 +03:00
pre-commit-ci[bot]
c5bf5f6fb0
[pre-commit.ci] pre-commit autoupdate ( #8699 )
...
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.16.0 → v2.18.2](https://github.com/asottile/pyupgrade/compare/v2.16.0...v2.18.2 )
* [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>
2021-05-26 11:19:45 +03:00
dependabot[bot]
4a472952f7
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.0.1 to 3.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/3.0.1...3.1.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 03:01:18 +00:00
Ran Benita
538b5c2499
argparsing: export Parser and OptionGroup for typing purposes
...
`Parser` is used by many plugins and custom hooks. `OptionGroup` is
exposed by the `parser.addgroup` API.
The constructors of both are marked private, they are not meant to be
constructed directly.
2021-05-24 00:52:03 +03:00
Zac Hatfield-Dodds
c198a7a67e
Merge pull request #8677 from olgarithms/warns-no-arg-catches-any
2021-05-19 17:47:39 +10:00
dependabot[bot]
53a74feea7
Bump pytest-mock from 3.6.0 to 3.6.1 in /testing/plugins_integration
...
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock ) from 3.6.0 to 3.6.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases )
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.6.0...v3.6.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 10:53:38 +00:00
dependabot[bot]
8872e8e7c7
Bump pytest-django from 4.2.0 to 4.3.0 in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.2.0...v4.3.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 10:51:47 +00:00
Bruno Oliveira
eb7acba9e9
Merge pull request #8683 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2.3
...
Bump django from 3.2.2 to 3.2.3 in /testing/plugins_integration
2021-05-17 07:51:36 -03:00
Olga Matoula
3f414d7bbe
Ignore depredcated warns(None) overload errors from mypy
2021-05-17 09:50:59 +01:00
Olga Matoula
dd8ad3fa9c
Split warns matching string in multiple lines
2021-05-17 09:23:08 +01:00
dependabot[bot]
06718da5d6
Bump django from 3.2.2 to 3.2.3 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.2...3.2.3 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 03:01:19 +00:00
dependabot[bot]
c73e354019
Bump pytest-cov from 2.11.1 to 2.12.0 in /testing/plugins_integration
...
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov ) from 2.11.1 to 2.12.0.
- [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.11.1...v2.12.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 03:01:15 +00:00
Olga Matoula
dbe66d97b4
Add better warning msg for deprecated warns(None)
2021-05-16 12:07:39 +01:00
Olga Matoula
8b2f83772d
Catch any warning on warns with no arg passed
2021-05-15 18:50:39 +01:00
Rahul Kumaresan
c516dba69a
add feature to view fixture source location in invocations with --fixtures-per-test option ( #8626 )
...
* add feature to view fixture source location in invocations with --fixtures-per-test option
* remove unrelated changes to show_fixtures_per_test::test_doctest_items
* eshew the extraneous else in _show_fixtures_per_test.write_fixture
* enable the accommodation of multi-line docstring with --fixtures-per-test option
* add feature to view fixture source location in invocations with --fixtures
* add colour encoding to fixture location paths
* add changelog for #8606 fixing
* [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>
2021-05-14 14:38:55 +02:00
Miro Hrončok
51293de324
Ignore DeprecationWarnings in test_trial_error
...
Fixes https://github.com/pytest-dev/pytest/issues/8663
2021-05-12 13:38:19 +02:00
dependabot[bot]
0a07b71046
Bump django from 3.2 to 3.2.2 in /testing/plugins_integration ( #8652 )
...
Bumps [django](https://github.com/django/django ) from 3.2 to 3.2.2.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2...3.2.2 )
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 10:44:32 +02:00
Zac Hatfield-Dodds
3ae0103975
Merge pull request #8641 from rahul-kumi/fix/8548
...
add support for precision bit in LEVEL_NAME_FMT regex
2021-05-08 01:17:55 +10:00
Rahul Kumaresan
9e11d645b1
cleanup tests by removal of unused code elements
2021-05-07 17:56:35 +05:30
Rahul Kumaresan
80acc0ed6f
fix test_coloredlogformatter_with_width_precision test
2021-05-07 16:25:19 +05:30
Rahul Kumaresan
1e3fcece6d
enhance support for precision bit in LEVELNAME_FMT_REGEX regex
2021-05-07 16:16:40 +05:30
Ran Benita
113a860a1f
argparsing: support parser.addini(type="paths") which returns pathlib.Paths
2021-05-07 09:58:51 +03:00
Florian Bruhin
382599287f
Fix test_errors_in_xfail_skip_expressions on Python 3.10
2021-05-04 17:26:53 +02:00
Florian Bruhin
61be48b485
Fix test_collect_symlink_dir on Windows
2021-05-04 17:25:08 +02:00
Florian Bruhin
e354c5c919
Fix warning filters used in tests
2021-05-04 17:25:02 +02:00
Florian Bruhin
710446420c
Adjust enum reprs for Python 3.10
...
Potential fix for #8546
2021-05-04 17:24:50 +02:00
dependabot[bot]
f1a97512da
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.0.0 to 3.0.1.
- [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/3.0.0...3.0.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 03:01:15 +00:00
Tarcísio Fischer
9d9b84d175
Improve pytest.approx error messages readability (Pull request) ( #8429 )
...
Improve pytest.approx error messages readability (Pull request)
2021-04-30 07:36:56 -03:00
Parth Patel
992c403fc8
Improve `iterparentnodeids` to consume `/` parts until the first `::` ( #8577 )
...
* Fix issue where TestCase.setUpClass is not called for test methods with a / in its name by checking if there is :: before the selected / or any :: after. Also added a test case for this.
* removed print statement that was added
* Change iterparentnodeids to consume / parts until the first ::. Then consider ::. Tests were changed to reflect this.
* Update changelog/8509.improvement.rst
Co-authored-by: Ran Benita <ran@unusedvar.com>
2021-04-29 17:02:43 +03:00
Ran Benita
134d8f78d8
Merge pull request #8595 from nschloe/url-fixes
...
"fix" a couple of http -> https redirects
2021-04-26 20:05:32 +03:00
Nico Schlömer
9ef608ef76
"fix" a couple of http -> https redirects
...
Found with
urli-fix . -a http: -i pytest
2021-04-26 17:44:27 +02:00
Bruno Oliveira
1e2c2d972d
Merge pull request #8588 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.15.1
...
Bump pytest-asyncio from 0.15.0 to 0.15.1 in /testing/plugins_integration
2021-04-26 10:44:01 -03:00
Bruno Oliveira
0d0e5ed74a
Merge pull request #8589 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.0.0
...
Bump anyio[curio,trio] from 2.2.0 to 3.0.0 in /testing/plugins_integration
2021-04-26 10:43:55 -03:00
dependabot[bot]
8d93f6ff0b
Bump pytest-mock from 3.5.1 to 3.6.0 in /testing/plugins_integration
...
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock ) from 3.5.1 to 3.6.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases )
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.5.1...v3.6.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 03:01:18 +00:00
dependabot[bot]
11f6dc9de6
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 2.2.0 to 3.0.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.2.0...3.0.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 03:01:15 +00:00
dependabot[bot]
5a7be03285
Bump pytest-asyncio in /testing/plugins_integration
...
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio ) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases )
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.15.0...v0.15.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 03:01:13 +00:00
Anthony Sottile
67af623d9e
Merge pull request #8227 from encukou/defensive-get_source
...
Make code.FormattedExcinfo.get_source more defensive
2021-04-24 19:42:53 -07:00
Miro Hrončok
0a75c8e57b
Add a regression test for a more defensive code.FormattedExcinfo.get_source
2021-04-22 19:17:54 +02:00
Ran Benita
513247863a
Merge pull request #8562 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.15.0
...
Bump pytest-asyncio from 0.14.0 to 0.15.0 in /testing/plugins_integration
2021-04-20 16:25:57 +03:00
Miroslav Šedivý
fbe66244b8
Fix some typos, remove redundant words and escapes ( #8564 )
...
* doc: Fix typos, remove double words
* Remove redundant escapes in regex
2021-04-19 20:39:08 +00:00
dependabot[bot]
fb35851440
Bump pytest-asyncio in /testing/plugins_integration
...
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio ) from 0.14.0 to 0.15.0.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases )
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.14.0...v0.15.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 03:01:33 +00:00
Abdelrahman Elbehery
9078c3ce23
fix #8464 wrong root dir when -c is passed ( #8537 )
...
fix #8464 wrong root dir when -c is passed
2021-04-16 14:38:35 -03:00
Ran Benita
3c451751af
Merge pull request #8542 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.2.0
...
Bump pytest-django from 4.1.0 to 4.2.0 in /testing/plugins_integration
2021-04-14 12:50:28 +03:00
Ran Benita
6152135c29
Merge pull request #8541 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2
...
Bump django from 3.1.8 to 3.2 in /testing/plugins_integration
2021-04-14 12:50:01 +03:00
pre-commit-ci[bot]
d200598de9
[pre-commit.ci] pre-commit autoupdate ( #8547 )
...
* [pre-commit.ci] pre-commit autoupdate
* [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: Ran Benita <ran@unusedvar.com>
2021-04-14 12:49:09 +03:00
dependabot[bot]
22a17dba4e
Bump pytest-django from 4.1.0 to 4.2.0 in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.1.0...v4.2.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 03:01:33 +00:00
dependabot[bot]
e14bd4a480
Bump django from 3.1.8 to 3.2 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.8 to 3.2.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.8...3.2 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 03:01:30 +00:00
dependabot[bot]
207c07285f
Bump django from 3.1.7 to 3.1.8 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.7...3.1.8 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-08 20:05:44 +00:00
Ronny Pfannschmidt
41a90cd9fe
Merge pull request #8463 from RonnyPfannschmidt/workaround-8361
...
address #8361 - introduce hook caller wrappers that enable backward compat
2021-04-05 22:50:31 +02:00
Tadeu Manoel
b706a2c048
Fix error with --import-mode=importlib and modules containing dataclasses or pickle ( #7870 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Fixes #7856 , fixes #7859
2021-04-05 17:10:03 -03:00
Ran Benita
c49100cef8
tmpdir: prevent using a non-private root temp directory
...
pytest uses a root temp directory named `/tmp/pytest-of-<username>`. The
name is predictable, and the directory might already exists from a
previous run, so that's allowed.
This makes it possible for my_user to pre-create
`/tmp/pytest-of-another_user`, thus giving my_user control of
another_user's tempdir.
Prevent this scenario by adding a couple of safety checks. I believe
they are sufficient.
Testing the first check requires changing the owner, which requires
root permissions, so can't be unit-tested easily, but I checked it
manually.
2021-04-03 23:42:53 +03:00
Ran Benita
1278f8b97e
tmpdir: fix temporary directories created with world-readable permissions
...
(Written for a Unix system, but might be applicable to Windows as well).
pytest creates a root temporary directory under /tmp, named
`pytest-of-<username>`, and creates tmp_path's and other under it.
/tmp is shared between all users of the system.
This root temporary directory was created with 0o777&~umask permissions,
which usually becomes 0o755, meaning any user in the system could list
and read the files, which is undesirable.
Use 0o700 permissions instead. Also for subdirectories, because the root
dir is adjustable.
2021-04-03 23:42:53 +03:00
Ronny Pfannschmidt
aa10bff750
fix deprecation test for path/fspath hook args
2021-04-03 14:51:36 +02:00
Ronny Pfannschmidt
deb5b5bd96
fix #8371 : fix stack-level
2021-04-02 00:58:05 +02:00
Bruno Oliveira
c1bdff9e69
Merge pull request #8494 from nicoddemus/python-3.10
2021-03-27 11:32:31 -03:00
Bruno Oliveira
b2954e85d6
Adjust message for Python 3.10
...
Now the message includes the class name ("Skip.__init__() got multiple...").
2021-03-27 11:13:16 -03:00
Bruno Oliveira
d9f4cedf17
Merge pull request #8472 from bluetech/rm-unnecessary-py-path-4
...
testing: stop relying on comparing to py.path in fnmatcher tests
2021-03-26 07:43:37 -03:00
Bruno Oliveira
be8d63e33b
Increase truncation threshold with -v, disable with -vv
...
Fix #6682
Fix #8403
2021-03-26 07:05:30 -03:00
Florian Bruhin
bc055e8e69
Fix required_plugins with prereleases ( #8469 )
...
* Fix required_plugins with prereleases
Fixes #8456
* Fix existing tests
* Update changelog/8456.bugfix.rst
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-03-21 22:51:12 +01:00
Ronny Pfannschmidt
7ac7610089
add tresting for implication
2021-03-20 23:44:36 +01:00
Ronny Pfannschmidt
4ddf6c647c
test warnings and fix invocation bugs
2021-03-20 23:39:38 +01:00
Ran Benita
945cc0b5a1
testing: stop relying on comparing to py.path in fnmatcher tests
2021-03-20 21:58:45 +02:00
Thomas Grainger
3f71680ac0
Warn when a mark is applied to a fixture
...
Fixes #3664
2021-03-19 09:30:52 +00:00
Ran Benita
4690e4c510
reports: support any PathLike instead of only Path, py.path
...
The goal is to avoid referring to the legacy py.path.
2021-03-18 10:23:48 +02:00
Ran Benita
e515264eb1
Remove yet more unnecessary py.path uses
2021-03-18 10:23:48 +02:00
Ran Benita
fe215bda6b
Merge pull request #8446 from bluetech/unnecessary-py-path-2
...
More py.path removal work
2021-03-18 10:20:59 +02:00
Kale Kundert
dd3709718d
Merge pull request #8453 from encukou/rel-error-message
...
Fix value in error message about negative relative tolerance
2021-03-16 16:43:31 -04:00
pre-commit-ci[bot]
da4abd1c82
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2021-03-16 19:10:55 +00:00
Petr Viktorin
43b451e95e
Add tests for the error message
2021-03-16 20:09:17 +01:00
Ran Benita
f0c7043138
Remove/replace some more unnecessary uses of py.path
2021-03-15 10:39:44 +02:00
Ran Benita
a03ee02817
config: make `collect_ignore` accept any PathLike
...
The main reason is to remove a reference to `py.path`.
2021-03-15 10:39:32 +02:00
Ran Benita
b26d1bb18f
cacheprovider: add cache.mkdir() as a Path-returning replacement to makedir()
...
It is not possible to change a return type in a compatible way, so a new
method is added.
2021-03-15 10:39:31 +02:00
Ran Benita
59251e8a2a
Remove/replace some unneeded usages of py.path
2021-03-14 14:12:28 +02:00
Ran Benita
db539ed2b0
Merge pull request #8437 from bluetech/rm-typevar-prefix
...
Remove `_` prefix from TypeVars, expose ExceptionInfo
2021-03-13 19:01:29 +02:00
Pierre Mourlanne
af9f27a874
Approx decimal sequence mapping ( #8422 )
2021-03-13 16:01:23 +02:00
Ran Benita
f2d65c85f4
code: export ExceptionInfo for typing purposes
...
This type is most prominent in `pytest.raises` and we should allow to
refer to it by a public name.
The type is not in a perfectly "exposable" state. In particular:
- The `traceback` property with type `Traceback` which is derived from
the `py.code` API and exposes a bunch more types transitively. This
stuff is *not* exported and probably won't be.
- The `getrepr` method which probably should be private.
But they're already used in the wild so no point in just hiding them
now.
The __init__ API is hidden -- the public API for this are the `from_*`
classmethods.
2021-03-13 15:59:44 +02:00
Ran Benita
c9867bcc9d
Merge pull request #8416 from pytest-dev/pre-commit-ci-update-config
...
[pre-commit.ci] pre-commit autoupdate
2021-03-11 09:17:40 +02:00
Ronny Pfannschmidt
dbed1ff68f
adopt main terminology in the configs
...
ref pytest-dev/meta#8
2021-03-09 22:35:34 +01:00
Anthony Sottile
7a6ec5616d
clean up mkdtemp usage
...
Committed via https://github.com/asottile/all-repos
2021-03-08 19:12:08 -08:00
pre-commit-ci[bot]
ddde3266c6
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2021-03-08 16:55:59 +00:00
Anthony Sottile
79b03ce8db
Merge pull request #8411 from RonnyPfannschmidt/example-outcomes-check
...
fix bug in test for issue 519
2021-03-07 08:17:34 -08:00
Ronny Pfannschmidt
412fc001a0
fix bug in test for issue 519
...
assert the actual outcome and fix the filename
2021-03-07 15:01:39 +01:00
Ronny Pfannschmidt
77cb110258
drop usage of py.path.local calls
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-03-06 21:32:03 +01:00
Ronny Pfannschmidt
22dad53a24
implement Node.path as pathlib.Path
...
* reorganize lastfailed node sort
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-03-06 21:32:03 +01:00
Alexandros Tzannes
19a2f7425d
Merge pull request #8399 from atzannes/master
...
closes #8394
Generated fixture names for unittest/xunit/nose should start with underscore
2021-03-04 22:45:57 +02:00
Ran Benita
6e7dc8bac8
Merge pull request #8357 from matthewhughes934/remove-tmpdir-from-tests
...
Remove tmpdir from tests
2021-03-04 18:34:19 +02:00
Florian Bruhin
c14a9adba3
Fix skip signature ( #8392 )
...
* Fix test_strict_and_skip
The `--strict` argument was removed in #2552 , but the removal wasn't
actually correct - see #1472 .
* Fix argument handling in pytest.mark.skip
See #8384
* Raise from None
* Fix test name
2021-03-04 11:56:21 +01:00
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
Matthew Hughes
514f8e0680
fixup! Rename variables 'tmpdir'->'tmp_path'
2021-02-24 20:55:35 +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
Matthew Hughes
c9bb4c418f
fixup! Rename variables 'tmpdir'->'tmp_path'
...
* Add some more of these
* Also reintroduce+rename instances of fixture usages that were
'tmpdir'->'tmp_path'
2021-02-21 13:10:07 +00:00
Matthew Hughes
09d4c5e30a
Rename variables 'tmpdir'->'tmp_path'
...
Rename this variables reflecting the migrations made with 3bcd316f0
and
ed658d682
2021-02-20 18:24:58 +00:00
Matthew Hughes
0e5e4e03e6
Remove some unused 'tmpdir's
2021-02-20 18:01:42 +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
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
Bruno Oliveira
cb8142b8ec
Merge pull request #8139 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-html-3.1.1
...
build(deps): bump pytest-html from 3.1.0 to 3.1.1 in /testing/plugins_integration
2020-12-14 08:13:44 -03:00
dependabot[bot]
a09d8b1599
build(deps): bump pytest-html in /testing/plugins_integration
...
Bumps [pytest-html](https://github.com/pytest-dev/pytest-html ) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/pytest-dev/pytest-html/releases )
- [Changelog](https://github.com/pytest-dev/pytest-html/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-html/compare/v3.1.0...v3.1.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 03:07:30 +00:00
dependabot[bot]
92b444a914
build(deps): bump pytest-bdd in /testing/plugins_integration
...
Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd ) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/pytest-dev/pytest-bdd/releases )
- [Changelog](https://github.com/pytest-dev/pytest-bdd/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-bdd/compare/4.0.1...4.0.2 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 03:07:27 +00:00
antonblr
4ed9a38519
tests: Migrate testing/python to pytester fixture
2020-12-13 07:42:12 -08:00
Bruno Oliveira
7e2e6630ad
Merge pull request #8123 from nicoddemus/import-mismatch-unc
...
Compare also paths on Windows when considering ImportPathMismatchError
2020-12-13 10:35:11 -03:00
bot2x
28588bf535
migrates test_warnings.py from testdir to pytester
2020-12-13 14:13:49 +02:00
Ran Benita
37b154b1ec
Merge pull request #8122 from bluetech/py-to-pathlib-3
...
Some py.path.local -> pathlib.Path
2020-12-13 10:54:19 +02:00
Ran Benita
3302ff9949
terminal: when the skip/xfail is empty, don't show it as "()"
...
Avoid showing a line like
x.py::test_4 XPASS () [100%]
which looks funny.
2020-12-12 22:09:00 +02:00
Pedro Algarvio
b16c091253
Add `pytest_markeval_namespace` hook.
...
Add a new hook , `pytest_markeval_namespace` which should return a dictionary.
This dictionary will be used to augment the "global" variables available to evaluate skipif/xfail/xpass markers.
Pseudo example
``conftest.py``:
.. code-block:: python
def pytest_markeval_namespace():
return {"color": "red"}
``test_func.py``:
.. code-block:: python
@pytest.mark.skipif("color == 'blue'", reason="Color is not red")
def test_func():
assert False
2020-12-12 17:41:37 +02:00
Ran Benita
ed658d6829
Some py.path.local -> pathlib.Path
...
- Some conftest related functions
- _confcutdir
- Allow arbitrary os.PathLike[str] in gethookproxy.
2020-12-12 17:33:28 +02:00
Bruno Oliveira
572dfcd160
Compare also paths on Windows when considering ImportPathMismatchError
...
On Windows, os.path.samefile returns false for paths mounted in UNC paths which
point to the same location.
I couldn't reproduce the actual case reported, but looking at the code it seems
this commit should fix the issue.
Fix #7678
Fix #8076
2020-12-12 08:54:49 -03:00
Katarzyna
612f157dbd
Show reason for skipped test in verbose mode
2020-12-09 09:43:47 +02:00
Anton
810b878ef8
Migrate to pytester: test_capture.py, test_terminal.py, approx.py ( #8108 )
...
* Migrate to pytester: test_capture.py, test_config.py, approx.py
* migrate test_terminal.py
* revert test_config.py
* more typing in test_terminal.py
* try-out 'tr' fixture update
* revert 'tr' fixture, update test_config.py
2020-12-08 22:20:02 +02:00
Bruno Oliveira
059f6ff315
Merge pull request #8107 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-html-3.1.0
...
build(deps): bump pytest-html from 3.0.0 to 3.1.0 in /testing/plugins_integration
2020-12-07 08:52:56 -03:00
dependabot[bot]
19de6bccff
build(deps): bump pytest-html in /testing/plugins_integration
...
Bumps [pytest-html](https://github.com/pytest-dev/pytest-html ) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-html/releases )
- [Changelog](https://github.com/pytest-dev/pytest-html/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-html/compare/v3.0.0...v3.1.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 03:08:29 +00:00
dependabot[bot]
8c120c042c
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.3...3.1.4 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 03:08:29 +00:00
Ran Benita
e398c93884
Merge pull request #8055 from bluetech/unraisable
...
Add unraisableexception and threadexception plugins
2020-12-05 21:52:17 +02:00
Ran Benita
760a73c08c
Merge pull request #8017 from bluetech/typing-public-fixtures
...
Export types of builtin fixtures for type annotations
2020-12-05 21:51:20 +02:00
Christine Mecklenborg
eeb3afb8ab
Migrate test_pastebin.py from testdir to pytester
2020-12-01 12:55:59 -06:00
Ran Benita
64bb5f2ad1
Merge pull request #8091 from cmecklenborg/pytester_refactor_test_parseopt
...
Migrate test_parseopt.py from testdir to pytester
2020-12-01 14:10:09 +02:00
Ran Benita
0d0dfdd7aa
Merge pull request #8090 from cmecklenborg/pytester_refactor_test_nose
...
Migrate test_nose.py from testdir to pytester
2020-12-01 14:07:55 +02:00
dependabot[bot]
7a06bc2416
build(deps): bump pytest-flakes in /testing/plugins_integration ( #8087 )
...
Bumps [pytest-flakes](https://github.com/asmeurer/pytest-flakes ) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/asmeurer/pytest-flakes/releases )
- [Commits](https://github.com/asmeurer/pytest-flakes/commits )
Signed-off-by: dependabot[bot] <support@github.com>
2020-12-01 14:06:38 +02:00
Christine Mecklenborg
4abd71121d
Migrate test_parseopt.py from testdir to pytester
2020-11-30 16:27:39 -06:00
Christine Mecklenborg
d4c81ffab4
Migrate test_nose.py from testdir to pytester
2020-11-30 16:07:26 -06:00
Dominic Mortlock
775ba63c67
Refactor acceptance_test to use pytester ( #8070 )
2020-11-25 14:42:47 +02:00
Ran Benita
d50df85e26
Add unraisableexception and threadexception plugins
2020-11-21 21:11:48 +02:00
Maximilian Cosmo Sitter
0cef530d10
Add str() support to LineMatcher ( #8050 )
2020-11-21 20:45:20 +02:00
Simon K
52fef811c2
permit node to warn with any warning type, not just PytestWarning ( #8052 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-11-21 10:49:17 -03:00
Ran Benita
3e0bbd2f57
testing: fix ResourceWarning in broken-pipe test
2020-11-20 17:55:23 +02:00
Petter Strandmark
eda681af2b
Call Python 3.8 doClassCleanups ( #8033 )
2020-11-19 12:07:15 +02:00
Ran Benita
30d89fd07e
Merge pull request #8039 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-html-3.0.0
...
build(deps): bump pytest-html from 2.1.1 to 3.0.0 in /testing/plugins_integration
2020-11-19 12:05:04 +02:00
Garvit Shubham
6fe9d2fb9f
testing: convert test_{conftest,recwarn,tmpdir} to pytester
2020-11-16 19:22:57 +02:00
dependabot[bot]
3a899ced76
build(deps): bump pytest-html in /testing/plugins_integration
...
Bumps [pytest-html](https://github.com/pytest-dev/pytest-html ) from 2.1.1 to 3.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-html/releases )
- [Changelog](https://github.com/pytest-dev/pytest-html/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-html/compare/v2.1.1...v3.0.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 03:15:18 +00:00
Ran Benita
825b81ba52
Merge pull request #8014 from bluetech/pyc-pep552
...
assertion/rewrite: write pyc's according to PEP-552 on Python>=3.7
2020-11-14 23:38:45 +02:00
Ran Benita
1d532da49e
assertion/rewrite: write pyc's according to PEP-552 on Python>=3.7
...
Python 3.7 changes the pyc format by adding a flags byte. Even though it
is not necessary for us to match it, it is nice to be able to read pyc
files we emit for debugging the rewriter.
Update our custom pyc files to use that format. We write flags==0
meaning we still use the mtime+size format rather the newer hash format.
2020-11-14 23:20:12 +02:00
Ran Benita
f1e6fdcddb
Export types of builtin fixture for type annotations
...
In order to allow users to type annotate fixtures they request, the
types need to be imported from the `pytest` namespace. They are/were
always available to import from the `_pytest` namespace, but that is
not guaranteed to be stable.
These types are only exported for the purpose of typing. Specifically,
the following are *not* public:
- Construction (`__init__`)
- Subclassing
- staticmethods and classmethods
We try to combat them being used anyway by:
- Marking the classes as `@final` when possible (already done).
- Not documenting private stuff in the API Reference.
- Using `_`-prefixed names or marking as `:meta private:` for private
stuff.
- Adding a keyword-only `_ispytest=False` to private constructors,
warning if False, and changing pytest itself to pass True. In the
future it will (hopefully) become a hard error.
Hopefully that will be enough.
2020-11-13 11:25:09 +02:00
Ran Benita
66311ff702
Merge pull request #8022 from bluetech/doctest-init
...
main: fix only one doctest collected on pytest --doctest-modules __init__.py
2020-11-13 10:46:46 +02:00
Ran Benita
ea3c0aa245
Merge pull request #8019 from JosiasAurel/mypytester-change-01
...
Migrate from testdir to pytester
2020-11-13 10:36:03 +02:00
Josias Aurel
fa148eadfe
Update testing/test_faulthandler.py
...
Co-authored-by: Sanket Duthade <duthades@gmail.com>
2020-11-11 18:35:06 +01:00
Josias Aurel
06a597db14
Add type annotations
2020-11-11 05:02:32 +01:00
Josias Aurel
1ed8159c7d
Update testing/test_faulthandler.py
...
Co-authored-by: Sanket Duthade <duthades@gmail.com>
2020-11-11 04:45:57 +01:00
Josias Aurel
8320c07134
Update testing/test_faulthandler.py
...
Co-authored-by: Sanket Duthade <duthades@gmail.com>
2020-11-11 04:45:42 +01:00
Ran Benita
265cc2cfec
main: fix only one doctest collected on pytest --doctest-modules __init__.py
...
When --doctest-modules is used, an `__init__.py` file is not a `Package`
but a `DoctestModule`, but some collection code assumed that
`__init__.py` implies a `Package`. That code caused only a single test
to be collected in the scenario in the subject.
Tighten up this check to explicitly check for `Package`. There are
better solutions, but for another time.
Report & test by Nick Gates <nickgatzgates@gmail.com>.
2020-11-10 22:50:46 +02:00
Josias Aurel
043ed55056
Migrate from testdir to pytester
2020-11-09 18:07:34 +01:00
Ran Benita
e986d84466
Merge pull request #8006 from bluetech/export-MonkeyPatch
...
Export MonkeyPatch as pytest.MonkeyPatch
2020-11-09 11:45:38 +02:00
Ran Benita
6f13d1b03b
Export MonkeyPatch as pytest.MonkeyPatch
...
We want to export `pytest.MonkeyPatch` for the purpose of
type-annotating the `monkeypatch` fixture. For other fixtures we export
in this way, we also make direct construction of them (e.g.
`MonkeyPatch()`) private. But unlike the others, `MonkeyPatch` is also
widely used directly already, mostly because the `monkeypatch` fixture
only works in `function` scope (issue #363 ), but also in other cases. So
making it private will be annoying and we don't offer a decent
replacement yet.
So, let's just make direct construction public & documented.
2020-11-09 11:28:15 +02:00
dependabot[bot]
02d4b3d75f
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.2...3.1.3 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-11-09 03:17:35 +00:00
Hugo Martins
5b2e5e8a40
Improve summary stats when using '--collect-only' ( #7875 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-11-08 11:45:10 -03:00
Ran Benita
4c0513bc18
fixtures: deprecate pytest.yield_fixture()
2020-11-07 17:06:40 +02:00
Sanket Duthade
3bcd316f07
test_collection.py migrate from testdir to Pytester ( #8003 )
2020-11-07 16:56:00 +02:00
Garvit Shubham
6a5037a25b
#7942 test_setupplan.py migrate from testdir to Pytester ( #8004 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-11-07 09:29:45 -03:00
Bruno Oliveira
30287b49cd
Deprecate --strict ( #7985 )
...
Fix #7530
2020-11-06 09:48:20 +01:00
duthades
b815f430e5
#7942 test_session.py migrate from testdir to pytester
...
- Add name to AUTHORS
2020-11-04 21:55:07 +05:30
Ran Benita
a95da7a425
Merge pull request #7980 from bluetech/code-changes
...
code: a few minor improvements
2020-11-01 09:51:39 +02:00
Ran Benita
7fb0ea3f68
Merge pull request #7956 from csernazs/fix-7951
...
Fix handling recursive symlinks
2020-10-31 18:59:50 +02:00
Cserna Zsolt
8a38e7a6e8
Fix handling recursive symlinks
...
When pytest was run on a directory containing a recursive symlink it failed
with ELOOP as the library was not able to determine the type of the
direntry:
src/_pytest/main.py:685: in collect
if not direntry.is_file():
E OSError: [Errno 40] Too many levels of symbolic links: '/home/florian/proj/pytest/tests/recursive'
This is fixed by handling ELOOP and other errors in the visit function in
pathlib.py, so the entries whose is_file() call raises an OSError with the
pre-defined list of error numbers will be exluded from the result.
The _ignore_errors function was copied from Lib/pathlib.py of cpython 3.9.
Fixes #7951
2020-10-31 17:40:56 +01:00
Ran Benita
1c18fb8ccc
Merge pull request #7553 from tirkarthi/namedtuple-diff
...
Add support to display field names in namedtuple diffs.
2020-10-31 15:02:31 +02:00
Karthikeyan Singaravelan
9a0f4e57ee
Add support to display field names in namedtuple diffs.
2020-10-31 14:41:53 +02:00
Ran Benita
6cdae8ed40
pathlib: fix symlinked directories not followed during collection
2020-10-31 14:22:15 +02:00
Ran Benita
531416cc5a
code: simplify Code construction
2020-10-31 12:40:25 +02:00
Ran Benita
6506f016ac
testing/test_source: use unqualified imports
2020-10-31 12:40:25 +02:00
Ran Benita
a1df458e85
code: use properties for derived attributes, use slots
...
Make the objects more light weight.
Remove unused properties.
2020-10-31 12:40:25 +02:00
Ariel Pillemer
a7e38c5c61
pytest-dev#7942 test_runner_xunit.py ( #7964 )
2020-10-31 12:38:11 +02:00
crricks
3c7eb5a398
migrated test_nodes.py from testdir to pytester #7492 . ( #7969 )
2020-10-30 22:34:05 +02:00
Ran Benita
ad94456ca0
Merge pull request #7976 from symonk/7942-refactor-stepwise-to-use-pytester
...
#7942 refactor stepwise tests to utilize pytester
2020-10-30 22:15:12 +02:00
Christine Mecklenborg
aa843746a4
Migrate test_error_diffs.py from testdir to pytester ( #7971 )
2020-10-30 22:12:40 +02:00
symonk
c58abf7ad1
#7942 refactor stepwise tests to utilize pytester
2020-10-30 19:21:42 +00:00
Simon K
6cddeb8cb3
#7938 - [Plugin: Stepwise][Enhancements] Refactoring, smarter registration & --sw-skip functionality ( #7939 )
...
* adding --sw-skip shorthand for stepwise skip
* be explicit rather than implicit with default args for stepwise
* add constant for sw cache dir; only register plugin if necessary rather check check activity always;
* use str format; remove unused args in hooks
* assert cache upfront, allow stepwise to have a reference to the cache
* type hinting lf, skip, move literal strings into module constants
* convert parametrized option into a list
* add a sessionfinish hook for stepwise to keep backwards behaviour the same
* add changelog for #7938
* Improve performance of stepwise modifyitems & address PR feedback
* add test for stepwise deselected based on performance enhancements
* Apply suggestions from code review
* delete from items, account for edge case where failed_index = 0
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-10-30 19:13:06 +00:00
Christine Mecklenborg
47ff911c8f
Migrate test_assertion.py from testdir to pytester
2020-10-29 20:39:44 -05:00
Christine Mecklenborg
65148e3120
Migrate test_compat.py from testdir to pytester ( #7963 )
2020-10-29 09:56:34 +02:00
Christine Mecklenborg
460b51dd95
Migrate test_setuponly.py from testdir to pytester ( #7959 )
2020-10-29 09:55:30 +02:00
Christine Mecklenborg
efe470bf1c
Migrate test_assertrewrite.py from testdir to pytester ( #7952 )
2020-10-29 09:54:34 +02:00
Christine M
8d369f73ba
Migrate test_skipping.py from testdir to pytester ( #7953 )
2020-10-28 17:05:54 +02:00
Ran Benita
78c09b9931
Merge pull request #7944 from symonk/refactor-test-mark-to-use-pytester
...
Refactor test_warning_types.py & test_mark.py to use pytester
2020-10-27 21:06:42 +02:00
symonk
434e30424e
Address feedback for converting testdir to pytester
2020-10-27 17:50:54 +00:00
Mikhail Fesenko
cd9b3618c7
#7942 test_helpconfig.py migrate from testdir to pytester
2020-10-26 18:30:48 +03:00
Ran Benita
c31f4dc112
testing: make conftest stuff check for pytester not testdir
...
testdir uses pytester so this applies to it as well, but now includes
pytester as well.
2020-10-26 15:01:38 +02:00
dependabot[bot]
f7c5067823
build(deps): bump pytest-django in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.0.0...v4.1.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 03:15:50 +00:00
symonk
cde50db6e7
add type hint to parametrized warning_class
2020-10-25 18:31:43 +00:00
symonk
c818ac2248
Tidy up type hints for pytest in test_marks & test_warning_types
2020-10-25 18:03:59 +00:00
symonk
6b7203aba7
add conversion for test_warning_types.py also
2020-10-25 17:38:12 +00:00
symonk
7495d2c345
add missing pytester type hints
2020-10-25 17:33:40 +00:00
symonk
1bd83e75a4
refactor test mark to use new pytester
2020-10-25 17:27:19 +00:00
Ran Benita
897f151e94
testing: use pytester.spawn instead of testdir
...
Part of investigating a bug, but didn't fix it.
2020-10-25 10:11:10 +02:00
Ran Benita
25dee8fef6
testing: fix test_assertrewrite with PYTHONPYCACHEPREFIX
...
Make the tests work when running with PYTHONPYCACHEPREFIX (possible when
running in a dirty environment, not under tox).
2020-10-25 10:11:10 +02:00
Ran Benita
d9ac2efbcd
testing: python 3.10 fix
2020-10-25 01:27:44 +02:00
Ran Benita
d6becfa177
fixtures: change _getautousenames to an iterator
...
This reads better.
2020-10-25 00:49:06 +03:00
Ran Benita
aa0e2d654f
fixtures: use a faster replacement for ischildnode
...
ischildnode can be quite hot in some cases involving many fixtures.
However it is always used in a way that the nodeid is constant and the
baseid is iterated. So we can save work by pre-computing the parents of
the nodeid and use a simple containment test.
The `_getautousenames` function has the same stuff open-coded, so change
it to use the new function as well.
2020-10-25 00:48:35 +03:00
Ran Benita
0cdbf8b377
Merge pull request #7910 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-trio-0.7.0
...
build(deps): bump pytest-trio from 0.6.0 to 0.7.0 in /testing/plugins_integration
2020-10-23 16:52:54 +03:00
Ran Benita
e1848349a7
Merge pull request #7909 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.0.0
...
build(deps): bump pytest-django from 3.10.0 to 4.0.0 in /testing/plugins_integration
2020-10-23 16:52:29 +03:00
Ran Benita
afaabdda8c
cacheprovider: fix some files in packages getting lost from --lf
...
--lf has an optimization where it skips collecting Modules (python
files) which don't contain failing tests. The optimization works by
getting the paths of all cached failed tests and skipping the collection
of Modules whose path is not included in that list.
In pytest, Package nodes are Module nodes with the fspath being the file
`<package dir>/__init__.py`. Since it's a Module the logic above
triggered for it, and because it's an `__init__.py` file which is
unlikely to have any failing tests in it, it is skipped, which causes
its entire directory to be skipped, including any Modules inside it with
failing tests.
Fix by special-casing Packages to never filter. This means entire
Packages are never filtered, the Modules themselves are always checked.
It is reasonable to consider an optimization which does filter entire
packages bases on parent paths etc. but this wouldn't actually save any
real work so is really not worth it.
2020-10-19 19:02:43 +03:00
Hugo van Kemenade
c9e5042d6d
Remove redundant Python 2.7 code
2020-10-19 10:47:35 +03:00
Hugo van Kemenade
a642650e17
Drop support for EOL Python 3.5
2020-10-19 10:02:36 +03:00
dependabot[bot]
f335144d1d
build(deps): bump pytest-trio in /testing/plugins_integration
...
Bumps [pytest-trio](https://github.com/python-trio/pytest-trio ) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/python-trio/pytest-trio/releases )
- [Commits](https://github.com/python-trio/pytest-trio/compare/v0.6.0...v0.7.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 03:05:42 +00:00
dependabot[bot]
23aac10391
build(deps): bump pytest-django in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 3.10.0 to 4.0.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v3.10.0...v4.0.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 03:05:42 +00:00
Ran Benita
1b23a111d2
Update mypy 0.782 -> 0.790
2020-10-17 19:25:45 +03:00
Bruno Oliveira
69419cb700
New pytester fixture ( #7854 )
2020-10-12 12:13:06 -03:00
dependabot[bot]
b53a8bb60f
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.1...3.1.2 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 12:39:31 +00:00
dependabot[bot]
37cf4693cf
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 2.0.0 to 2.0.2.
- [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.0...2.0.2 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-10-10 15:52:11 +00:00
Hugo van Kemenade
3059caf1ee
Put smoke test deps in requirements.txt for Dependabot ( #7806 )
2020-10-10 18:51:35 +03:00
Kyle Altendorf
76acb44330
Update tests to cover explicit None and "string" as addini() types
2020-10-07 17:56:54 -04:00
Manuel Mariñez
13ddec9a00
Add alias clarification to deprecation warning ( #7829 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-10-06 11:48:34 -03:00
Anthony Sottile
33d119f71a
py36+: com2ann
2020-10-05 18:33:17 -07:00
Anthony Sottile
f81c6c00a9
Merge pull request #7852 from asottile/py36_pyupgrade
...
py36+: pyupgrade: py36+
2020-10-04 08:25:32 -07:00
Ran Benita
bf09e7792f
fixtures: some type annotations
2020-10-04 09:43:58 +03:00
Anthony Sottile
66bd44c13a
py36+: pyupgrade: py36+
2020-10-03 12:46:54 -07:00
Anthony Sottile
fb1d550aac
py36+: remove rexport of Path and PurePath
2020-10-03 12:16:52 -07:00
Anthony Sottile
6ed07a1c25
Merge pull request #7840 from asottile/py36_typing_Type
...
py36+: from typing import Type: no longer need guard
2020-10-03 07:44:06 -07:00
Anthony Sottile
aa077ab188
Merge pull request #7841 from asottile/py36_todo
...
py36+: resolve py36 TODOs
2020-10-03 07:43:15 -07:00
Ran Benita
a6a7ba57e0
Merge pull request #7817 from bluetech/fix-testpaths-bestrelpath2
...
terminal: fix crash in header reporting when absolute testpaths is used
2020-10-03 12:59:18 +03:00
Anthony Sottile
53b5f64b4b
py36+: resolve py36 TODOs
2020-10-02 19:57:55 -07:00
Anthony Sottile
bfadd4060e
py36+: from typing import Type: no longer need guard
2020-10-02 19:50:10 -07:00
Anthony Sottile
a23666d554
Merge pull request #7838 from asottile/py36_requires_ordered_markup
...
py36+: remove requires_ordered_markup
2020-10-02 19:48:01 -07:00
Anthony Sottile
ac189885f6
Merge pull request #7835 from asottile/py36_misc
...
py36+: miscellaneous (3, 6) cleanup
2020-10-02 19:47:35 -07:00
Anthony Sottile
6ba13ed528
Merge pull request #7834 from asottile/py36_TYPE_CHECKING
...
py36+: remove TYPE_CHECKING from _pytest.compat
2020-10-02 19:47:27 -07:00
Anthony Sottile
daba7ceb71
py36+: remove requires_ordered_markup
2020-10-02 15:06:59 -07:00
Anthony Sottile
284fd45a08
py36+: miscellaneous (3, 6) cleanup
2020-10-02 15:04:16 -07:00
Anthony Sottile
a238d1f37d
py36+: remove TYPE_CHECKING from _pytest.compat
...
automated with:
```bash
git grep -l 'from .* import TYPE_CHECKING' |
xargs reorder-python-imports \
--application-directories .:src \
--remove-import 'from _pytest.compat import TYPE_CHECKING' \
--add-import 'from typing import TYPE_CHECKING'
```
2020-10-02 15:03:24 -07:00
Anthony Sottile
1f57fb079d
py36+: remove _pytest.compat.MODULE_NOT_FOUND_ERROR
2020-10-02 15:02:45 -07:00
Ran Benita
b250c9d615
Merge pull request #7813 from bluetech/findpaths-confusion
...
findpaths: fix regression causing incorrect rootdir to be determined
2020-09-30 13:21:18 +03:00
Ran Benita
61f80a783a
terminal: fix crash in header reporting when absolute testpaths is used
...
Regressed in 6.1.0 in 62e249a1f9
.
The `x` is an `str` but is expected to be a `pathlib.Path`. Not caught
by mypy because `config.getini()` returns `Any`.
Fix by just removing the `bestrelpath` call:
- testpaths are always relative to the rootdir, it thus would be very
unusual to specify an absolute path there.
- The code was wrong even before the regression: `py.path.local`'s
`bestrelpath` function expects a `py.path.local`, not an `str`. But it
had some weird `try ... except AttributeError` fallback which just
returns the argument, i.e. it was a no-op. So there is no behavior
change.
- It seems reasonable to me to just print the full path if that's what
the ini specifies.
2020-09-29 15:23:47 +03:00
Ran Benita
cd67c2a8cf
Merge pull request #7802 from bluetech/bump-attrs
...
Bump attrs requirement from >=17.4.0 to >=19.2.0
2020-09-28 19:30:58 +03:00
Ran Benita
4a9192f727
findpaths: fix regression causing incorrect rootdir to be determined
...
When switching from py.path.local to pathlib (70f3ad1c1f
),
`local.parts(reverse=True)` was translated incorrectly, leading to the
wrong rootdir being determined in some non-trivial cases where parent
directories have config files as well.
2020-09-28 19:13:01 +03:00
Jakob van Santen
91fa11bed0
python_api: let approx() take nonnumeric values ( #7710 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-09-28 12:17:23 -03:00
Ran Benita
32bb8f3a63
Bump attrs requirement from >=17.4.0 to >=19.2.0
...
This allows us to remove the `ATTRS_EQ_FIELD` thing which is causing
some annoyance.
2020-09-27 13:17:59 +03:00
Sorin Sbarnea
b031a7cecf
Smoke tests for assorted plugins ( #7721 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kyle Altendorf <sda@fstab.net>
2020-09-19 15:56:52 -03:00
Florian Bruhin
89305e7b09
Improve output for missing config keys ( #7572 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-09-19 12:57:29 -03:00
Bruno Oliveira
9bfd14a443
Merge pull request #7749 from bluetech/fix-get_source-crash
2020-09-19 10:38:32 -03:00
Sorin Sbarnea
da21fc5883
Improve output for missing required plugins/unknown config keys ( #7723 )
...
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2020-09-16 12:13:17 +02:00
Ran Benita
d18cb961cf
assertion/rewrite: fix internal error on collection error due to decorated function
...
For decorated functions, the lineno of the FunctionDef AST node points
to the `def` line, not to the first decorator line. On the other hand,
in code objects, the `co_firstlineno` points to the first decorator
line.
Assertion rewriting inserts some imports to code it rewrites. The
imports are inserted at the lineno of the first statement in the AST. In
turn, the code object compiled from the rewritten AST uses the lineno of
the first statement (which is the first inserted import).
This means that given a module like this,
```py
@foo
@bar
def baz(): pass
```
the lineno of the code object without assertion rewriting
(`--assertion=plain`) is 1, but with assertion rewriting it is 3.
And *this* causes some issues for the exception repr when e.g. the
decorator line is invalid and raises during collection. The code becomes
confused and crashes with
INTERNALERROR> File "_pytest/_code/code.py", line 638, in get_source
INTERNALERROR> lines.append(space_prefix + source.lines[line_index].strip())
INTERNALERROR> IndexError: list index out of range
Fix it by special casing decorators. Maybe there are other cases like
this but off hand I can't think of another Python construct where the
lineno of the item would be after its first line, and this is the only
such issue we have had reported.
2020-09-12 23:05:08 +03:00
Bruno Oliveira
634cde9506
Merge pull request #7745 from asottile/exec_globals_type_problem
...
Fix INTERNALERROR when accessing locals / globals with faulty `exec`
2020-09-12 08:09:48 -03:00
Anthony Sottile
96a17b1683
Fix INTERNALERROR when accessing locals / globals with faulty `exec`
2020-09-11 18:13:48 -07:00
Bruno Oliveira
c00fe960ba
Allow ovewriting a parametrized fixture while reusing the parent fixture's value
...
Fix #1953
2020-09-11 16:53:34 -03:00
Ran Benita
885d969484
Merge pull request #7685 from bluetech/py-to-pathlib-2
...
config: start migrating Config.{rootdir,inifile} from py.path.local to pathlib
2020-09-04 18:42:52 +03:00
Bruno Oliveira
0d0b798663
Merge pull request #7708 from nicoddemus/repr-line-7707
...
Fix handle of exceptions in ReprEntry with tb=line
2020-09-04 12:06:11 -03:00
Ran Benita
62e249a1f9
Replace some usages of config.{rootdir,inifile} with config.{rootpath,inipath}
2020-09-04 18:05:42 +03:00
Bruno Oliveira
19e99ab413
Integrate warnings filtering directly into Config ( #7700 )
...
Warnings are a central part of Python, so much that Python itself has
command-line and environtment variables to handle warnings.
By moving the concept of warning handling into Config, it becomes natural to
filter warnings issued as early as possible, even before the "_pytest.warnings"
plugin is given a chance to spring into action. This also avoids the weird
coupling between config and the warnings plugin that was required before.
Fix #6681
Fix #2891
Fix #7620
Fix #7626
Close #7649
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-09-04 11:57:15 -03:00
Bruno Oliveira
9f672c85c5
Fix handle of exceptions in ReprEntry with tb=line
...
Fix #7707
2020-09-03 07:44:45 -03:00
Ran Benita
daca174c98
python: small optimization in PyCollector.collect()
...
Inline `_makeitem()` so that `self.ihook` (which is moderately
expensive) can be called only once.
Note: the removed test "test_makeitem_non_underscore" comes from an old
behavior of skipping names that start with `_` which has since been
generalized, making the test no longer relevant.
2020-08-27 10:18:37 +03:00
Ran Benita
98891a5947
python: skip pytest_pycollect_makeitem work on certain names
...
When a Python object (module/class/instance) is collected, for each name
in `obj.__dict__` (and up its MRO) the pytest_pycollect_makeitem hook is
called for potentially creating a node for it.
These Python objects have a bunch of builtin attributes that are
extremely unlikely to be collected. But due to their pervasiveness,
dispatching the hook for them ends up being mildly expensive and also
pollutes PYTEST_DEBUG=1 output and such.
Let's just ignore these attributes.
On the pandas test suite commit 04e9e0afd476b1b8bed930e47bf60e,
collect only, irrelevant lines snipped, about 5% improvement:
Before:
```
51195095 function calls (48844352 primitive calls) in 39.089 seconds
ncalls tottime percall cumtime percall filename:lineno(function)
226602/54 0.145 0.000 38.940 0.721 manager.py:90(_hookexec)
72227 0.285 0.000 20.146 0.000 python.py:424(_makeitem)
72227 0.171 0.000 16.678 0.000 python.py:218(pytest_pycollect_makeitem)
```
After:
```
48410921 function calls (46240870 primitive calls) in 36.950 seconds
ncalls tottime percall cumtime percall filename:lineno(function)
181429/54 0.113 0.000 36.777 0.681 manager.py:90(_hookexec)
27054 0.130 0.000 17.755 0.001 python.py:465(_makeitem)
27054 0.121 0.000 16.219 0.001 python.py:218(pytest_pycollect_makeitem)
```
2020-08-26 17:43:57 +03:00
Ran Benita
a267a622eb
python: fix empty parametrize() leading to "NotSetType.token" id
...
In ff8b7884e8
NOTSET was changed to a
singleton enum, which ended up unexpectedly triggering a code path in ID
generation which checks for `isinstance(Enum)`.
Add an explicit case for it, which is not too bad anyway.
2020-08-25 22:01:43 +03:00
Ran Benita
bb38ae9c52
Merge pull request #7651 from bluetech/capture-safe-disable
...
capture: fix disabled()/global_and_fixture_disabled() enabling capturing when it was disabled
2020-08-24 12:11:09 +03:00
Ran Benita
b47b488e3d
testing: fix flaky test when executed slowly
...
The 0-1 was a bit too optimistic: CI got "no tests ran in 3.98s".
2020-08-23 12:32:30 +03:00
Ran Benita
143e3ab846
Merge pull request #7673 from bluetech/logging-fix-handler-restore
...
logging: fix handler level restored incorrectly if caplog.set_level is called more than once
2020-08-23 12:06:09 +03:00
Ran Benita
837687c21a
Merge pull request #7668 from bluetech/dir-match-msg
...
main: improve message on `pytest path/to/a/directory::mytest`
2020-08-23 12:05:22 +03:00
Ran Benita
b1354608cc
logging: fix handler level restored incorrectly if caplog.set_level is called more than once
2020-08-22 17:46:23 +03:00
Maximilian Cosmo Sitter
75af2bfa06
Reintroduce warnings postponed in 6.0 ( #7637 )
2020-08-22 11:17:50 -03:00
Ran Benita
5e39cd5e71
main: improve message on `pytest path/to/a/directory::mytest`
...
The path part of a `<path>::part1::part2` style collection argument must
be a file, not a directory.
Previously this crashed with an uncool assert "invalid arg".
2020-08-22 11:52:54 +03:00