Compare commits

...

2214 Commits
6.0.2 ... 7.3.2

Author SHA1 Message Date
pytest bot
9d47a39bdd Prepare release version 7.3.2 2023-06-10 18:52:19 +00:00
Ran Benita
d66697ed9a Merge pull request #11094 from pytest-dev/backport-10894-to-7.3.x
[7.3.x] Python 3.12 support
2023-06-10 21:44:29 +03:00
Ran Benita
8e1bbe1a94 [7.3.x] Python 3.12 support 2023-06-10 17:52:18 +00:00
Ran Benita
d054a68931 Merge pull request #11058 from pytest-dev/backport-11055-to-7.3.x
[7.3.x] cacheprovider: fix file-skipping feature for files in packages
2023-05-30 20:32:43 +03:00
Ran Benita
30a112583e [7.3.x] cacheprovider: fix file-skipping feature for files in packages 2023-05-30 17:07:15 +00:00
Bruno Oliveira
682fc81781 Merge pull request #11057 from pytest-dev/backport-11041-to-7.3.x
[7.3.x] 11028 - Fix warlus operator behavior when called by a function
2023-05-30 13:23:11 -03:00
Alessio Izzo
331bc1be46 [7.3.x] 11028 - Fix warlus operator behavior when called by a function 2023-05-30 15:01:07 +00:00
github-actions[bot]
69689c6eb5 [7.3.x] nonpython example now repr all exceptions (#11034)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2023-05-24 11:33:28 +00:00
github-actions[bot]
6c95cb607d [7.3.x] Spelling and grammar fixes (#11015)
Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
2023-05-18 13:32:59 +00:00
github-actions[bot]
efcb81c492 [7.3.x] Reference "Status of Python Versions" in backwards-compatibility policy (#11010)
Co-authored-by: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
2023-05-17 11:04:47 +00:00
Ran Benita
fecf977e56 Merge pull request #11002 from pytest-dev/backport-11000-to-7.3.x
[7.3.x] monkeypatch: add support for TypedDict
2023-05-14 22:39:12 +03:00
Adam J. Stewart
bcada5138a [7.3.x] monkeypatch: add support for TypedDict 2023-05-14 19:18:29 +00:00
Bruno Oliveira
8082d27d11 Merge pull request #10988 from nicoddemus/initial-testpaths-10987 (#10995)
Consider testpaths for initial conftests

(cherry picked from commit 76d15231f5)
2023-05-12 10:42:27 -03:00
Ran Benita
25ebf53f72 Merge pull request #10983 from pytest-dev/backport-10979-to-7.3.x
[7.3.x] faulthandler: avoid accessing sys.stderr.encoding
2023-05-10 14:40:32 +03:00
Ran Benita
920512435a [7.3.x] faulthandler: avoid accessing sys.stderr.encoding 2023-05-10 11:20:03 +00:00
Ran Benita
2c1913e709 Merge pull request #10980 from pytest-dev/backport-10978-to-7.3.x
[7.3.x] fix reference to non-existent module
2023-05-10 10:45:32 +03:00
Ran Benita
94d6922261 [7.3.x] fix reference to non-existent module 2023-05-10 07:18:38 +00:00
Ran Benita
384d54e11f Merge pull request #10955 from pytest-dev/backport-10954-to-7.3.x
[7.3.x] Fix couple of EncodingWarnings
2023-04-29 12:01:57 +03:00
Ran Benita
2ae187e78d [7.3.x] Fix couple of EncodingWarnings 2023-04-29 08:39:14 +00:00
github-actions[bot]
c403dc538b [7.3.x] doc: Fix 2024 training location (#10948)
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2023-04-26 07:00:06 +00:00
github-actions[bot]
f72c4cf35b [7.3.x] Filter new pkg_resources deprecations (#10944)
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2023-04-25 11:40:52 +02:00
github-actions[bot]
6193bf73ca [7.3.x] Fix documentation typo (#10943)
Co-authored-by: Bryan Ricker <978899+bricker@users.noreply.github.com>
2023-04-25 10:55:24 +02:00
github-actions[bot]
9a413e4cb8 [7.3.x] Add 2024 pytest training (#10934)
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2023-04-22 21:30:51 +02:00
Bruno Oliveira
a1f7a204df Merge pull request #10913 from pytest-dev/release-7.3.1
Prepare release 7.3.1
2023-04-14 15:12:22 -03:00
pytest bot
dab199281c Prepare release version 7.3.1 2023-04-14 17:14:35 +00:00
github-actions[bot]
c3d9dacd39 [7.3.x] Fix tmp_path regression introduced in 7.3.0 (#10912)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2023-04-14 16:49:43 +00:00
Ran Benita
06d759619d Merge pull request #10906 from pytest-dev/backport-10904-to-7.3.x
[7.3.x] Revert "Correctly handle tracebackhide for chained exceptions (#10772)"
2023-04-13 16:23:46 +03:00
Ran Benita
a4121aa0b6 [7.3.x] Revert "Correctly handle tracebackhide for chained exceptions (#10772)" 2023-04-13 11:58:34 +00:00
Ran Benita
6e26c2bf9b Merge pull request #10898 from pytest-dev/backport-10893-to-7.3.x
[7.3.x] Python 3.12 alpha fixes
2023-04-12 00:30:08 +03:00
Ran Benita
23cf1feb97 [7.3.x] Python 3.12 alpha fixes 2023-04-11 20:56:28 +00:00
github-actions[bot]
1a427d32d6 [7.3.x] Amend changelog note for removal of attrs (#10889)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2023-04-10 13:12:55 -03:00
Ran Benita
cec5bfe058 Merge pull request #10881 from pytest-dev/release-7.3.0
Prepare release 7.3.0
2023-04-09 00:49:26 +03:00
pytest bot
ef982aaf2b Prepare release version 7.3.0 2023-04-08 21:19:52 +00:00
Kodi Arfer
3683722bcb FormattedExcinfo.get_source: avoid crash when line number is out-of-bounds/negative
pytest could crash given pathological AST position attributes, which shouldn't happen when testing real Python code, but could happen when testing AST produced by e.g. Hylang.

Another example of the failure is in the nightly CI for the JAX project: https://github.com/google/jax/actions/runs/4607513902/jobs/8142126075

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Jake VanderPlas <jakevdp@google.com>
2023-04-05 22:48:24 -03:00
github-actions[bot]
31d0b51039 [automated] Update plugin list (#10857)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-04-04 13:17:43 -03:00
Pierre Sassoulas
2d2f69dab5 Merge pull request #10862 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-04-04 09:04:47 +02:00
pre-commit-ci[bot]
2a39ed3461 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.1.0 → 23.3.0](https://github.com/psf/black/compare/23.1.0...23.3.0)
2023-04-04 06:34:42 +00:00
github-actions[bot]
a3b39069bc [automated] Update plugin list (#10838)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-03-26 08:32:13 -03:00
github-actions[bot]
172c832cbd [automated] Update plugin list (#10823)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-03-24 11:41:07 -03:00
dependabot[bot]
839b90db45 build(deps): Bump peter-evans/create-pull-request from 4.2.3 to 4.2.4 (#10828)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](2b011faafd...38e0b6e68b)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  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>
2023-03-24 11:40:34 -03:00
dependabot[bot]
549cc512f7 build(deps): Bump pytest-asyncio in /testing/plugins_integration (#10827)
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.20.2 to 0.21.0.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.20.2...v0.21.0)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-24 11:40:06 -03:00
Ronny Pfannschmidt
2369bed1db Merge pull request #10727 from RonnyPfannschmidt/ronny/split-report-header
split up report header lines for config, rootdir and testpaths
2023-03-18 22:06:46 +01:00
Ronny Pfannschmidt
54864f0c9b bugfix: fix imports for simple example 2023-03-17 21:58:26 +01:00
Ronny Pfannschmidt
ba969d2ae7 run regendoc 2023-03-17 21:58:26 +01:00
Ronny Pfannschmidt
407b330fe1 split up report header lines
i found it painful to read crammed in a single line
thus rootdir, config file and testpaths now have own lines
2023-03-17 21:58:26 +01:00
Felix Hofstätter
431ec6d34e Correctly handle tracebackhide for chained exceptions (#10772) 2023-03-15 08:10:25 -03:00
pre-commit-ci[bot]
eada68b2b3 [pre-commit.ci] pre-commit autoupdate (#10814)
updates:
- [github.com/PyCQA/autoflake: v2.0.1 → v2.0.2](https://github.com/PyCQA/autoflake/compare/v2.0.1...v2.0.2)
- [github.com/pre-commit/mirrors-mypy: v1.0.1 → v1.1.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.1...v1.1.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-14 08:17:13 -03:00
dependabot[bot]
ab069247cd build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10812)
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.1.1 to 11.1.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/11.1.1...11.1.2)

---
updated-dependencies:
- dependency-name: pytest-rerunfailures
  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>
2023-03-13 08:00:07 -03:00
github-actions[bot]
7af1e4e4ed [automated] Update plugin list (#10810)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-03-12 13:04:50 -03:00
Stefanie Molin
0ae04ae629 Include pyproject.toml in help section that lists out config files with ini-options (#10807) 2023-03-11 10:59:02 -03:00
Florian Bruhin
723035be7f doc: Remove done training (#10805) 2023-03-10 20:47:03 +00:00
Alessio Izzo
6e478b0947 Fix walrus operator support in assertion rewriting (#10758)
Closes #10743
2023-03-10 07:32:36 -03:00
Paul Kehrer
a869141b3d New option to allow a progress report even when capture=no (#10755) 2023-03-07 17:49:37 -03:00
Bruno Oliveira
5e98aefc92 Merge pull request #10794 from pytest-dev/update-plugin-list/patch-d5dda84ef
[automated] Update plugin list
2023-03-06 08:16:06 -03:00
Bruno Oliveira
5f47e423b2 Merge pull request #10795 from bluthej/fix-10782
Fix example in the documentation (#10782)
2023-03-05 13:49:35 -03:00
bluthej
5a61ec3d4a Fix example in the documentation (#10782) 2023-03-05 17:01:21 +01:00
Zac Hatfield-Dodds
b3b44ea814 Merge pull request #10766 from rdb/fix-10765 2023-03-04 23:34:35 -08:00
pytest bot
1d48b3021d [automated] Update plugin list 2023-03-05 00:25:29 +00:00
Bruno Oliveira
d5dda84ef3 Merge pull request #10793 from nicoddemus/cherry-pick-release
Merge pull request #10792 from pytest-dev/release-7.2.2
2023-03-03 16:22:47 -03:00
Bruno Oliveira
517e02e59e Merge pull request #10792 from pytest-dev/release-7.2.2
Prepare release 7.2.2

(cherry picked from commit 3ce6030f0c)
2023-03-03 16:14:11 -03:00
Bruno Oliveira
4e259590c9 Normalize how changelog entries are written (#10779)
Went over all changelog entries making sure they follow our guidelines as written at:

88c9e92258/.github/PULL_REQUEST_TEMPLATE.md (L18-L21)
2023-03-03 12:53:38 -03:00
Bruno Oliveira
97a2761d72 Fix test_cmdline_python_namespace_package (#10788)
pgk_resources.declare_namespace has been deprecated, so added an ignore warnings option
to the test.
2023-03-03 12:25:33 -03:00
Billy
88c9e92258 Minor updates to fixtures docs (#10724)
Updated the c fixture to be a little more consistent with other fixtures in the corresponding image. for example both e and g both have edges connected with the fixtures that they explicitly depend on.
2023-02-28 12:42:33 -03:00
Ronny Pfannschmidt
72ad32411f Docs: be more explicit about module level skip preventing collection (#10753) 2023-02-28 12:41:31 -03:00
Bruno Oliveira
cb9e8be301 Move logic to get_user_id in compat 2023-02-28 11:19:34 -03:00
Bruno Oliveira
d72da480c4 Apply suggestions from code review 2023-02-28 11:02:17 -03:00
Bruno Oliveira
07e7deb4a7 Update changelog/10765.bugfix.rst 2023-02-28 10:59:23 -03:00
Bruno Oliveira
572b5657d7 Merge pull request #10767 from alexhad6/fix-typo-in-python_api.py
Fix typo in python_api.py
2023-02-27 08:59:13 -03:00
dependabot[bot]
44afed9b13 build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10754)
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.1 to 11.1.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/11.1...11.1.1)

---
updated-dependencies:
- dependency-name: pytest-rerunfailures
  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>
2023-02-27 08:56:25 -03:00
github-actions[bot]
13ea4780b8 [automated] Update plugin list (#10752)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-02-27 08:55:33 -03:00
Alex Hadley
135600fca3 Fix typo in python_api.py 2023-02-24 15:04:42 -08:00
rdb
c237297b3d Fix OSError in tmpdir on emscripten due to missing getuid()
Fixes #10765
2023-02-24 23:23:44 +01:00
Ronny Pfannschmidt
9ccae9a8e3 Merge pull request #10756 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-02-22 15:10:09 +01:00
pre-commit-ci[bot]
77152d26e7 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v1.0.0 → v1.0.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.0.0...v1.0.1)
2023-02-21 03:03:45 +00:00
Manuel Jacob
da626e7186 Update import mode documentation to not refer to __import__() anymore. (#10747)
Nowadays, the prepend and append import modes use importlib.import_module() instead of __import__().

There was a phrase “which avoids having to use `__import__`”, in which I couldn’t just replace `__import__` by `importlib.import_module` because the latter is used (in insert_missing_modules()) also when using importlib mode. Therefore I removed the part from the sentence.
2023-02-18 18:55:46 -03:00
bitzge
051f8f1f0f Add CI and BUILD_NUMBER env var in docs (#10749) 2023-02-18 18:52:14 -03:00
Bruno Oliveira
31ad577325 Merge pull request #10741 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.1.7
build(deps): Bump django from 4.1.6 to 4.1.7 in /testing/plugins_integration
2023-02-16 06:50:38 -03:00
dependabot[bot]
835cac8d8b build(deps): Bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.1.6...4.1.7)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 20:40:12 +00:00
Florian Bruhin
464f29901f Update open training (#10739) 2023-02-15 14:06:24 +00:00
Garvit Shubham
aa72496d24 Fix entry-points declaration in the documentation example using Hatch
Closes #10721
2023-02-14 10:57:32 -03:00
pre-commit-ci[bot]
e9f3a01392 [pre-commit.ci] pre-commit autoupdate (#10733)
updates:
- [github.com/pre-commit/mirrors-mypy: v0.991 → v1.0.0](https://github.com/pre-commit/mirrors-mypy/compare/v0.991...v1.0.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-14 07:30:12 -03:00
dependabot[bot]
00c94ab01b build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10731)
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 11.0 to 11.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/11.0...11.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-13 08:05:47 -03:00
github-actions[bot]
9048621002 [automated] Update plugin list (#10726)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-02-12 21:39:45 -03:00
Bruno Oliveira
27165cf8db Use build-and-inspect-python-package action (#10722)
This uses https://github.com/hynek/build-and-inspect-python-package to ensure our package is correct, both during testing and deploy,
2023-02-12 21:37:40 -03:00
Ilya Konstantinov
7a829cb57d Document the location tuple (#10700) 2023-02-12 11:20:53 -03:00
HTRafal
5e1c3d2477 Propagate timestamps from CallInfo to TestReport objects (#10711)
This makes it possible to correlate pytest stages with external events, and also makes it readable when TestReports are exported externall (for example with pytest-reportlog).

Closes #10710
2023-02-10 17:52:54 -03:00
pre-commit-ci[bot]
59e7d2bbc9 [pre-commit.ci] pre-commit autoupdate (#10712)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)
- [github.com/PyCQA/autoflake: v2.0.0 → v2.0.1](https://github.com/PyCQA/autoflake/compare/v2.0.0...v2.0.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update .pre-commit-config.yaml

* [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: Bruno Oliveira <nicoddemus@gmail.com>
2023-02-07 19:30:33 -03:00
Mahesh Vashishtha
af99040123 Add a note about -W vs filterwarnings. (#10713)
Closes #10687

Signed-off-by: mvashishtha <mahesh@ponder.io>
2023-02-07 19:27:34 -03:00
dependabot[bot]
a2b7db7655 build(deps): Bump django in /testing/plugins_integration (#10706)
Bumps [django](https://github.com/django/django) from 4.1.5 to 4.1.6.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.1.5...4.1.6)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-07 08:00:16 -03:00
github-actions[bot]
9c93c96b14 [automated] Update plugin list (#10707)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-02-07 07:59:57 -03:00
github-actions[bot]
4a46ee8bc9 [automated] Update plugin list (#10699)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-01-30 10:15:02 -03:00
Teejay
5dbfb8e108 Fix fixtures named teardown being considered by nose (#10696)
Closes #10597
2023-01-27 14:33:46 -03:00
vin01
86a1beba07 Clarify docs for match regarding escaping (#10695)
Add example using `re.escape` to escape arbitrary literal strings which might contain regular expression characters like `.` or `)`.

Closes #10595
2023-01-27 08:11:00 -03:00
Jay
ca40380e99 Add check for zero denominator in approx (#10624)
Closes #10533
2023-01-24 07:07:42 -03:00
Bruno Oliveira
05eee78aaa Merge pull request #10599 from pytest-dev/fix-update-plugin-list-workflow
Fix update-plugin-list workflow due to new 'packaging'
2023-01-23 17:55:45 -03:00
Ran Benita
02893139f9 Merge pull request #10680 from bluetech/capture-typing
capture: improve typing
2023-01-23 14:38:28 +02:00
Ran Benita
8c53dbf9d7 capture: fix pyright type error
This is OK in mypy, but doesn't hurt to fix.
2023-01-23 14:12:01 +02:00
Ran Benita
54b8b40f83 capture: improve NoCapture typing 2023-01-23 14:12:01 +02:00
Ran Benita
54911acf8d capture: improve captureclass typing
Previously, the any `captureclass` arguments were Any. We need to
introduce another common base class to fix this.
2023-01-23 14:12:01 +02:00
Ran Benita
c746d2b016 capture: improve SysCapture/FDCapture typing
Instead of `SysCapture`/`FDCapture` inheriting from
`SysCaptureBinary`/`FDCaptureBinary`, have both inherit from a common
`SysCaptureBase`/`FDCaptureBase`. This fixes a Liskov substitution
violation.
2023-01-23 14:12:01 +02:00
Ran Benita
a3693ce503 capture: improve DontReadFromInput typing
Have `DontReadFromInput` inherit from `TextIO`, ensuring it's fully
compatible with `sys.stdin` (which has type `TextIO`).
2023-01-23 14:12:01 +02:00
Yannick PÉROUX
af4143729f Allow spaces in -p arguments (#10658) 2023-01-21 08:22:44 -03:00
q0w
bd7919e03d Initialize args and args_source during Config.__init__
Closes #10626

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2023-01-21 08:19:54 -03:00
Ran Benita
7d4b40337b capture: fix some Anys 2023-01-21 10:39:58 +02:00
Ran Benita
6a714d7b70 capture: CaptureResult can be a namedtuple again (#10678)
mypy now supports generic NamedTuple.
2023-01-21 09:39:58 +02:00
Ran Benita
5a23eeff7a Merge pull request #10668 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-rerunfailures-11.0
build(deps): Bump pytest-rerunfailures from 10.3 to 11.0 in /testing/plugins_integration
2023-01-20 11:23:54 +02:00
Ran Benita
310b67b227 Drop attrs dependency, use dataclasses instead (#10669)
Since pytest now requires Python>=3.7, we can use the stdlib attrs
clone, dataclasses, instead of the OG package.

attrs is still somewhat nicer than dataclasses and has some extra
functionality, but for pytest usage there's not really a justification
IMO to impose the extra dependency on users when a standard alternative
exists.
2023-01-20 11:13:36 +02:00
Ramsey
4d4ed42c34 Fix crash if --cache-show and --help are passed at the same time
Closes #10592
2023-01-19 09:44:57 -03:00
Ronny Pfannschmidt
096b942ec4 Merge pull request #10660 from ikonst/2023-01-13-raises-typing
Derive pytest.raises from AbstractContextManager
2023-01-18 06:42:46 +01:00
pre-commit-ci[bot]
61cfaacec6 [pre-commit.ci] pre-commit autoupdate (#10671)
updates:
- [github.com/asottile/blacken-docs: v1.12.1 → 1.13.0](https://github.com/asottile/blacken-docs/compare/v1.12.1...1.13.0)
- [github.com/pre-commit/pygrep-hooks: v1.9.0 → v1.10.0](https://github.com/pre-commit/pygrep-hooks/compare/v1.9.0...v1.10.0)
2023-01-17 12:09:19 +02:00
dependabot[bot]
95c62eb527 build(deps): Bump pytest-rerunfailures in /testing/plugins_integration
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 10.3 to 11.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/10.3...11.0)

---
updated-dependencies:
- dependency-name: pytest-rerunfailures
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 03:00:46 +00:00
Bruno Oliveira
03b19945fb Merge pull request #10662 from nicoddemus/cherry-pick-release
Merge pull request #10659 from pytest-dev/release-7.2.1
2023-01-14 09:35:02 -03:00
Bruno Oliveira
b2ac31cc9f Merge pull request #10659 from pytest-dev/release-7.2.1
Prepare release 7.2.1

(cherry picked from commit 94c05bc2a4)
2023-01-14 09:21:43 -03:00
Ilya Konstantinov
1a96f16401 Derive pytest.raises from AbstractContextManager
Makes `AbstractContextManager` the shared base class between "raises" and other context managers.

The motivation is for type checkers to narrow `pytest.raises(...) if x else nullcontext()` to a `ContextManager` rather than `object`.
2023-01-13 13:58:49 -05:00
dependabot[bot]
7421f3bb94 build(deps): Bump django in /testing/plugins_integration (#10643)
Bumps [django](https://github.com/django/django) from 4.1.3 to 4.1.5.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.1.3...4.1.5)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-13 07:16:43 -03:00
Bruno Oliveira
5e0583f4b9 Fix regen tox environment (#10640)
Since tox 4.0, the whitelist_external option has been renamed to allowlist_externals.

Co-authored-by: pytest bot <pytestbot@gmail.com>
2023-01-13 07:15:41 -03:00
s-padmanaban
8efb4bb9c1 Do not update cache from xdist worker (#10641) 2023-01-13 07:14:52 -03:00
Kadino
3ad4344656 Mitigate directory creation race condition (#10607)
Fixes https://github.com/pytest-dev/pytest/issues/10604 which could intermittently display unexpected behavior between checking if the path exists and requesting creation. This was fairly prevalent when pytest was being invoked in parallel by another test runner (CTest) and trying to create the same parent-folder for multiple XMLs. A modest amount of testing did not reproduce other filesystem race conditions.

This notably does not work around an edge case where the parent path of the XML could be created as a file instead of a folder or link. That vanishingly rare case should cause file creation to fail on the next line, with a fairly obvious exception message.
2023-01-06 09:12:24 -03:00
Bruno Oliveira
6bf7f55555 Merge pull request #10632 from danigm/fix-tests
Fix tests pygments 2.14.0
2023-01-05 12:59:24 -03:00
Daniel Garcia Moreno
61f70a5a75 Fix tests pygments 2.14.0
Fix https://github.com/pytest-dev/pytest/issues/10630
2023-01-04 10:30:28 +01:00
Bruno Oliveira
326ae0cd88 Merge pull request #10609 from yusuke-kadowaki/default_policy_all
Change the default `tmp_path_retention_policy` to `all`
2022-12-25 14:09:45 -03:00
Yusuke Kadowaki
10220d3f31 Change the default policy to all 2022-12-25 00:18:38 +09:00
Bruno Oliveira
a98b00cd09 Use a more descriptive job name for update-plugin-list workflow 2022-12-21 14:01:37 -03:00
Bruno Oliveira
215ea7fd03 Fix update-plugin-list workflow due to new 'packaging'
The latest 'packaging' release has dropped support for `LegacyVersion`, meaning
that version strings which do not conform to the standard now raise an error.
2022-12-21 14:01:37 -03:00
Pierre Sassoulas
b31db4809b Avoid truncation when truncating means longer output (#10446)
Fixes #6267
2022-12-17 10:24:46 -03:00
Bruno Oliveira
f6adebb990 Fix tox 4.0 support and docs
Also includes pre-commit autoupdate
2022-12-14 08:57:07 -03:00
Bruno Oliveira
b90e7b84d0 Remove reference to explicit pytest tox support
This reference no longer exists in tox 4.0 docs.
2022-12-14 08:38:11 -03:00
Bruno Oliveira
19807ab79a Pin packaging while building docs
Packaging >=22 no longer supports 'latest' versions, which is the version that is assigned when building the docs.

https://github.com/pytest-dev/pytest/pull/10578#issuecomment-1348249045

Also first install pytest, then `docs/en/requirements.txt`:

Installing the requirements last will honor pins of libraries
shared between pytest and the docs build.
2022-12-14 08:38:11 -03:00
Bruno Oliveira
3e52124185 Fix passenv setting for tox.ini
In tox 4.0 `passenv` is required to be one per-line, or comma-separated.
2022-12-14 08:35:39 -03:00
pre-commit-ci[bot]
1eca228bd5 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.10.0 → 22.12.0](https://github.com/psf/black/compare/22.10.0...22.12.0)
- [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.3.1)
2022-12-13 01:28:21 +00:00
Bruno Oliveira
cab02e67d7 Merge pull request #10559 from pytest-dev/update-plugin-list/patch-9fbd67dd4
[automated] Update plugin list
2022-12-06 11:17:45 -03:00
Bruno Oliveira
64dbc7a0a1 Merge pull request #10560 from pytest-dev/dependabot/github_actions/peter-evans/create-pull-request-4.2.3
build(deps): Bump peter-evans/create-pull-request from 3.7.0 to 4.2.3
2022-12-06 11:16:54 -03:00
Bruno Oliveira
60d992677d Merge pull request #10563 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-12-06 11:06:16 -03:00
pre-commit-ci[bot]
0079decf29 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.2 → v3.3.0](https://github.com/asottile/pyupgrade/compare/v3.2.2...v3.3.0)
2022-12-06 00:36:28 +00:00
dependabot[bot]
3a58fc2d44 build(deps): Bump peter-evans/create-pull-request from 3.7.0 to 4.2.3
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 3.7.0 to 4.2.3.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](2455e15969...2b011faafd)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-05 03:15:13 +00:00
pytest bot
39b6bb551c [automated] Update plugin list 2022-12-04 00:20:05 +00:00
Marko Pacak
9fbd67dd4b Class methods can now be discovered as tests (#10552)
Fix #10525
2022-12-02 15:53:04 +00:00
Zac Hatfield-Dodds
eca93db05b Merge pull request #10550 from danschef/use_os_sep
Use os.sep instead of os.path.sep.
2022-12-02 00:32:12 -08:00
Daniel Scheffler
fb701b538c Use os.sep instead of os.path.sep.
Signed-off-by: Daniel Scheffler <danschef@gfz-potsdam.de>
2022-12-01 18:16:02 +01:00
Bruno Oliveira
314e623304 Merge pull request #10549 from yusuke-kadowaki/more_doc_update
Documentation update for the tmp_path configurations
2022-12-01 12:23:43 -03:00
Yusuke Kadowaki
62e75c7d55 Documentation update for tmp_path configurations 2022-12-01 22:29:46 +09:00
github-actions[bot]
fd30759d94 [automated] Update plugin list (#10536)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-11-29 09:14:38 +00:00
dependabot[bot]
eb984a717a build(deps): Bump pytest-rerunfailures in /testing/plugins_integration (#10537)
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures) from 10.2 to 10.3.
- [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.2...10.3)

---
updated-dependencies:
- dependency-name: pytest-rerunfailures
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-29 09:55:24 +01:00
Anthony Sottile
54f0fb3c63 Merge pull request #10543 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-11-28 20:27:39 -08:00
pre-commit-ci[bot]
49a4ed14cf [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.3.0 → v4.4.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.3.0...v4.4.0)
- [github.com/PyCQA/autoflake: v1.7.7 → v2.0.0](https://github.com/PyCQA/autoflake/compare/v1.7.7...v2.0.0)
- [github.com/PyCQA/flake8: 5.0.4 → 6.0.0](https://github.com/PyCQA/flake8/compare/5.0.4...6.0.0)
2022-11-29 02:01:34 +00:00
Yusuke Kadowaki
f513d33d5a Modify documentation to use .stash when storing test results. (#10535) 2022-11-27 22:09:56 +02:00
Prerak Patel
857e34ef85 Fix bug where file system root was erroneously be used as rootdir on Windows
Fix #10506
2022-11-23 14:46:00 -03:00
Yusuke Kadowaki
99dfc19fe6 Fix tmp_path_retention_policy crash when skipping from fixture (#10517)
Also uses the stash to save the test status.

Fix #10502
2022-11-23 10:48:29 -03:00
pre-commit-ci[bot]
56544c11b5 [pre-commit.ci] pre-commit autoupdate (#10522)
updates:
- [github.com/pre-commit/mirrors-mypy: v0.990 → v0.991](https://github.com/pre-commit/mirrors-mypy/compare/v0.990...v0.991)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-22 08:27:55 -03:00
github-actions[bot]
7710e18b4c [automated] Update plugin list (#10519)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-11-22 08:05:40 -03:00
Daniel Valenzuela
791b51d0fa Show test name when skipping from fixture (#10482)
Fixes #10457
2022-11-18 09:20:38 -03:00
Anthony Sottile
bc4e70e048 Merge pull request #10504 from pytest-dev/all-repos_autofix_no-implicit-optional
remove no_implicit_optional
2022-11-17 00:30:51 -05:00
Anthony Sottile
b817aa457c remove no_implicit_optional
this is the default in mypy 0.990

Committed via https://github.com/asottile/all-repos
2022-11-16 19:20:16 -05:00
Anthony Sottile
66b28912ac Merge pull request #10497 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-11-16 13:18:59 -05:00
Yusuke Kadowaki
cca029d55e Add configuration options to control how tmp_path directories are kept (#10442)
Close #8141
2022-11-15 09:11:39 -03:00
Bruno Oliveira
d5466b3917 Fix typing errors after mypy update 2022-11-15 08:53:23 -03:00
pre-commit-ci[bot]
4fce29f15d [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v3.2.0 → v3.2.2](https://github.com/asottile/pyupgrade/compare/v3.2.0...v3.2.2)
- [github.com/pre-commit/mirrors-mypy: v0.982 → v0.990](https://github.com/pre-commit/mirrors-mypy/compare/v0.982...v0.990)
2022-11-15 00:17:06 +00:00
Bruno Oliveira
69e3973d86 Merge pull request #10468 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.1.3
build(deps): Bump django from 4.1.2 to 4.1.3 in /testing/plugins_integration
2022-11-14 09:25:28 -03:00
dependabot[bot]
c842893b02 build(deps): Bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.1.2...4.1.3)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-14 11:36:55 +00:00
dependabot[bot]
506b10d295 build(deps): Bump pytest-asyncio in /testing/plugins_integration (#10494)
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.20.1 to 0.20.2.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.20.1...v0.20.2)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-11-14 11:36:00 +00:00
Bruno Oliveira
05061493cb Merge pull request #10495 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-bdd-6.1.1
build(deps): Bump pytest-bdd from 6.0.1 to 6.1.1 in /testing/plugins_integration
2022-11-14 08:09:07 -03:00
dependabot[bot]
f97f3dc3a3 build(deps): Bump pytest-bdd in /testing/plugins_integration
Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd) from 6.0.1 to 6.1.1.
- [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/6.0.1...6.1.1)

---
updated-dependencies:
- dependency-name: pytest-bdd
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-14 03:00:43 +00:00
Bruno Oliveira
3c31b0132f Merge pull request #10493 from pytest-dev/update-plugin-list/patch-54d5a63d1
[automated] Update plugin list
2022-11-13 12:02:36 -03:00
pytest bot
593178d909 [automated] Update plugin list 2022-11-13 00:22:21 +00:00
Bruno Oliveira
54d5a63d14 Merge pull request #10488 from DanielVZ96/fix-test-raising-repr
Fix test_raising_repr test
2022-11-09 20:20:05 -03:00
Daniel Valenzuela
b55e264a67 Fix test_raising_repr test
Closes #10473

Python <3.11 versions depend on `exceptiongroup>=1.0.0rc8`, and they released version `1.0.1`
6 days ago (2022/11/03) that as a side-effect changed the output of exceptions.
2022-11-09 19:43:10 -03:00
Bruno Oliveira
13d6114c0a Merge pull request #10484 from joukewitteveen/patch-2
scripts/update-plugin-list: Improve requirement detection
2022-11-09 10:07:12 -03:00
Jouke Witteveen
b635e16d30 scripts/update-plugin-list: Improve requirement detection
PEP 566 does not require a space after the dependency name.
2022-11-08 19:05:10 +01:00
Bruno Oliveira
a092b3ab36 Merge pull request #10481 from pytest-dev/update-plugin-list/patch-aa7e9de91
[automated] Update plugin list
2022-11-08 09:07:00 -03:00
pytest bot
a006dabf6e [automated] Update plugin list 2022-11-08 11:13:43 +00:00
Bruno Oliveira
aa7e9de91d Merge pull request #10480 from joukewitteveen/patch-1
scripts/update-plugin-list: Be liberal in accepted summaries
2022-11-08 08:11:35 -03:00
Jouke Witteveen
6aec32163d scripts/update-plugin-list: Be liberal in accepted summaries
Misconfigured packages may have a null summary in the PyPI json response.
2022-11-07 21:00:31 +01:00
Florian Bruhin
2f33ea87c8 Remove done trainings (#10471) 2022-11-04 18:38:09 +01:00
Ashish Kurmi
1ada62e237 Update dependabot for GitHub Actions (#10464)
Signed-off-by: Ashish Kurmi <akurmi@stepsecurity.io>

Signed-off-by: Ashish Kurmi <akurmi@stepsecurity.io>
2022-11-04 07:41:34 -03:00
pre-commit-ci[bot]
50b232b0cb [pre-commit.ci] pre-commit autoupdate (#10454)
updates:
- [github.com/asottile/reorder_python_imports: v3.8.5 → v3.9.0](https://github.com/asottile/reorder_python_imports/compare/v3.8.5...v3.9.0)
- [github.com/asottile/pyupgrade: v3.1.0 → v3.2.0](https://github.com/asottile/pyupgrade/compare/v3.1.0...v3.2.0)
- [github.com/asottile/setup-cfg-fmt: v2.1.0 → v2.2.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.1.0...v2.2.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 21:37:05 -03:00
dependabot[bot]
496196b15c build(deps): Bump pytest-html in /testing/plugins_integration (#10450)
Bumps [pytest-html](https://github.com/pytest-dev/pytest-html) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-html/releases)
- [Changelog](https://github.com/pytest-dev/pytest-html/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pytest-dev/pytest-html/compare/v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: pytest-html
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-31 12:51:34 -03:00
Hugo van Kemenade
0314b50c52 Fix 'importlib.abc.TraversableResources' deprecation warning in Python 3.12 (#10452) 2022-10-31 12:49:51 -03:00
wim glenn
8e2de91bf8 Merge pull request #10449 from cj81499/patch-1
fix type in python_api.py
2022-10-30 22:26:56 -05:00
Cal Jacobson
692ab1160b add Cal Jacobson to AUTHORS 2022-10-30 22:02:18 -05:00
Cal Jacobson
549839bac5 fix type in python_api.py
excpected -> expected
2022-10-30 21:59:09 -05:00
Florian Bruhin
646a46e5f4 Edit changelog for 7.2.0 (#10423)
Fix some typos, and consolidate two entries for the same feature into one.
2022-10-25 19:47:16 +02:00
Santiago Castro
f07017f91b Add the PyPI classifier for Python 3.11 (#10426) 2022-10-25 13:43:59 -03:00
Anthony Sottile
a17d3b0c44 Merge pull request #10425 from pytest-dev/asottile-patch-1
upgrade pygments-pytest for 7.2.x coloring
2022-10-25 11:27:36 -04:00
Anthony Sottile
bbec1ce67f upgrade pygments-pytest for 7.2.x coloring 2022-10-25 10:52:53 -04:00
Ronny Pfannschmidt
5a040aef97 Merge pull request #10412 from pytest-dev/release-7.2.0 (#10419)
Prepare release 7.2.0

(cherry picked from commit ac4e3cced9)
2022-10-25 13:12:55 +02:00
Bruno Oliveira
c1d2168df6 Merge pull request #10417 from nicoddemus/publish-action-pin
Use specific tag in the gh-action-pypi-publish action
2022-10-25 08:11:33 -03:00
pre-commit-ci[bot]
bbe7cbae4a [pre-commit.ci] pre-commit autoupdate (#10418)
updates:
- [github.com/PyCQA/autoflake: v1.7.6 → v1.7.7](https://github.com/PyCQA/autoflake/compare/v1.7.6...v1.7.7)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-24 20:25:15 -03:00
Bruno Oliveira
deae8f47f6 Use specific tag in the gh-action-pypi-publish action
Otherwise we see this warning:

Warning:  You are using "pypa/gh-action-pypi-publish@master". The "master" branch of this project has been sunset and will not receive any updates, not even security bug fixes. Please, make sure to use a supported version. If you want to pin to v1 major version, use "pypa/gh-action-pypi-publish@release/v1". If you feel adventurous, you may opt to use use "pypa/gh-action-pypi-publish@unstable/v1" instead. A more general recommendation is to pin to exact tags or commit shas.
2022-10-24 19:23:40 -03:00
Zac Hatfield-Dodds
10f55f79af Merge pull request #10226 from Zac-HD/use-exceptiongroup-for-teardown
Use exceptiongroup for multiple errors during teardown
2022-10-24 08:44:02 -07:00
Bruno Oliveira
a6d244343f Merge pull request #10416 from rettinghaus/update-actions
Update used GitHub Actions to latest versions
2022-10-24 10:32:58 -03:00
Klaus Rettinghaus
2b552c2240 update actions 2022-10-24 14:58:03 +02:00
Bruno Oliveira
54d7b9a08e Merge pull request #10415 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.20.1
build(deps): Bump pytest-asyncio from 0.19.0 to 0.20.1 in /testing/plugins_integration
2022-10-24 08:12:12 -03:00
Bruno Oliveira
6afc02abca Merge pull request #10414 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.6.2
build(deps): Bump anyio[curio,trio] from 3.6.1 to 3.6.2 in /testing/plugins_integration
2022-10-24 08:11:49 -03:00
dependabot[bot]
e75e2d66a0 build(deps): Bump pytest-asyncio in /testing/plugins_integration
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.19.0 to 0.20.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.19.0...v0.20.1)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 03:04:18 +00:00
dependabot[bot]
66db0b7522 build(deps): Bump anyio[curio,trio] in /testing/plugins_integration
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 3.6.1 to 3.6.2.
- [Release notes](https://github.com/agronholm/anyio/releases)
- [Changelog](https://github.com/agronholm/anyio/blob/3.6.2/docs/versionhistory.rst)
- [Commits](https://github.com/agronholm/anyio/compare/3.6.1...3.6.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>
2022-10-24 03:04:15 +00:00
Zac Hatfield-Dodds
3a68c08426 Use exceptiongroup for teardown errors 2022-10-23 15:45:50 -07:00
Itxaso Aizpurua
9e1804a6ee Add --log-disable CLI option (#10371)
Fixes #7431
2022-10-23 18:23:34 -03:00
Bruno Oliveira
bc2c3b66aa Merge pull request #10408 from NateMeyvis/patch-2
Fix typos in CONTRIBUTING.rst
2022-10-22 10:01:04 -03:00
Bruno Oliveira
d84ed48f39 Merge pull request #10409 from pytest-dev/asottile-patch-1
allow jobs to pass if codecov.io fails
2022-10-22 10:00:32 -03:00
Anthony Sottile
ffe49ac17c Merge pull request #10396 from pytest-dev/pylib-hax
vendor py.path and py.error
2022-10-21 13:37:32 -04:00
Anthony Sottile
d352098261 allow jobs to pass if codecov.io fails 2022-10-21 13:11:43 -04:00
Nate Meyvis
c5c562b645 Fix typos in CONTRIBUTING.rst
Fix small grammatical issues in CONTRIBUTING.rst to improve readability.
2022-10-21 13:06:44 -04:00
Anthony Sottile
d543a45a68 add deprecation changelog for py library vendoring 2022-10-21 12:46:15 -04:00
Bruno Oliveira
f341a5c559 Merge pull request #10407 from NateMeyvis/patch-1
Add note on tags to CONTRIBUTING.rst
2022-10-21 13:11:36 -03:00
pre-commit-ci[bot]
1027dc8c09 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-21 15:18:44 +00:00
Nate Meyvis
6b905ee6dc Add note on tags to CONTRIBUTING.rst
Tags from the main repository are required for testing to work properly, but the current documentation does not reflect this, and at least one new contributor has been tripped up by this. Update the documentation with a short explanation and directions.
2022-10-21 11:17:01 -04:00
Anthony Sottile
508be0b2bf add -pylib tox environment 2022-10-20 17:15:57 -04:00
Anthony Sottile
02a9371259 adjust tests if py library is installed 2022-10-19 22:28:51 -04:00
Anthony Sottile
dc0cb0d149 fix test pollution of sys.modules 2022-10-19 22:18:50 -04:00
Anthony Sottile
82344ba4f8 add py.path.local tests 2022-10-19 21:42:40 -04:00
Anthony Sottile
59d8f8a223 _pytest._py.path: get mypy passing 2022-10-19 21:42:40 -04:00
Anthony Sottile
ed4c18f686 _pytest._py.path: combine PathBase and LocalPath 2022-10-19 21:42:40 -04:00
Anthony Sottile
6660d45521 _pytest._py.path: combine PosixPath into LocalPath 2022-10-19 21:42:40 -04:00
Anthony Sottile
af078f3a96 _pytest._py.path: combine Checkers classes 2022-10-19 21:42:40 -04:00
Anthony Sottile
73349ef3e1 _pytest._py.path: flake8 fixes 2022-10-19 21:42:40 -04:00
Anthony Sottile
63c4d45c59 _pytest._py.path: importlib mode always available 2022-10-19 21:42:40 -04:00
Anthony Sottile
eebbfc65c9 _pytest._py.error: mypy typing 2022-10-19 21:42:40 -04:00
Anthony Sottile
382209d9e9 _pytest._py.path: remove decorator compat 2022-10-19 16:52:26 -04:00
Anthony Sottile
00e2f1c15c _pytest._py.path: remove _cmp compat 2022-10-19 16:52:26 -04:00
Anthony Sottile
8a151774b8 _pytest._py.path: remove fspath compat 2022-10-19 16:52:26 -04:00
Anthony Sottile
a7c1fc204b remove other py.* accesses in _pytest._py.path 2022-10-19 16:52:26 -04:00
Anthony Sottile
965e942dfb use getrawcode from _pytest._code 2022-10-19 16:52:26 -04:00
Anthony Sottile
349f4bffa0 use module __getattr__ for py.error to fix doctesting 2022-10-19 16:52:26 -04:00
pre-commit-ci[bot]
49abbf2485 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-19 16:52:26 -04:00
Anthony Sottile
19dda7c9bd vendor py.path and py.error 2022-10-19 16:52:26 -04:00
Bruno Oliveira
baada535a3 Merge pull request #10389 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-10-18 07:46:47 -03:00
pre-commit-ci[bot]
c477ecd146 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/autoflake: v1.7.3 → v1.7.6](https://github.com/PyCQA/autoflake/compare/v1.7.3...v1.7.6)
- [github.com/asottile/reorder_python_imports: v3.8.4 → v3.8.5](https://github.com/asottile/reorder_python_imports/compare/v3.8.4...v3.8.5)
- [github.com/asottile/setup-cfg-fmt: v2.0.0 → v2.1.0](https://github.com/asottile/setup-cfg-fmt/compare/v2.0.0...v2.1.0)
2022-10-17 23:48:17 +00:00
Bruno Oliveira
36d19f2135 Merge pull request #10388 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-twisted-1.14.0
build(deps): Bump pytest-twisted from 1.13.4 to 1.14.0 in /testing/plugins_integration
2022-10-17 11:04:12 -03:00
dependabot[bot]
8490ff5277 build(deps): Bump pytest-twisted in /testing/plugins_integration
Bumps [pytest-twisted](https://github.com/pytest-dev/pytest-twisted) from 1.13.4 to 1.14.0.
- [Release notes](https://github.com/pytest-dev/pytest-twisted/releases)
- [Commits](https://github.com/pytest-dev/pytest-twisted/compare/v1.13.4...v1.14.0)

---
updated-dependencies:
- dependency-name: pytest-twisted
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 03:02:02 +00:00
Zac Hatfield-Dodds
3dac833a52 Merge pull request #10383 from gabriellandau/dont-pdb-break-for-skiptest-exceptions 2022-10-15 11:14:26 -07:00
Zac Hatfield-Dodds
36b6384ff2 Merge pull request #10384 from tony/showlocals-negation 2022-10-15 10:43:59 -07:00
Ronny Pfannschmidt
31df38f6a7 Merge pull request #10356 from RonnyPfannschmidt/fix-7792-marks-walk-mro
fix #7792: consider marks from the mro
2022-10-15 17:19:27 +02:00
Tony Narlock
2a33e6ab61 docs: Update changelog for --no-show-locals 2022-10-14 17:20:36 -05:00
Tony Narlock
7fada7127e docs(output): Note --no-show-locals 2022-10-14 16:38:14 -05:00
Tony Narlock
3a8d401ac7 test(--no-showlocals): Should hide locals when addopts=--showlocals 2022-10-14 16:25:15 -05:00
Tony Narlock
2b6622fdd3 🔧 Negating --showlocals with --no-showlocals
This is necessary for addopts=--showlocals where individual test runs
need to not show locals.
2022-10-14 16:19:07 -05:00
Gabriel Landau
0bc9ffcc87 Add Gabriel Landau to AUTHORS 2022-10-14 14:01:20 -04:00
Gabriel Landau
f3d7e984ab Changelog 2022-10-14 13:58:59 -04:00
Gabriel Landau
452617686c Test fix 2022-10-14 13:53:06 -04:00
Gabriel Landau
6e7917c1a0 Don't break into pdb for raise unittest.SkipTest() 2022-10-13 18:20:46 -04:00
Bruno Oliveira
15ac0349b2 Merge pull request #10373 from ofek/patch-1
Fix packaging example
2022-10-12 22:19:41 -03:00
Ofek Lev
86602ce6e0 Fix packaging example 2022-10-12 11:51:26 -04:00
pre-commit-ci[bot]
c543e0c4e8 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-10-12 08:21:17 +00:00
Ronny Pfannschmidt
f13f4360d3 Apply suggestions from code review
Co-authored-by: Ran Benita <ran@unusedvar.com>
2022-10-12 10:20:16 +02:00
Bruno Oliveira
b7d4de1ea9 Merge pull request #10368 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-10-11 08:17:05 -03:00
Bruno Oliveira
a9c66172d4 Update to autoflake to 1.7.3
Fixes PyCQA/autoflake#168
2022-10-11 08:11:15 -03:00
pre-commit-ci[bot]
3de63f9a9b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0)
- [github.com/PyCQA/autoflake: v1.6.1 → v1.7.2](https://github.com/PyCQA/autoflake/compare/v1.6.1...v1.7.2)
- [github.com/asottile/reorder_python_imports: v3.8.3 → v3.8.4](https://github.com/asottile/reorder_python_imports/compare/v3.8.3...v3.8.4)
- [github.com/asottile/pyupgrade: v2.38.2 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.1.0)
- [github.com/pre-commit/mirrors-mypy: v0.981 → v0.982](https://github.com/pre-commit/mirrors-mypy/compare/v0.981...v0.982)
2022-10-11 00:32:50 +00:00
Bruno Oliveira
f5797abb62 Merge pull request #10361 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.10.0
build(deps): Bump pytest-mock from 3.9.0 to 3.10.0 in /testing/plugins_integration
2022-10-10 08:03:35 -03:00
Bruno Oliveira
b735f9377a Merge pull request #10360 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.1.2
build(deps): Bump django from 4.1.1 to 4.1.2 in /testing/plugins_integration
2022-10-10 08:03:24 -03:00
dependabot[bot]
d8c5e8805f build(deps): Bump pytest-mock in /testing/plugins_integration
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.9.0 to 3.10.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.9.0...v3.10.0)

---
updated-dependencies:
- dependency-name: pytest-mock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 03:03:48 +00:00
dependabot[bot]
07b380bb3a build(deps): Bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 4.1.1 to 4.1.2.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.1.1...4.1.2)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 03:03:45 +00:00
itxasos23
78c2c48c67 Handle NFC/NFD strings that normalize to the same string. (#10355)
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
2022-10-09 17:09:33 -07:00
Thomas Grainger
8a40fc5315 PytestReturnNotNoneWarning now subclasses PytestRemovedIn8Warning (#10196)
As discussed in https://github.com/pytest-dev/pytest/pull/9956#issuecomment-1132710934.

Also added PytestRemovedIn8Warning to the reference docs.
2022-10-09 20:10:45 -03:00
Vivaan Verma
196f01965e Replace entrypoint example with pyproject.toml in docs (#10359)
Fixes #10344
2022-10-09 17:42:42 -03:00
Simon K
3bf2bc55b1 Add deprecations for tests written for nose (#9907)
Fixes #9886
2022-10-09 17:16:33 -03:00
Bruno Oliveira
571dc6b220 Merge pull request #10358 from drakulavich/patch-1 2022-10-09 10:07:17 -03:00
Anton Yakutovich
d0abfb1c2a Bump actions in test.yml 2022-10-09 16:27:35 +04:00
Ran Benita
81113c1a90 Merge pull request #10354 from pytest-dev/revert-10346-ci-pat
Revert "ci: fix PR not triggering workflows by switching back to pytestbot access token"
2022-10-08 16:31:26 +03:00
Bruno Oliveira
784ba85b17 Merge pull request #10331 from sgaist/add_modernization_tip_for_tmpdir_and_tmpdir_factory 2022-10-08 09:54:21 -03:00
Samuel Gaist
a28d595b46 doc: add note to help modernize code bases to use pathlib
Fixes #10199
2022-10-08 10:18:08 +02:00
Ronny Pfannschmidt
c42bb36009 fixup: mark mro test reformatt 2022-10-08 08:35:53 +02:00
Ronny Pfannschmidt
13e594a314 fixup: mark mro test reformatt 2022-10-08 08:35:26 +02:00
Ronny Pfannschmidt
4e7486d3fb fixup: annotations 2022-10-08 08:28:03 +02:00
Ronny Pfannschmidt
d8c783268c fix #7792: consider marks from the mro
closes #9105 as superseeded
2022-10-08 08:18:26 +02:00
Bruno Oliveira
3c1534944c Merge pull request #10318 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-10-07 20:04:48 -03:00
Ran Benita
a501518a26 Revert "ci: fix PR not triggering workflows by switching back to pytestbot access token" 2022-10-08 00:58:51 +03:00
Ran Benita
680f3e2097 Merge pull request #10327 from AA-Turner/devnul
Use an explicit encoding when opening `os.devnul`
2022-10-08 00:52:11 +03:00
Ran Benita
ed5d4e1269 Merge pull request #10346 from bluetech/ci-pat
ci: fix PR not triggering workflows by switching back to pytestbot access token
2022-10-08 00:30:34 +03:00
Tony Narlock
8e7ce60c7d Export pytest.DoctestItem for typing / runtime purposes (#10313)
Fixes #10312
2022-10-07 13:03:42 -03:00
wodny
2bc036e50a Mention pythonpath confval in Good Integration Practices (#10314)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-07 13:03:13 -03:00
Bruno Oliveira
79c2e92bb8 Merge pull request #10349 from nicoddemus/doc-setup-teardown-nose 2022-10-07 11:48:09 -03:00
Bruno Oliveira
4da0689653 Ignore mypy error about missing generic arg for catch_warnings
mypy stubs recently changed warnings.catch_warnings to a Generic, in
order to have proper overloads depending on the parameters passed to it, whihc
triggers this mypy error now when we subclass it:

    src/_pytest/recwarn.py:170: error: Missing type parameters for generic type "catch_warnings"  [type-arg]

For our porpuses the parameter is not relevant (we always use record=True), so
decided to just ignore the type error.
2022-10-07 11:30:24 -03:00
Florian Bruhin
9be1e3fac8 doc: Add second day for enterPy training (#10348) 2022-10-07 16:13:05 +02:00
Bruno Oliveira
0c21d60349 Improve documentation for setup() and teardown() nose support
Fix #9549
2022-10-07 11:10:28 -03:00
Bruno Oliveira
4545fcff05 Merge pull request #10335 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.9.0 2022-10-07 11:00:10 -03:00
Ronny Pfannschmidt
24ef7c98e8 Merge pull request #10343 from RonnyPfannschmidt/fix-10342-warn-explicit-add-location
fix #10342: put location into warning exceptions
2022-10-07 13:04:32 +02:00
Bruno Oliveira
c4981f5a1b Merge pull request #10347 from The-Compiler/hookimpl-marker-docs 2022-10-07 07:51:16 -03:00
Ronny Pfannschmidt
7a15bad89b Update src/_pytest/warning_types.py
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2022-10-07 12:46:40 +02:00
Florian Bruhin
72cac9b1af Mark tryfirst/trylast as deprecated in their docs.
Follow-up to #9118
2022-10-07 12:16:53 +02:00
Ran Benita
2df0d9656c ci: fix PR not triggering workflows by switching back to pytestbot access token
The builtin actions token is not allowed to trigger further workflows.
So when we create a PR using that token, the PR checks don't run, and a
maintainer must close & open the PR to make them run. This is quite
annoying, so switch back to the "machine user" approach.

Fixes #9554.
2022-10-06 21:14:24 +03:00
Bruno Oliveira
4677580cae Merge pull request #10339 from Moisan/doc_broken_links 2022-10-06 13:05:11 -03:00
Ronny Pfannschmidt
14919c4bbb fix #10342: put location into warning exceptions
as the warning systems own warn_explicit looses the information
we add them explicitly to the warning exceptions
2022-10-06 11:44:05 +02:00
Thierry Moisan
06007de7ba Fix a few broken links in the documentation 2022-10-05 10:24:55 -04:00
pre-commit-ci[bot]
4ee6e900a0 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/autoflake: v1.6.0 → v1.6.1](https://github.com/PyCQA/autoflake/compare/v1.6.0...v1.6.1)
- [github.com/asottile/reorder_python_imports: v3.8.2 → v3.8.3](https://github.com/asottile/reorder_python_imports/compare/v3.8.2...v3.8.3)
- [github.com/asottile/pyupgrade: v2.38.0 → v2.38.2](https://github.com/asottile/pyupgrade/compare/v2.38.0...v2.38.2)
- [github.com/pre-commit/mirrors-mypy: v0.971 → v0.981](https://github.com/pre-commit/mirrors-mypy/compare/v0.971...v0.981)
2022-10-03 23:32:26 +00:00
dependabot[bot]
eab875509d build(deps): Bump pytest-mock in /testing/plugins_integration
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.8.2 to 3.9.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.8.2...v3.9.0)

---
updated-dependencies:
- dependency-name: pytest-mock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 03:01:46 +00:00
Ronny Pfannschmidt
2be1b8f355 Merge pull request #9118 from RonnyPfannschmidt/fix-4562-deprecate-hookmarkers
deprecate hook configuration via marks/attributes
2022-10-02 12:59:16 +02:00
Adam Turner
594413e8f0 Use an explicit encoding when opening os.devnul
Although slightly pointless, this avoids an `EncodingWarning` in Python 3.10
or greater when running under the `-X warn_default_encoding` flag.
2022-09-30 23:43:27 +01:00
Ronny Pfannschmidt
ce3e2e922b bump plugin test pytest cov pin 2022-09-28 22:28:03 +02:00
Bruno Oliveira
59b8ec3ce1 Merge pull request #10308 from pytest-dev/pre-commit-ci-update-config 2022-09-21 16:03:59 -03:00
Ronny Pfannschmidt
ae9dbf5006 add docstring to warn_explicit_for 2022-09-20 16:24:32 +02:00
Ronny Pfannschmidt
7e8a4849d8 unify option extraction for legacy hook marks 2022-09-20 16:24:32 +02:00
Ronny Pfannschmidt
e3294398d6 simplify typing for legacy hook mark support 2022-09-20 16:24:23 +02:00
Ronny Pfannschmidt
b1fb9a9c8d handle non-true options in hookspec warning 2022-09-20 16:22:26 +02:00
Ronny Pfannschmidt
8c52dc5b7e remove the setup.py for the py.test project which for deprecation has been deployed since 2014 2022-09-20 16:22:26 +02:00
Ronny Pfannschmidt
0fdacb6db5 deprecate hook configuration via marks/attributes
fixes #4562
2022-09-20 16:22:26 +02:00
pre-commit-ci[bot]
256ab097a2 [pre-commit.ci] pre-commit autoupdate
updates:
- https://github.com/myint/autoflakehttps://github.com/PyCQA/autoflake
- [github.com/PyCQA/autoflake: v1.5.3 → v1.6.0](https://github.com/PyCQA/autoflake/compare/v1.5.3...v1.6.0)
- [github.com/asottile/pyupgrade: v2.37.3 → v2.38.0](https://github.com/asottile/pyupgrade/compare/v2.37.3...v2.38.0)
2022-09-19 23:24:54 +00:00
Anthony Sottile
5bd41befa8 Merge pull request #10301 from Zoorken/main
doc: Fix 404 'identify flaky test' link (#10244)
2022-09-16 10:51:08 -04:00
Fredrik Berndtsson
246129089c doc: Fix 404 'identify flaky test' link (#10244) 2022-09-15 23:34:22 +02:00
Florian Bruhin
34765f6b2e doc: Add link for enterPy training (#10299) 2022-09-15 17:07:02 +02:00
Bruno Oliveira
33a083e844 Merge pull request #10291 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-22.8.0 2022-09-12 09:11:58 -03:00
Bruno Oliveira
77d2c9631a Merge pull request #10289 from pytest-dev/update-plugin-list/patch-85da6cad1
[automated] Update plugin list
2022-09-12 09:08:40 -03:00
dependabot[bot]
d416fbab91 build(deps): Bump twisted in /testing/plugins_integration
Bumps [twisted](https://github.com/twisted/twisted) from 22.4.0 to 22.8.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-22.4.0...twisted-22.8.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 03:01:53 +00:00
pytest bot
f53b49c8c4 [automated] Update plugin list 2022-09-11 00:22:18 +00:00
Bruno Oliveira
85da6cad11 Merge pull request #10285 from skhomuti/allure-pytest-to-plugins
Add allure-pytest to the popular plugins list
2022-09-09 09:00:32 -03:00
skhomuti
c326bd5669 Add allure-pytest to the popular plugins list 2022-09-08 22:12:44 +05:00
Bruno Oliveira
a734dab00d Merge pull request #10279 from The-Compiler/training-update-3 2022-09-07 10:15:02 -03:00
Florian Bruhin
1e0aa16908 Update open trainings 2022-09-07 14:48:49 +02:00
Bruno Oliveira
b34eb0860c Merge pull request #10275 from pytest-dev/pre-commit-ci-update-config 2022-09-06 08:33:51 -03:00
Bruno Oliveira
77e34526e8 Merge pull request #10225 from nicoddemus/sort-fixtures-docs 2022-09-06 08:33:27 -03:00
Bruno Oliveira
abf4941f3e Merge pull request #10272 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.1.1
build(deps): Bump django from 4.1 to 4.1.1 in /testing/plugins_integration
2022-09-06 08:33:04 -03:00
pre-commit-ci[bot]
b4ae5e4a35 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.6.0 → 22.8.0](https://github.com/psf/black/compare/22.6.0...22.8.0)
- [github.com/myint/autoflake: v1.5.1 → v1.5.3](https://github.com/myint/autoflake/compare/v1.5.1...v1.5.3)
2022-09-05 23:33:43 +00:00
dependabot[bot]
649b2e7f30 build(deps): Bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 4.1 to 4.1.1.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/commits)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-05 13:09:31 +00:00
Bruno Oliveira
6ad32a9c5c Merge pull request #10268 from pytest-dev/update-plugin-list/patch-4ed2b3a73
[automated] Update plugin list
2022-09-04 12:59:41 -03:00
pytest bot
50f390f015 [automated] Update plugin list 2022-09-04 00:23:26 +00:00
Bruno Oliveira
4ed2b3a733 Merge pull request #10267 from nicoddemus/cherry-pick-release
Merge pull request #10259 from pytest-dev/release-7.1.3
2022-09-02 08:34:50 -03:00
Bruno Oliveira
7f4b63b143 Merge pull request #10259 from pytest-dev/release-7.1.3
Prepare release 7.1.3

(cherry picked from commit 3739e6cd48)
2022-09-02 08:24:18 -03:00
Philipp A
245a8c23dd Revamp good practices (#10206)
* Recommend importlib import mode for new projects
* Recommend src layout more strongly
* Switch to hatchling as the packaging tool in the example (following PyPA)
* Add explanation about the different import modes
2022-09-01 07:55:41 -03:00
Bruno Oliveira
a9bbfb87d6 Merge pull request #10252 from nicoddemus/fix-regendoc
Fix regendoc
2022-08-31 14:32:36 -03:00
Bruno Oliveira
1caa099e42 Fix regendoc
The finalizers example was wiping out code needed for the examples below.
2022-08-31 14:28:33 -03:00
pre-commit-ci[bot]
4b77638ba8 [pre-commit.ci] pre-commit autoupdate (#10256)
updates:
- [github.com/myint/autoflake: v1.4 → v1.5.1](https://github.com/myint/autoflake/compare/v1.4...v1.5.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-30 07:11:58 -03:00
github-actions[bot]
0fc3a977a9 [automated] Update plugin list (#10253)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-08-29 17:49:38 -03:00
Gergely Kalmár
adaa463ee3 Ignore editable installation modules (#10231)
Fixes #10230
2022-08-26 09:46:47 -03:00
pre-commit-ci[bot]
42776c0949 [pre-commit.ci] pre-commit autoupdate (#10178)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/PyCQA/flake8: 4.0.1 → 5.0.4](https://github.com/PyCQA/flake8/compare/4.0.1...5.0.4)
- [github.com/asottile/pyupgrade: v2.37.2 → v2.37.3](https://github.com/asottile/pyupgrade/compare/v2.37.2...v2.37.3)
- [github.com/asottile/setup-cfg-fmt: v1.20.2 → v2.0.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.2...v2.0.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Configure setup-cfg-fmt to include version specifiers

* Update .pre-commit-config.yaml

* [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: Bruno Oliveira <nicoddemus@gmail.com>
2022-08-22 20:19:44 -03:00
Bruno Oliveira
059bc2443a Merge pull request #10234 from pytest-dev/update-plugin-list/patch-d9d890ee1
[automated] Update plugin list
2022-08-21 04:44:10 -03:00
pytest bot
932264d8fd [automated] Update plugin list 2022-08-21 00:21:46 +00:00
Bruno Oliveira
d9d890ee15 Merge pull request #10229 from webknjaz/patch-1
Drop `wheel` from `pyproject.toml` example
2022-08-19 14:30:51 -03:00
Sviatoslav Sydorenko
71aa1388e0 Drop wheel from pyproject.toml example
It is unnecessary and has been deleted from the setuptools' docs too.
The setuptools' PEP 517 build backend implementation has been
auto-adding the `wheel` dependency since it's first been implemented.
2022-08-19 19:01:40 +02:00
John Litborn
69f2855cc8 fallback to native traceback when handling ExceptionGroup (take 2) [SQUASH] (#10209)
* Squashed commit of the following:

commit 41d339c46763bbe26123e1e6504b6e32290e33e1
Author: Cheukting <cheukting.ho@gmail.com>
Date:   Thu Jun 23 17:01:04 2022 +0800

    test in all py versions

commit b3572a5a12672228c3276fc8c8e05980dfb7888a
Author: Cheukting <cheukting.ho@gmail.com>
Date:   Thu Jun 23 16:41:06 2022 +0800

    add test

commit 7166a2a51e4f99046b028b663c193d8b558c7fd4
Author: Cheukting <cheukting.ho@gmail.com>
Date:   Thu Jun 23 16:00:07 2022 +0800

    update changelog

commit b958c73d489157f0c0d4e46425083a5e2e2bc851
Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date:   Thu Jun 23 07:50:52 2022 +0000

    [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci

commit ea7f376c6ca37c40c83df0e4a1cfaaedb34bae91
Author: Cheukting <cheukting.ho@gmail.com>
Date:   Thu Jun 23 15:48:21 2022 +0800

    Fix MyPy

commit 97469beb1da40257e9a061a5e19548546c9312c4
Author: Cheukting <cheukting.ho@gmail.com>
Date:   Thu Jun 23 15:03:48 2022 +0800

    fix if ExceptionGroup not exist

commit 84e553642cd69b4d499231d733df91ebfa84c7ad
Author: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date:   Thu Jun 23 03:43:27 2022 +0000

    [pre-commit.ci] auto fixes from pre-commit.com hooks

    for more information, see https://pre-commit.ci

commit 76bbef449b88bbd74fb5cca3b5293337a624ef03
Author: Cheukting <cheukting.ho@gmail.com>
Date:   Thu Jun 23 11:40:41 2022 +0800

    adding changelog

commit db82bebc5a4969e2083adcd97bdfd2a63bb17d98
Author: Cheukting <cheukting.ho@gmail.com>
Date:   Thu Jun 23 11:33:10 2022 +0800

    fall back to native when handeling to exception groups

* Typed ExceptionGroupTypes and changed to BaseExceptionGroup, fixed exceptionchain (excinfo->excinfo_, set reprcrash. Extended tests, though they're wip.

* added exceptiongroup to pre-commit-config, moved away from tuple to directly defining BaseExceptionGroup, added block comment, added match line for inner exception, changked mark.skipif to importorskip to not need top-level import, changed tox.ini a bit - only uncovered should now be py37 without exceptiongroup, due to hypothesis

* added py311-exceptiongroup to github CI, exceptiongroup is now a hard dependency on py<3.11, renamed bad variable names

* added use_coverage to ubuntu-py311

* import BaseExceptionGroup with explicit version check instead of try/catch

* removed from CI, added comments to tox and pre-commit
2022-08-17 09:16:32 -07:00
Tatiana Ovary
3039391b83 Update documentation on how pytest.warns affects DeprecationWarning #9291 (#10141)
Co-authored-by: Dani Sancas <lord.sancas@gmail.com>

On-behalf-of: @clarityai-eng <tech@clarity.ai>

Signed-off-by: Tatiana Ovary <tatiana.ovary@clarity.ai>
2022-08-17 11:44:58 -03:00
Bruno Oliveira
832100955a Sort fixtures in reference.rst alphabetically
While taking a look at the docs I noticed they were not properly sorted.

This just moves the sections around so they are sorted alphabetically, without any other changes.
2022-08-17 11:40:03 -03:00
Ran Benita
bec2b8ee3a Merge pull request #10220 from bluetech/build-cleanups
Two minor cleanups in pyproject.toml and setup.cfg
2022-08-15 20:53:24 +03:00
aizpurua23a
7378f35b03 Update fixtures.rst w/ finalizer order
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-08-15 14:00:03 -03:00
Ran Benita
b6eaf319d1 Merge pull request #10219 from bluetech/parametrize-argnames-type
mark: allow any Sequence[str] for parametrize(argnames), not just list/tuple
2022-08-15 19:59:45 +03:00
Bruno Oliveira
2e7c718373 Add reference to the Where to patch docs in monkeypatch.setattr (#10217)
This should help users with the common issue of patching the wrong place.

Also took the opportunity of using proper links in the monkeypatch introduction.

Related to #10216

Co-authored-by: Ran Benita <ran@unusedvar.com>
2022-08-15 13:55:19 -03:00
Ran Benita
08dfd3124c Merge pull request #10218 from bluetech/sphinx5-changelog
changelog: add missing entry for PR #9248 (Sphinx 5)
2022-08-15 19:54:48 +03:00
Ran Benita
56862c03cb pyproject.toml: remove wheel from build-system.requires
It's not required -- see
https://github.com/pypa/packaging.python.org/pull/1050
2022-08-15 19:41:57 +03:00
Ran Benita
67e29d2548 mark: allow any Sequence[str] for parametrize(argnames), not just list/tuple
The main motivation for this change is to simplify the type shown in
code editors -- `Sequence[str]` is easier to follow than
`Union[list[str], tuple[str, ...]]`.

It also permits using other types if desired. It might lead to problems
if someone uses some oddball sequence type, but hopefully they won't do
that.
2022-08-15 19:38:09 +03:00
Ran Benita
cb65f64572 changelog: add missing entry for PR #9248 2022-08-15 19:07:36 +03:00
github-actions[bot]
f425dfc158 [automated] Update plugin list (#10214)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-08-14 05:07:01 -03:00
Ran Benita
63d2f7f7f8 Merge pull request #9248 from bluetech/sphinx4
doc: support sphinx 5
2022-08-13 22:35:55 +03:00
Sviatoslav Sydorenko
739322af03 Mention monkeypatch.context() in the docs (#10192)
In addition:

* Improve the docs a bit with links.
* Recommend `context()` instead of `undo()`.
2022-08-13 16:07:27 -03:00
Ran Benita
beae7fd0ba doc: workaround for ugly API docs for overloaded functions with new Sphinx
New Sphinx added support for overloads and always displays them all with
full type annotations etc. This regresses the API reference for
overloaded functions like `fixture()`, `warns()`, `raises()` and friends
to become impossible to read.

I tried various workarounds but none worked except this one.
2022-08-13 21:46:49 +03:00
Ran Benita
7431750bb6 doc: have tighter control on what autodoc shows
New versions of sphinx starting showing `__init__` parameters even when
we don't want them to show because they are private (have `_ispytest`
argument).

The only working solution I found was to switch to
`autodoc_typehints_description_target = "documented"` and explicitly
document parameters for which we want to show the types. It's a little
tedious and repetitive in some simple cases, but overall it results in
nicer API docs.
2022-08-13 21:46:49 +03:00
Ran Benita
cb7f5ed3b1 doc: require sphinx 5
Fix #9836.
2022-08-13 21:45:54 +03:00
Nhieuvu1802
c72d202317 build(deps): Bump pytest-asyncio in /testing/plugins_integration (#10212)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 20:56:51 -03:00
holesch
cc0092b9d8 JUnit XML: Escape error messages in setup/teardown (#10190)
Co-authored-by: Holesch, Simon (BSH) <simon.holesch@bshg.com>
2022-08-12 11:11:03 +02:00
dependabot[bot]
433efaeaa9 build(deps): Bump django in /testing/plugins_integration (#10195)
Bumps [django](https://github.com/django/django) from 4.0.6 to 4.1.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.0.6...4.1)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 11:09:06 +02:00
Brandon Chinn
4d430ea6ff Fix partially unknown type (#10204) 2022-08-12 11:08:39 +02:00
github-actions[bot]
abd5df4b3c [automated] Update plugin list (#10194)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-08-12 11:06:48 +02:00
Thomas Grainger
58cf20edf0 Update :class:pytest.PytestUnhandledCoroutineWarning to a deprecation; it will raise an error in pytest 8. [SQUASH] (#10012)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-08-08 10:14:49 +01:00
Bruno Oliveira
f43ddd8acd Merge pull request #10177 from pytest-dev/update-plugin-list/patch-b4ab2f094
[automated] Update plugin list
2022-07-31 10:50:44 -03:00
Robert O'Shea
1c31a7e659 Added file-like methods to DontReadFromInput (#10173)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>

Fixes #10150
2022-07-31 13:44:02 +00:00
pytest bot
c0e3071fdf [automated] Update plugin list 2022-07-31 00:22:46 +00:00
Bruno Oliveira
b4ab2f0942 Merge pull request #10170 from pytest-dev/pre-commit-ci-update-config 2022-07-25 20:15:38 -03:00
pre-commit-ci[bot]
dbc1017b08 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/reorder_python_imports: v3.8.1 → v3.8.2](https://github.com/asottile/reorder_python_imports/compare/v3.8.1...v3.8.2)
- [github.com/asottile/pyupgrade: v2.37.1 → v2.37.2](https://github.com/asottile/pyupgrade/compare/v2.37.1...v2.37.2)
- [github.com/asottile/setup-cfg-fmt: v1.20.1 → v1.20.2](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.1...v1.20.2)
- [github.com/pre-commit/mirrors-mypy: v0.961 → v0.971](https://github.com/pre-commit/mirrors-mypy/compare/v0.961...v0.971)
2022-07-25 22:19:32 +00:00
Bruno Oliveira
70659b8c34 Merge pull request #10165 from pytest-dev/update-plugin-list/patch-6c57cc172
[automated] Update plugin list
2022-07-23 23:40:51 -03:00
pytest bot
3bf15135e4 [automated] Update plugin list 2022-07-24 00:25:01 +00:00
Bruno Oliveira
6c57cc1727 Merge pull request #10158 from albertvillanova/patch-3 2022-07-23 14:01:38 -03:00
Bruno Oliveira
c0843f94e4 Merge pull request #10157 from albertvillanova/patch-2
Fix typo in example/markers documentation
2022-07-23 14:00:29 -03:00
Albert Villanova del Moral
8c5487fd6b Fix cross-reference in reference/reference docs 2022-07-20 00:01:23 +02:00
Albert Villanova del Moral
4696ba74f9 Fix typo in example/markers docs 2022-07-19 22:16:14 +02:00
Bruno Oliveira
34a285986e Merge pull request #10143 from sirosen/monkeypatch-ctx-howto 2022-07-15 23:08:21 -03:00
Stephen Rosen
b8e2f42ec1 Add monkeypatch.context() to how-to doc intro 2022-07-15 19:26:36 +00:00
Wolfremium
70cac3d464 Explicit note that tmpdir fixture is discouraged in favour of tmp_path #9937 (#10138)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: kevin.hierro-ext <kevin.hierro-ext@clarity.ai>
Co-authored-by: Dani Sancas <lord.sancas@gmail.com>
2022-07-15 08:40:18 -03:00
Nipunn Koorapati
c1d134172c Add typing for FixtureRequest.param (#10133)
For now, mark it as Any until #8073 is solved

Fixes #9514
2022-07-14 20:36:05 -03:00
Bruno Oliveira
cbcb3a356e Merge pull request #10132 from hroncok/python3.11.0b4 2022-07-14 08:37:08 -03:00
Miro Hrončok
09b2c95320 Adjust tests for a last minute Python 3.11 change in the traceback format
See https://github.com/python/cpython/issues/93883
and https://github.com/python/cpython/pull/93994

Fixes https://github.com/pytest-dev/pytest/issues/10131
2022-07-13 17:14:37 +02:00
Bruno Oliveira
c2b1d5b368 Merge pull request #10127 from pytest-dev/pre-commit-ci-update-config 2022-07-11 19:56:56 -03:00
pre-commit-ci[bot]
5c513a5fb3 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/reorder_python_imports: v3.3.0 → v3.8.1](https://github.com/asottile/reorder_python_imports/compare/v3.3.0...v3.8.1)
- [github.com/asottile/pyupgrade: v2.34.0 → v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.34.0...v2.37.1)
2022-07-11 21:57:36 +00:00
Anthony Sottile
7b9f71d84f Merge pull request #10123 from nicoddemus/fix-mypy-pre-commit
Fix mypy pre-commit run
2022-07-11 08:47:45 -04:00
Bruno Oliveira
334d6514c6 Fix mypy pre-commit run
This started to fail recently with:

```
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

src/_pytest/assertion/rewrite.py:284: error: Returning Any from function declared to return "TraversableResources"  [no-any-return]
Found 1 error in 1 file (checked 219 source files)
```

Not sure why that started failing, but seems like ignoring that error specifically is OK.
2022-07-11 08:27:09 -03:00
Bruno Oliveira
f6dc71c8de Merge pull request #10120 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.8.2
build(deps): Bump pytest-mock from 3.8.1 to 3.8.2 in /testing/plugins_integration
2022-07-11 08:06:23 -03:00
Bruno Oliveira
8c60fa1ef9 Merge pull request #10121 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-sugar-0.9.5
build(deps): Bump pytest-sugar from 0.9.4 to 0.9.5 in /testing/plugins_integration
2022-07-11 08:06:09 -03:00
Bruno Oliveira
b83a74a303 Merge pull request #10122 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-bdd-6.0.1
build(deps): Bump pytest-bdd from 5.0.0 to 6.0.1 in /testing/plugins_integration
2022-07-11 08:05:48 -03:00
dependabot[bot]
9c5b6fbab2 build(deps): Bump pytest-bdd in /testing/plugins_integration
Bumps [pytest-bdd](https://github.com/pytest-dev/pytest-bdd) from 5.0.0 to 6.0.1.
- [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/5.0.0...6.0.1)

---
updated-dependencies:
- dependency-name: pytest-bdd
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 03:02:51 +00:00
dependabot[bot]
b1948c60ac build(deps): Bump pytest-sugar in /testing/plugins_integration
Bumps [pytest-sugar](https://github.com/Teemu/pytest-sugar) from 0.9.4 to 0.9.5.
- [Release notes](https://github.com/Teemu/pytest-sugar/releases)
- [Changelog](https://github.com/Teemu/pytest-sugar/blob/master/CHANGES.rst)
- [Commits](https://github.com/Teemu/pytest-sugar/commits)

---
updated-dependencies:
- dependency-name: pytest-sugar
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 03:02:49 +00:00
dependabot[bot]
da68c9d5bc build(deps): Bump pytest-mock in /testing/plugins_integration
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.8.1 to 3.8.2.
- [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.8.1...v3.8.2)

---
updated-dependencies:
- dependency-name: pytest-mock
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-11 03:02:47 +00:00
Bruno Oliveira
29041e1e1f Merge pull request #10118 from pytest-dev/update-plugin-list/patch-7dc540f25
[automated] Update plugin list
2022-07-10 07:51:38 -03:00
pytest bot
dda7673f57 [automated] Update plugin list 2022-07-10 00:24:23 +00:00
Anthony Sottile
7dc540f258 Merge pull request #10115 from pytest-dev/atomicwrites-windows
replace atomicwrites with os.replace
2022-07-08 22:06:56 -04:00
Anthony Sottile
4cd0322ca1 replace atomicwrites with os.replace 2022-07-08 18:36:10 -07:00
Ronny Pfannschmidt
966d4fb3e4 Merge pull request #10051 from EmptyRabbit/dev_main
Fix stage caplog records not clear
2022-07-08 07:46:10 +02:00
Bruno Oliveira
8726597321 Update changelog/9877.bugfix.rst 2022-07-07 09:39:57 -03:00
EmptyRabbit
aa83fa353c Update changelog/9877.bugfix.rst
Co-authored-by: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
2022-07-07 19:29:50 +08:00
Florian Bruhin
4449bdc068 Remove europython training (#10107) 2022-07-06 13:05:08 +02:00
Bruno Oliveira
929e7d5ae0 Merge pull request #10106 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.0.6 2022-07-06 07:52:52 -03:00
dependabot[bot]
6d7973942f build(deps): Bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 4.0.5 to 4.0.6.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.0.5...4.0.6)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-05 22:37:17 +00:00
Bruno Oliveira
4414c4adae Merge pull request #10102 from pytest-dev/pre-commit-ci-update-config 2022-07-04 20:27:59 -03:00
pre-commit-ci[bot]
b99541e744 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0)
- [github.com/asottile/reorder_python_imports: v3.1.0 → v3.3.0](https://github.com/asottile/reorder_python_imports/compare/v3.1.0...v3.3.0)
2022-07-04 22:38:23 +00:00
Bruno Oliveira
5f57481563 Merge pull request #10099 from pytest-dev/update-plugin-list/patch-b08c1dcf0
[automated] Update plugin list
2022-07-03 09:36:57 -03:00
pytest bot
04de180f41 [automated] Update plugin list 2022-07-03 00:22:59 +00:00
Anthony Sottile
b08c1dcf0e Merge pull request #10093 from pytest-dev/move-changelog-to-bugfix
git mv changelog/3396.{improvement,bugfix}.rst
2022-06-30 09:07:24 -04:00
Anthony Sottile
3e590fe79e git mv changelog/3396.{improvement,bugfix}.rst 2022-06-30 05:47:02 -07:00
Anthony Sottile
7dcabc1f49 Merge pull request #10088 from alicederyn/doctest.importmode
Pass importmode to import_path in DoctestModule
2022-06-29 17:57:37 -04:00
Anthony Sottile
2941da0f2b Merge pull request #10090 from pytest-dev/update-does-not-raise
update does_not_raise docs now that pytest is 3.7+ only
2022-06-29 14:00:03 -04:00
Anthony Sottile
1b47de7d7f update does_not_raise docs now that pytest is 3.7+ only 2022-06-29 13:13:15 -04:00
Alice Purcell
85000f037f Added Alice Purcell to AUTHORS 2022-06-29 14:39:04 +01:00
Alice Purcell
c34eaaaa1c Pass importmode to import_path in DoctestModule
This allows doctest to be used with namespace modules
2022-06-29 14:38:59 +01:00
Bruno Oliveira
06738e36df Merge pull request #10081 from nicoddemus/unittest-cls-skip-10060 2022-06-28 12:49:50 -03:00
Anthony Sottile
94bc31b07d Merge pull request #10086 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-06-28 11:33:04 -04:00
pre-commit-ci[bot]
b961ef5b79 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0)
- [github.com/asottile/pyupgrade: v2.32.1 → v2.34.0](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.34.0)
- [github.com/pre-commit/mirrors-mypy: v0.960 → v0.961](https://github.com/pre-commit/mirrors-mypy/compare/v0.960...v0.961)
2022-06-27 20:50:23 +00:00
Bruno Oliveira
bd642fac70 Do not call tearDown for skipped unittest.TestCases with --pdb
Fix #10060
2022-06-27 10:33:37 -03:00
Bruno Oliveira
da9a2b584e Merge pull request #10078 from nicoddemus/pathsep-9791 2022-06-27 09:58:38 -03:00
Bruno Oliveira
8bbd35aa69 Merge pull request #10082 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.8.1
build(deps): Bump pytest-mock from 3.7.0 to 3.8.1 in /testing/plugins_integration
2022-06-27 07:15:41 -03:00
dependabot[bot]
0b1e9ba270 build(deps): Bump pytest-mock in /testing/plugins_integration
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.7.0 to 3.8.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.7.0...v3.8.1)

---
updated-dependencies:
- dependency-name: pytest-mock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-27 03:02:47 +00:00
Bruno Oliveira
f92c4a77ad Use PurePath directly instead of os.path.sep in rewrite.py
Given we are already creating a `PurePath`, just pass the parts directly to it.

This avoids using `os.path.sep`, that although is an official API, seems not to be available in all systems.

Fix #9791
2022-06-26 21:29:05 -03:00
Bruno Oliveira
9a037a5713 Merge pull request #10076 from pytest-dev/update-plugin-list/patch-aafac5578
[automated] Update plugin list
2022-06-26 10:54:01 -03:00
Bruno Oliveira
11fb5cd331 Merge pull request #10054 from SnoopJeDi/doc/xfail-multiple-exceptions
Indicate support for a tuple of exceptions in xfail raises=
2022-06-26 09:54:18 -03:00
pytest bot
62d975a69e [automated] Update plugin list 2022-06-26 00:25:07 +00:00
Bruno Oliveira
aafac5578c Merge pull request #10056 from paulreece/fixture-path-doc-fix
Added Docstring description for the Path property of FixtureRequest #9975
2022-06-25 20:55:23 -03:00
Zac Hatfield-Dodds
2b70e7f4df Merge pull request #10064 from hugovk/test-me-fix-logging.warn-deprecation
Replace deprecated logging.warn with logging.warning
2022-06-24 23:29:26 -07:00
Zac Hatfield-Dodds
d2a206683c Merge pull request #10073 from Kache/main
Clarify writing_plugins naming instructions
2022-06-24 23:27:58 -07:00
zx.qiu
f29f79e39f Use records.clear() in LogCaptureHandler when caplog.clear() 2022-06-24 23:04:04 +08:00
zx.qiu
c7e784f95d Fix stage caplog records not clear
Closes #9877
2022-06-24 23:03:37 +08:00
Kevin C
0a7b8722e5 Clarify writing_plugins naming instructions
Fixes: #10072
2022-06-23 18:03:18 -07:00
Bruno Oliveira
aa55975c7d Doc: Clear mailbox before deleting the user (#10068) 2022-06-23 21:47:39 -03:00
Anthony Sottile
141c5e5a89 Merge pull request #10070 from pytest-dev/typos
fix some typos to ensure pre-commit.ci fixes main
2022-06-22 11:38:36 -04:00
pre-commit-ci[bot]
cba65e74b3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-06-22 15:32:05 +00:00
Anthony Sottile
74691346bd fix some typos to ensure pre-commit.ci fixes main 2022-06-22 08:29:02 -07:00
pre-commit-ci[bot]
6db715c205 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-06-22 12:16:24 +00:00
Chanvin Xiao
1e6a587363 Doc: Clear mailbox before deleting the user 2022-06-22 20:06:37 +08:00
Hugo van Kemenade
052da7128b Replace deprecated logging.warn with .warning 2022-06-21 22:53:28 +03:00
Paul Reece
cdc287d21a Added self to Authors 2022-06-17 12:00:18 -04:00
Paul Reece
5a9536cf42 Added Docstring description for the Path property of the FixtureRequest class. 2022-06-17 11:52:18 -04:00
James Gerity
17c385180d Indicate support for a tuple of exceptions in xfail raises= 2022-06-16 11:39:41 -04:00
Chris Wheeler
fab696dcd1 Add support for .pytest.ini as an alternative to pytest.ini
Closes #9987
2022-06-14 08:24:35 -03:00
Bruno Oliveira
2cd41651bb Merge pull request #10031 from The-Compiler/trainings
Update training list
2022-06-14 07:31:06 -03:00
Bruno Oliveira
5ef064b602 Mark pdb+expect tests as xfail for now (#10043)
Related to #10042
2022-06-14 07:29:19 -03:00
Bruno Oliveira
d6b837e2d3 Mark pdb+expect tests as xfail for now
Related to #10042
2022-06-14 07:01:34 -03:00
Zach OBrien
96412d19ab Fix representation of tuples in approx
Closes #9917
2022-06-14 06:54:32 -03:00
Bruno Oliveira
bb94e83b49 Merge pull request #10035 from pytest-dev/update-plugin-list/patch-04be900d0
[automated] Update plugin list
2022-06-13 09:10:40 -03:00
pytest bot
1a50e5222f [automated] Update plugin list 2022-06-12 00:22:15 +00:00
Florian Bruhin
27c94f573c Update training list 2022-06-10 15:40:53 +02:00
Bruno Oliveira
04be900d06 Update location of usage.rst to fix manpage compilation (#10026)
`usage.rst` has been moved from `doc/en` to `doc/en/how-to`, so the `man_pages` configuration
value needs to be updated to the new location, so that we dont get this warning:

    writing... WARNING: "man_pages" config value references unknown document usage
2022-06-07 18:49:37 -03:00
Sandro Tosi
fe2c74cb1a Update location of usage.rst to fix manpage compilation
`usage.rst` has been moved from `doc/en` to `doc/en/how-to`, so the `man_pages` configuration
value needs to be updated to the new location, so that we dont get this warning:

    writing... WARNING: "man_pages" config value references unknown document usage
2022-06-07 14:43:34 -04:00
dependabot[bot]
083285948f build(deps): Bump django from 4.0.4 to 4.0.5 in /testing/plugins_integration (#10021)
Bumps [django](https://github.com/django/django) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.0.4...4.0.5)

---
updated-dependencies:
- dependency-name: django
  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>
2022-06-07 08:01:15 -03:00
github-actions[bot]
433c7376c5 [automated] Update plugin list (#10020)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-06-05 12:44:38 -03:00
Neil Girdhar
5adfb0e187 Use symbolic NoReturn as a type annotation (#10018)
Use symbolic NoReturn as a type annotation
2022-06-03 07:59:48 -03:00
Tony Narlock
c2f684fcd6 docs(monkeypatch): Fix autodoc reference links (#10013)
Close #10014
2022-06-02 10:16:59 -03:00
Bruno Oliveira
130c954bb1 Merge pull request #9904 from johnkangw/notes_update 2022-05-31 16:35:29 -03:00
Hugo van Kemenade
e54c6a1362 Document the --code-highlight default (#9883)
Also normalized all help text using the patterns:

* `One sentence help text`
* `First sentence of help. Second sentence of help.`
2022-05-31 16:32:51 -03:00
Bruno Oliveira
9a8f5dd73e Merge pull request #10007 from nicoddemus/importlib-docs 2022-05-31 16:24:55 -03:00
Bruno Oliveira
6017666fe1 Do not advertise that importlib will be default import mode
It is clear at this point that changing the default would break a lot of suites, and is not a clear win in all cases anyway.

Close #10003
2022-05-31 09:53:23 -03:00
Anthony Sottile
a72e8b3d3e Merge pull request #10006 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-05-30 18:31:30 -04:00
pre-commit-ci[bot]
0efd7a6ec6 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.950 → v0.960](https://github.com/pre-commit/mirrors-mypy/compare/v0.950...v0.960)
2022-05-30 21:00:26 +00:00
Ronny Pfannschmidt
c533015c56 Merge pull request #9880 from jparise/getfixturemarker-attr
Use safe_getattr() in getfixturemarker()
2022-05-30 05:54:40 +02:00
github-actions[bot]
e547cd565d [automated] Update plugin list (#10001)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-05-29 13:04:53 -03:00
Zac Hatfield-Dodds
a47e91e077 Merge pull request #9893 from jparise/pytester-mkdir-path 2022-05-27 20:51:50 -07:00
Zac Hatfield-Dodds
420dc7824b Merge pull request #9990 from petebman/improve_getfixturevalue_error_message 2022-05-27 20:40:55 -07:00
Cheuk Ting Ho
c988e49af6 Warn when test functions return other than None (#9956)
Closes #7337
2022-05-25 09:48:02 -03:00
github-actions[bot]
31f9e5bcdd [automated] Update plugin list (#9985)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-05-24 11:12:31 +02:00
Tim Hoffmann
9a9acf13f8 Declutter doc entry page (#9969)
- Remove the index page https://docs.pytest.org/en/7.1.x/genindex.html
  Such an index is reasonable in books but not so much in HTML pages.
  IMHO the integrated search is much more user-friendly and sufficient.

- Remove the PDF link from the entry page. The PDF is already linked
  in the sidebar. I anticipate that getting the PDF documentation is
  not a major concern for users.

- Remove the sections "Changelog" and "License" from the entry page.
  These section only contain links to the respective pages.
  These topics are purely technical. They should be easily accessible
  (which they still are through sidebar section "About the project"),
  but they don't need additional advertisement through a dedicated
  section on the entry page.
2022-05-24 10:23:39 +02:00
Jon Parise
8ac6dce2c7 Add shell-style wildcard support to 'testpaths' (#9897)
This is especially useful for large repositories (e.g. monorepos) that
use a hierarchical file system organization for nested test paths.

    src/*/tests

The implementation uses the standard `glob` module to perform wildcard
expansion in Config.parse().

The related logic that determines whether or not to include 'testpaths'
in the terminal header was previously relying on a weak heuristic: if
Config.args matched 'testpaths', then its value was printed. That
generally worked, but it could also print when the user explicitly used
the same arguments on the command-line as listed in 'testpaths'. Not a
big deal, but it shows that the check was logically incorrect.

Now that 'testpaths' can contain wildcards, it's no longer possible to
perform this simple comparison, so this change also introduces a public
Config.ArgSource enum and Config.args_source attribute that explicitly
names the "source" of the arguments: the command line, the invocation
directory, or the 'testdata' configuration value.
2022-05-24 10:20:51 +02:00
Pete Baughman
0e62861e84 Improve error message in getfixturevalue 2022-05-23 17:54:22 +00:00
Bruno Oliveira
611b579d21 Merge pull request #9963 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.6.1 2022-05-17 09:12:45 -03:00
Bruno Oliveira
8469f44401 Merge pull request #9970 from ezio-melotti/fix-tempdirfactory-docstring
Fix rst markup in TempdirFactory's docstring.
2022-05-17 08:13:11 -03:00
Bruno Oliveira
a1ed6839e3 Refer to py.path.local instead of LEGACY_PATH constant for better docs 2022-05-17 08:09:21 -03:00
Bruno Oliveira
08c0eb661e Merge pull request #9968 from timhoffm/doc-reference-order 2022-05-17 07:55:06 -03:00
Bruno Oliveira
1feb857fcc Merge pull request #9967 from timhoffm/doc-fix-globaltoc 2022-05-17 07:53:53 -03:00
Ezio Melotti
296b642eb3 Fix rst markup in TempdirFactory's docstring. 2022-05-17 07:29:32 +02:00
Tim Hoffmann
ee10ecdf7e Reorder the reference guides in the docs
This changes the order to:

- API Reference
- Fixtures reference
- Configuration
- Exit codes
- Plugin List

which is approximately sorted from general to specific and often used to less used.
Plugin List ist at the end because it points to further external resources.
2022-05-16 23:01:54 +02:00
Tim Hoffmann
73c2d1c6e3 Remove "Python 2.7 and 3.4 Support" from globaltoc
Follow up to #9957 - I missed that the globaltoc is hard-coded
and the page needs to be removed there as well.
2022-05-16 22:52:27 +02:00
github-actions[bot]
7b977f4beb [automated] Update plugin list (#9959)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-05-16 08:46:51 -03:00
Tim Hoffmann
5d28a58640 Remove docs on Python 2.7 and 3.4 Support (#9957)
This extensive explanation is not need anymore because they are now
unsupported for a long time.

Instead add as short section on Python version compatibility in the
backward compatibility docs.
2022-05-16 10:17:18 +02:00
dependabot[bot]
5d20e28538 build(deps): Bump anyio[curio,trio] in /testing/plugins_integration
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 3.5.0 to 3.6.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.5.0...3.6.1)

---
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>
2022-05-16 03:02:09 +00:00
Bruno Oliveira
cc0fbbefa0 Add CHANGELOG for #9873 (#9953) 2022-05-14 12:50:40 +02:00
sommersoft
56c266640e Do not truncate crash messages in short test summary on CI (#9933)
Closes #9920
2022-05-13 08:15:52 -03:00
Bruno Oliveira
69fb79e741 Add colors to summary (#9875)
Fix #9873
2022-05-12 09:55:40 -03:00
Bruno Oliveira
90d2adf0e8 Merge pull request #9951 from rcomer/document-subtest 2022-05-12 09:35:39 -03:00
Ruth Comer
c5432a18e7 doc: link to pytest-subtests 2022-05-12 12:20:00 +01:00
pre-commit-ci[bot]
16781f9b8c [pre-commit.ci] pre-commit autoupdate (#9936)
[pre-commit.ci] pre-commit autoupdate
2022-05-11 10:52:41 -03:00
Pax
a88c0f3bb0 Add link to python docs on logging levels (#9925) 2022-05-11 11:02:36 +03:00
Zac Hatfield-Dodds
ccdee08ddd Merge pull request #9911 from bkeyvani/fix-issue-8646 2022-05-10 23:53:40 -07:00
Zac Hatfield-Dodds
a29f4aff98 Update 8646.improvement.rst 2022-05-10 23:27:33 -07:00
Zac Hatfield-Dodds
58af76122f Move changelog file 2022-05-10 23:27:06 -07:00
Zac Hatfield-Dodds
29462b1277 type-ignore in error-message test 2022-05-10 23:24:13 -07:00
Bruno Oliveira
37316ed0de Merge pull request #9940 from timhoffm/doc-reference-cleanup 2022-05-10 17:21:32 -03:00
Tim Hoffmann
231e220635 Move documentation contents from reference.rst to docstrings
It's better to have the documentation in one place, instead
of having some in the docstring and some additional
information added to the reference documentation in
`reference.rst`.
2022-05-10 20:04:25 +02:00
Bruno Oliveira
93fdb3ecb7 Consistently add **Tutorial**: in front of how-to links in reference (#9938)
Up to now, some had the prefix, some didn't. I think it's good to have
this prefix to give more context, otherwise the links sometimes blend
into the description.

In one case, the link goes to an example, so I used `**Example**:` there.
2022-05-10 11:37:33 -03:00
Tim Hoffmann
a4a8763ebf Consistently add **Tutorial**: in front of how-to links in reference
Up to now, some had the prefix, some didn't. I think it's good to have
this prefix to give more context, otherwise the links sometimes blend
into the description.

In one case, the link goes to an example, so I used `**Example**:` there.
2022-05-10 16:27:21 +02:00
Babak Keyvani
31a9c5c667 improve pytest.raises - cont'd
a few more iterations on error message and related tests.
2022-05-09 21:15:02 -04:00
Ran Benita
db139307ce Merge pull request #9931 from bluetech/py11-rglob
testing: fix Path.rglob("") failures in Python 3.11b1
2022-05-09 16:15:36 +03:00
Ran Benita
644a81af37 testing: fix Path.rglob("") failures in Python 3.11b1
Fix #9930.
2022-05-09 12:52:57 +03:00
Ran Benita
f6aa9d661d Merge pull request #9926 from pytest-dev/update-plugin-list/patch-5f9d68c8d
[automated] Update plugin list
2022-05-09 11:33:32 +03:00
Ran Benita
933156b296 Merge pull request #9915 from peymanslh/fix-encoding-warning
Fix default encoding in cacheprovider
2022-05-09 11:33:05 +03:00
pytest bot
23c8f3d234 [automated] Update plugin list 2022-05-08 00:18:36 +00:00
MatthewFlamm
5f9d68c8d9 Clarify precision when using NUMBER option in --doctest-modules (#9914)
Fix #9892
2022-05-06 20:25:44 -03:00
Peyman Salehi
2f62e6ec96 Fix default encoding in cacheprovider 2022-05-03 20:56:46 +04:30
Anthony Sottile
4ddf48b0a3 Merge pull request #9912 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-05-03 11:17:47 -04:00
pre-commit-ci[bot]
f25b9f619b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/reorder_python_imports: v3.0.1 → v3.1.0](https://github.com/asottile/reorder_python_imports/compare/v3.0.1...v3.1.0)
- [github.com/pre-commit/mirrors-mypy: v0.942 → v0.950](https://github.com/pre-commit/mirrors-mypy/compare/v0.942...v0.950)
2022-05-02 20:47:02 +00:00
Ran Benita
33bf91482e Merge pull request #9905 from pytest-dev/update-plugin-list/patch-e580534df
[automated] Update plugin list
2022-05-02 22:41:00 +03:00
Shantanu
2ba8fd5bc5 Re-export importlib.metadata from _pytest.compat (#9906)
I'm fixing a bug in mypy's --no-implicit-reexport logic in
https://github.com/python/mypy/pull/12704 and mypy-primer flagged this
2022-05-01 10:05:41 +03:00
pytest bot
306b33e755 [automated] Update plugin list 2022-05-01 00:24:20 +00:00
Babak Keyvani
3444d35c54 improve pytest.raises 2022-04-30 17:56:36 -06:00
johnkangw
97383d2d5d Mention use of re_assert for strings in approx docs 2022-04-30 17:20:31 -06:00
Florian Bruhin
e580534df0 doc: Reformat/Modernize some code (#9900)
Found because I was curious what https://pypi.org/project/shed/ does with pytest.
2022-04-28 16:30:16 +02:00
Jon Parise
f6db7ae749 Let mkdir() and mkpydir() receive PathLike names
These pytester utility methods were annotated to only receive `str`
names, but they naturally support os.PathLike values, as well.

This makes writing some pytester calls a little nicer, such as when
creating a directory based on a `.joinpath()` call. We previously needed
to cast that intermediate value to a `str`.
2022-04-25 17:21:15 -07:00
Bruno Oliveira
eb8b3ad929 Merge pull request #9885 from pytest-dev/update-plugin-list/patch-d949b3f7d
[automated] Update plugin list
2022-04-23 21:49:20 -03:00
pytest bot
21091a45d0 [automated] Update plugin list 2022-04-24 00:19:03 +00:00
Bruno Oliveira
d949b3f7d9 Merge pull request #9882 from nicoddemus/check-pick-release
Cherry-pick: 7.1.2 (#9881)
2022-04-23 11:51:08 -03:00
Bruno Oliveira
246815de13 Prepare release version 7.1.2 (#9881)
Co-authored-by: pytest bot <pytestbot@gmail.com>
(cherry picked from commit df9df55749)
2022-04-23 11:38:26 -03:00
Jon Parise
e598429c73 Use safe_getattr() in getfixturemarker() 2022-04-22 14:47:36 -07:00
Zac Hatfield-Dodds
0347957aa7 Fix wrong log_file docs (#9878)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-04-22 15:15:27 -03:00
Bruno Oliveira
1e8e46d456 Merge pull request #9823 from tobiasdiez/patch-1
Clarify error message in case no collectors are found for a file
2022-04-22 07:28:08 -03:00
Tobias Diez
7df405747a Merge branch 'pytest-dev:main' into patch-1 2022-04-22 12:11:03 +02:00
Zac Hatfield-Dodds
28e8c8582e Merge pull request #9871 from paulmueller/getpass-import-error
fix: move 'import getpass' statement to try-clause
2022-04-20 15:48:57 -07:00
Paul Müller
1285caadf2 Update 9871.bugfix.rst 2022-04-21 00:18:47 +02:00
pre-commit-ci[bot]
12971a37e1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-20 18:23:04 +00:00
Paul Müller
715d0ca9d0 cleanup 2022-04-20 20:21:44 +02:00
Paul Müller
2b9f8f2f9b Create 9871.bugfix.rst 2022-04-20 20:20:53 +02:00
pre-commit-ci[bot]
ac9b65d890 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-20 18:15:49 +00:00
Paul Müller
8514fab409 Update AUTHORS 2022-04-20 20:15:29 +02:00
Paul Müller
988197c795 fix: move 'import getpass' statement to try-clause 2022-04-20 20:09:37 +02:00
dependabot[bot]
1ea7081752 build(deps): Bump pytest-asyncio in /testing/plugins_integration (#9824)
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.18.2 to 0.18.3.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Changelog](https://github.com/pytest-dev/pytest-asyncio/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.18.2...v0.18.3)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  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>
2022-04-20 13:08:56 -03:00
github-actions[bot]
6a3168e770 [automated] Update plugin list (#9864)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-04-20 13:08:36 -03:00
Hugo van Kemenade
5800d39053 Increase stacklevel to point at user's code (#9869)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-04-20 13:07:10 -03:00
Bruno Oliveira
045dbc895d Merge pull request #9866 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-22.4.0
build(deps): Bump twisted from 22.2.0 to 22.4.0 in /testing/plugins_integration
2022-04-19 09:38:10 -03:00
Bruno Oliveira
a60a6a3fea Merge pull request #9865 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.0.4 2022-04-19 09:37:40 -03:00
Anthony Sottile
4e3ec26487 Merge pull request #9863 from gresm/patch-1
Update goodpractices.rst
2022-04-18 11:35:44 -04:00
dependabot[bot]
86b62067b7 build(deps): Bump twisted in /testing/plugins_integration
Bumps [twisted](https://github.com/twisted/twisted) from 22.2.0 to 22.4.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-22.2.0...twisted-22.4.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-18 03:01:59 +00:00
dependabot[bot]
ace71037ab build(deps): Bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.0.3...4.0.4)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-18 03:01:56 +00:00
Shantanu
2e8a319828 Use tomllib on Python 3.11 (#9741) 2022-04-17 21:11:17 +03:00
gresm
61095e4ba6 Update goodpractices.rst
Fix example package tree.
2022-04-16 15:51:21 +02:00
Bruno Oliveira
752a059cc2 Merge pull request #9854 from pytest-dev/docs-contributing-easy 2022-04-12 13:40:42 -03:00
Hugo van Kemenade
99e20713fd Docs: link to easy issues in contributing guide 2022-04-12 17:26:30 +03:00
Bruno Oliveira
26c62e1793 Merge pull request #9852 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-04-12 08:03:44 -03:00
pre-commit-ci[bot]
61dfdfcc3f [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.1.0...v4.2.0)
- [github.com/asottile/pyupgrade: v2.31.1 → v2.32.0](https://github.com/asottile/pyupgrade/compare/v2.31.1...v2.32.0)
2022-04-11 21:28:05 +00:00
Bruno Oliveira
9c2ee32069 Merge pull request #9849 from pytest-dev/update-plugin-list/patch-f0cf63a84
[automated] Update plugin list
2022-04-10 11:20:50 -03:00
pytest bot
765583dc34 [automated] Update plugin list 2022-04-10 00:17:14 +00:00
Anthony Sottile
f0cf63a84a Merge pull request #9842 from asottile/init-var-only-dataclasses
fix comparison of dataclasses with `InitVar`
2022-04-08 20:08:51 -04:00
Anthony Sottile
8fa775bcee fix comparison of dataclasses with InitVar 2022-04-08 19:51:05 -04:00
Bruno Oliveira
539a5d70f2 Merge pull request #9843 from asottile/sphinx-workaround 2022-04-08 20:33:40 -03:00
Anthony Sottile
1527130476 temporarily pin jinja2 version for docs build 2022-04-08 17:08:30 -04:00
Bruno Oliveira
238b25ffa9 Merge pull request #9826 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-04-05 09:07:39 -03:00
pre-commit-ci[bot]
e2269f8a5c [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.1.0 → 22.3.0](https://github.com/psf/black/compare/22.1.0...22.3.0)
- [github.com/asottile/setup-cfg-fmt: v1.20.0 → v1.20.1](https://github.com/asottile/setup-cfg-fmt/compare/v1.20.0...v1.20.1)
- [github.com/pre-commit/mirrors-mypy: v0.941 → v0.942](https://github.com/pre-commit/mirrors-mypy/compare/v0.941...v0.942)
2022-04-04 20:26:44 +00:00
Bruno Oliveira
16345bf689 Merge pull request #9832 from pytest-dev/update-plugin-list/patch-00ad12b9d
[automated] Update plugin list
2022-04-03 12:53:34 -03:00
pytest bot
79725c9102 [automated] Update plugin list 2022-04-03 00:17:36 +00:00
Tobias Diez
387ec02021 Add to AUTHORS 2022-03-29 12:38:34 +02:00
Tobias Diez
3fcdbaf0c5 Add changelog 2022-03-29 12:37:23 +02:00
Tobias Diez
141b301d3d Fix more tests 2022-03-29 12:34:15 +02:00
Tobias Diez
31595e8733 Fix tests 2022-03-29 12:33:13 +02:00
Tobias Diez
63c7338028 Fix rename issue 2022-03-27 16:56:23 +02:00
pre-commit-ci[bot]
0eae340e13 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-03-27 14:41:12 +00:00
Tobias Diez
1f10c59cd3 Clarify error message in case no collectors are found for a file 2022-03-27 16:30:57 +02:00
Bruno Oliveira
00ad12b9db Merge pull request #9821 from pytest-dev/update-plugin-list/patch-176d2d7b4
[automated] Update plugin list
2022-03-27 08:20:10 -03:00
pytest bot
592fee2263 [automated] Update plugin list 2022-03-27 00:19:03 +00:00
Anthony Sottile
176d2d7b4e Merge pull request #9806 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-03-23 21:00:02 -04:00
Ran Benita
05dcb22365 Merge pull request #9727 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-22.2.0
build(deps): Bump twisted from 22.1.0 to 22.2.0 in /testing/plugins_integration
2022-03-22 10:21:10 +02:00
dependabot[bot]
cccb9d8530 build(deps): Bump twisted in /testing/plugins_integration
Bumps [twisted](https://github.com/twisted/twisted) from 22.1.0 to 22.2.0.
- [Release notes](https://github.com/twisted/twisted/releases)
- [Changelog](https://github.com/twisted/twisted/blob/twisted-22.2.0/NEWS.rst)
- [Commits](https://github.com/twisted/twisted/compare/twisted-22.1.0...twisted-22.2.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-22 08:00:11 +00:00
pre-commit-ci[bot]
67ab712480 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.940 → v0.941](https://github.com/pre-commit/mirrors-mypy/compare/v0.940...v0.941)
2022-03-21 23:41:24 +00:00
Bruno Oliveira
250a0344ad Merge pull request #9804 from nicoddemus/311-cwd-tests 2022-03-21 13:11:51 -03:00
Bruno Oliveira
3c359455e2 Change directories during some tests in test_collection.py
As discussed in https://github.com/pytest-dev/pytest/pull/9800, this uses
monkeypatch to change directories for two tests in `test_collection.py`, to preserve
their original purpose (even if just removing it doesn't seem to affect the outcome).
2022-03-21 12:38:20 -03:00
Bruno Oliveira
d5ce9f5a16 Merge pull request #9800 from Zac-HD/fix-311-ci 2022-03-21 08:18:39 -03:00
Zac Hatfield-Dodds
0ebfa1d76d Fix CI for Python 3.11
Getting the current working directory has no side-effects, so these context managers were no-ops.
Discovered because Path.__enter__ is deprecated in Python 3.11, for removal in 3.13.
2022-03-20 21:01:26 -07:00
Ronny Pfannschmidt
e9dd3dffab Enhance errors for exception/warnings matching (#8508)
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2022-03-20 23:32:39 -03:00
Kian Eliasi
3297bb24a9 Remove unnecessary numpy import (#9798)
Fix #9726
2022-03-21 00:01:59 +00:00
Bruno Oliveira
6a6a32ceca Merge pull request #9796 from pytest-dev/update-plugin-list/patch-4b6b91fda
[automated] Update plugin list
2022-03-20 10:55:32 -03:00
pytest bot
e503faeb6e [automated] Update plugin list 2022-03-20 00:17:32 +00:00
Bruno Oliveira
4b6b91fda3 Merge pull request #9794 from nicoddemus/split-workflows 2022-03-19 09:34:45 -03:00
Bruno Oliveira
4c16b5af03 Split test/deploy workflows
This will trigger a deploy directly when a tag is pushed, avoiding
having to wait for another lenghty build.

This is safe since we only push release tags after the release PR has passed all its tests.

See comments in #9793.
2022-03-19 09:04:41 -03:00
Samuel Colvin
b75cbee290 Remove newlines from left/right operands with '-vv' (#9743)
The left/right operands produced when `verbose > 1` should not contain newlines, because they are used to 
build the `summary` string. The `assertrepr_compare` function returns a list of lines, and the summary is one of those lines and should not contain newlines itself. 

Fix #9742

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-03-19 11:55:39 +00:00
Ran Benita
eb22339dc3 Merge pull request #9786 from bluetech/cherry-pick-release
Merge pull request #9785 from pytest-dev/release-7.1.1
2022-03-19 13:44:10 +02:00
Bruno Oliveira
63126643b9 Merge pull request #9789 from spaceone/fix-typo 2022-03-18 18:57:52 -03:00
Florian Best
8f64a39d0a [style]: fix typo in docstring 2022-03-18 22:00:14 +01:00
Ran Benita
a18655f729 Merge pull request #9785 from pytest-dev/release-7.1.1
Prepare release 7.1.1

(cherry picked from commit b9462ed7d0)
2022-03-17 23:18:11 +02:00
Ran Benita
22756c28e5 Merge pull request #9768 from bluetech/fix-tests-verbose
testing: fix tests when run under `-v` or `-vv`
2022-03-17 18:17:17 +02:00
Ran Benita
f196701cc1 Merge pull request #9780 from bluetech/restore-confcutdir-behavior
config: restore pre-pytest 7.1.0 confcutdir exclusion behavior
2022-03-17 18:13:06 +02:00
Ran Benita
1d70b022f0 config: restore pre-pytest 7.1.0 confcutdir exclusion behavior
The change from `path not in confuctdir.parents` to the `relative_to`
check in 0c98f19231 broke picking up
conftest files when running against an installed package/site-packages.
See the issue for more details.

Fix #9767.
2022-03-16 22:55:06 +02:00
pre-commit-ci[bot]
d52a6e6074 [pre-commit.ci] pre-commit autoupdate (#9769)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/reorder_python_imports: v2.7.1 → v3.0.1](https://github.com/asottile/reorder_python_imports/compare/v2.7.1...v3.0.1)
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](https://github.com/asottile/pyupgrade/compare/v2.31.0...v2.31.1)
- [github.com/pre-commit/mirrors-mypy: v0.931 → v0.940](https://github.com/pre-commit/mirrors-mypy/compare/v0.931...v0.940)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix mypy errors

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-03-16 21:34:40 +02:00
Ran Benita
2bec21ef5f Merge pull request #9756 from ajberdy/main
Fixed typo in pytester docs.
2022-03-16 21:32:42 +02:00
Ran Benita
5c1756343f Merge pull request #9757 from pytest-dev/update-plugin-list/patch-d306ec0a7
[automated] Update plugin list
2022-03-16 21:32:11 +02:00
Ran Benita
a854ab97b9 Merge pull request #9766 from Rowin/pytest-warns-typo
Typo correction
2022-03-16 21:31:39 +02:00
pre-commit-ci[bot]
abfae83130 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-03-14 20:48:34 +00:00
Ran Benita
37fa0fb4d3 testing: fix tests when run under -v or -vv
Regressed in fac8f284cd, didn't notice
since we don't run tests in CI with `-v`.
2022-03-14 22:27:52 +02:00
Rowin
e75cdae2bc Typo correction
A word was missing in the docstring of the warns function.
2022-03-14 13:26:17 +01:00
Ran Benita
f0bf4c9681 Merge pull request #9760 from bluetech/cherry-pick-release
Merge pull request #9758 from pytest-dev/release-7.1.0
2022-03-13 17:20:13 +02:00
Ran Benita
d87e1e67dd Merge pull request #9758 from pytest-dev/release-7.1.0
Prepare release 7.1.0

(cherry picked from commit 7d4d1ecde6)
2022-03-13 16:59:20 +02:00
pytest bot
61f2b265a3 [automated] Update plugin list 2022-03-13 00:15:56 +00:00
Aaron Berdy
f3053017b9 fix typo in pytester docs 2022-03-12 14:44:52 -08:00
Florian Bruhin
d306ec0a7e Update upcoming trainings (#9744)
* Update upcoming trainings

* Remove old-ish link

* Revert "Remove old-ish link"

This reverts commit 30d75f5088.

* Use crossref

* Add past training
2022-03-12 16:51:56 +01:00
Bruno Oliveira
3e4c14bfaa Merge pull request #9751 from fabianegli/main 2022-03-11 09:53:30 -03:00
Fabian Egli
7f924b13a5 Fix typo in deprecation documentation 2022-03-11 11:15:28 +01:00
dependabot[bot]
4a8f8ada43 build(deps): Bump django from 4.0.2 to 4.0.3 in /testing/plugins_integration (#9737)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 13:50:25 +00:00
dependabot[bot]
c0fd2d8839 build(deps): Bump pytest-asyncio from 0.18.1 to 0.18.2 in /testing/plugins_integration (#9736)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-07 10:29:39 -03:00
Anthony Sottile
843e01824c Merge pull request #9732 from nicoddemus/9730-toml-failure
Improve error message for malformed pyproject.toml files
2022-03-06 10:01:13 -05:00
github-actions[bot]
bc43d66b47 [automated] Update plugin list (#9733)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-03-06 00:01:38 -03:00
Bruno Oliveira
e38d1cac48 Improve error message for malformed pyproject.toml files
Including the file name is enough to let the user know what the problem is.

The same is not needed for `.ini` files because the error message includes the path to the file by default.

Fix #9730
2022-03-05 08:59:28 -03:00
github-actions[bot]
cf0a4f79b0 [automated] Update plugin list (#9717)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-03-04 12:56:11 -03:00
Anthony Sottile
51b86b4dc4 Merge pull request #9714 from nicoddemus/pytester-request-monkeypatch-9708
pytester now requests monkeypatch instead of creating its own instance
2022-03-04 09:22:56 -05:00
Bruno Oliveira
f943d1944a pytester now requests monkeypatch instead of creating its own instance
It is tempting to use `monkeypatch` to replace the other mechanisms in pytester which change global
state: `CwdSnapshot`, `SysModulesSnapshot`, `SysPathsSnapshot`, however those are more delicate
than they look at first glance so leaving those alone for now.

Close #9708
2022-03-04 08:58:44 -05:00
Anthony Sottile
9318b2cb7f Merge pull request #9719 from asottile/fix-setuptools-pollution
prevent import-time side-effects from setuptools bundled importlib-metadata
2022-03-03 09:01:41 -05:00
Anthony Sottile
269611e0b4 prevent import-time side-effects from setuptools bundled importlib-metadata 2022-02-28 19:35:36 -05:00
Kojo Idrissa
e466a87bb0 Add the latest book edition of 'Python Testing with pytest' 2022-02-25 19:13:23 -03:00
Bruno Oliveira
5f3d94c47e Disallow unordered sequences in pytest.approx (#9709)
Fix #9692
2022-02-24 10:16:35 -03:00
Bruno Oliveira
bcc826d0fb Fix numbering and improve changelog entry for #9362 (#9713) 2022-02-23 19:03:13 -03:00
Ran Benita
4778e999a5 Merge pull request #9702 from m-tmatma/feature/fix-bash-complete
fix link of argcomplete page.
2022-02-23 19:30:40 +02:00
Ran Benita
7b6e477e2f Revert "Deprecate raising unittest.SkipTest to skip tests during collection" (#9710)
This reverts commit 25e657bfc1.

Turns out that this *is* a working unittest feature, which pytest should
support, so undo the deprecation.
2022-02-23 15:59:54 +02:00
github-actions[bot]
0c80a1c836 [automated] Update plugin list (#9701)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-02-23 08:26:18 -03:00
Masaru Tsuchiyama
7f50c521b6 fix link of argcomplete page. 2022-02-20 17:29:12 +09:00
Bruno Oliveira
9af3e23695 Expand warnings output for ResourceWarning (#9682)
Fix #9644
2022-02-15 13:00:50 +00:00
Ran Benita
bdbad91493 Merge pull request #9546 from bluetech/fixturedef-attr-doc
fixtures: document FixtureDef's attributes
2022-02-15 14:52:50 +02:00
Bruno Oliveira
fac8f284cd Fix diff output for data types where -v would show less information (#9661)
Close #5192
2022-02-15 09:43:20 -03:00
Ran Benita
afe41e5273 Merge pull request #9678 from bluetech/consistent-idval
python: unify code to generate ID from value
2022-02-15 13:23:35 +02:00
eduardo naufel schettino
c9cf2d4424 Fix count of selected tests on terminal collection summary (#9628) 2022-02-15 11:17:34 +00:00
Bruno Oliveira
f22451717d Merge pull request #9681 from nicoddemus/fix-9645-import-lib 2022-02-14 12:00:29 -03:00
Bruno Oliveira
04cf8db1d7 Merge pull request #9679 from pytest-dev/update-plugin-list/patch-c01a5c177
[automated] Update plugin list
2022-02-14 09:43:59 -03:00
Bruno Oliveira
747b8372ea Try to import module before creating dummy modules with 'importmode=importlib'
The dummy modules we introduce in `insert_missing_modules` (due to #7856 and #7859)
would cause problems if the dummy modules actually end up replacing modules
which could be imported normally because they are available in `PYTHONPATH`.

Now we attempt to first import the module via normal mechanisms, and only
introduce the dummy modules if the intermediary modules don't actually exist.

Close #9645
2022-02-14 09:42:05 -03:00
Andrew Svetlov
fc72ffa39e Merge pull request #9683 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.18.1
build(deps): Bump pytest-asyncio from 0.17.2 to 0.18.1 in /testing/plugins_integration
2022-02-14 09:10:41 +02:00
dependabot[bot]
3e53307586 build(deps): Bump pytest-asyncio in /testing/plugins_integration
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.17.2 to 0.18.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.17.2...v0.18.1)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 03:02:17 +00:00
pytest bot
295e7535c9 [automated] Update plugin list 2022-02-13 00:15:13 +00:00
Ran Benita
c3aa4647c7 python: unify code to generate ID from value
In the following

    @pytest.mark.parametrize(..., ids=[val])

the ID values are only allowed to be `str`, `float`, `int` or `bool`.

In the following

    @pytest.mark.parametrize(..., [val])

    @pytest.mark.parametrize(..., [pytest.param(..., id=val])

a different code path is used, which also allows `bytes`, `complex`,
`re.Pattern`, `Enum` and anything with a `__name__`.

In the interest of consistency, use the latter code path for all cases.
2022-02-12 19:22:37 +02:00
Bruno Oliveira
c01a5c177b Merge pull request #9676 from nicoddemus/cherry-pick-release 2022-02-11 16:09:42 -03:00
Bruno Oliveira
68be319165 Merge pull request #9674 from pytest-dev/release-7.0.1
(cherry picked from commit 18d35b817d)
2022-02-11 15:52:00 -03:00
Bruno Oliveira
8afec9a64d Add autoflake to pre-commit configuration (#9666) 2022-02-11 14:34:02 -03:00
Bruno Oliveira
b79eff065e Enable testing with Python 3.11 (#9511) 2022-02-11 15:20:42 +00:00
Bruno Oliveira
6828ec2f9b Merge pull request #9669 from hugovk/ci-only-update-plugin-list-for-upstream 2022-02-11 09:24:09 -03:00
Bruno Oliveira
2a5bb3b4e0 Merge pull request #9668 from hugovk/test-me-latest-3.10 2022-02-11 09:15:14 -03:00
Hugo van Kemenade
eb8a3ef849 Only update the plugin for upstream 2022-02-11 14:03:22 +02:00
Hugo van Kemenade
be0c41bf8e CI: Test latest 3.10 available 2022-02-11 13:49:11 +02:00
Bruno Oliveira
9e922c4325 Merge pull request #9662 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-22.1.0 2022-02-11 07:28:32 -03:00
dependabot[bot]
2b12739412 build(deps): Bump twisted in /testing/plugins_integration
Bumps [twisted](https://github.com/twisted/twisted) from 21.7.0 to 22.1.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.7.0...twisted-22.1.0)

---
updated-dependencies:
- dependency-name: twisted
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-11 03:47:43 +00:00
Bruno Oliveira
3586edc1c9 Merge pull request #9646 from nicoddemus/9643-delay-warning 2022-02-10 14:11:21 -03:00
Bruno Oliveira
88c35123b8 Delay warning about collector/item diamond inheritance
This allows that warning to be filtered by `filterwarnings`.

Fix #9643
2022-02-10 13:50:25 -03:00
Florian Bruhin
6aaa017b1e doc: Discourage squashing for release (#9657)
Fixes #9655
2022-02-10 08:58:20 +01:00
Ran Benita
2b6708b892 Merge pull request #9624 from bluetech/unittest-getobj
unittest: restore `UnitTestFunction.obj` to return unbound rather than bound method
2022-02-09 22:43:31 +02:00
Ran Benita
23bdf78654 Merge pull request #9651 from bluetech/rename-pythonpath
Rename ``pythonpath`` plugin to ``python_path``
2022-02-09 13:20:22 +02:00
Ran Benita
01e1de7a1a Rename `pythonpath plugin to python_path`
Fix #9636.
2022-02-09 10:03:20 +02:00
Ran Benita
04a6f52d67 Merge pull request #9611 from pllim/patch-1
DOC: pytest.warns() fails on zero warning
2022-02-08 16:00:06 +02:00
Ran Benita
4bf764f9a3 Merge pull request #9625 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.0.2
build(deps): Bump django from 4.0.1 to 4.0.2 in /testing/plugins_integration
2022-02-08 15:59:19 +02:00
Ran Benita
44290d1f6c Merge pull request #9609 from kdelee/patch-1
importlib.readers not valid until python 3.10
2022-02-08 15:57:48 +02:00
Ran Benita
fb378ea269 Merge pull request #9639 from bluetech/docs-django-https
doc: remove django intersphinx mapping
2022-02-08 15:57:06 +02:00
Anthony Sottile
c326c04494 Merge pull request #9642 from pytest-dev/run-testid-with-colon-colon
allow running testids which contain :: in the parametrized portion
2022-02-08 08:34:49 -05:00
Anthony Sottile
efa16c2c9d Merge pull request #9641 from asottile/fix-test-pollution-assertrewrite
fix test pollution in test_assertrewrite
2022-02-08 08:34:12 -05:00
Anthony Sottile
2442034a1e allow running testids which contain :: in the parametrized portion 2022-02-07 20:19:59 -05:00
Anthony Sottile
579785b6cd fix test pollution in test_assertrewrite
originally reproduced with this pollution set:

```
testing/test_assertrewrite.py::TestEarlyRewriteBailout::test_pattern_contains_subdirectories
testing/test_assertrewrite.py::TestRewriteOnImport::test_remember_rewritten_modules
```
2022-02-07 19:29:18 -05:00
Ran Benita
b80472c5bc doc: fix a reference 2022-02-08 00:53:17 +02:00
dependabot[bot]
ef7d67b665 build(deps): Bump django in /testing/plugins_integration
Bumps [django](https://github.com/django/django) from 4.0.1 to 4.0.2.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/4.0.1...4.0.2)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-07 22:47:20 +00:00
Ran Benita
1612d3d1af doc: remove django intersphinx mapping
Initially I just wanted to fix http -> https, but I think it's not worth
having at all just for this one reference.
2022-02-08 00:46:20 +02:00
Ran Benita
d00ca3f8e5 unittest: restore UnitTestFunction.obj to return unbound rather than bound method
This fixes #9610.

pytest 7.0.0 (unintentionally) changed `UnitTestFunction.obj`'s' behavior
to match `Function.obj`. That is probably a good thing to have, however
it evidently causes some regressions as described in the issue, so
restore the previous behavior for now. In the future we might want to
make this change again, but with proper consideration.
2022-02-08 00:46:00 +02:00
pre-commit-ci[bot]
2073cce105 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-02-08 00:44:52 +02:00
Elijah DeLee
d45a19cfde move function specific imports to function
re: review from @asottile that this should only get imported in the function
modify the else/if logic since inside the function we already know the python version is >= 3.10, and just have to know if it is 3.11 or greater
2022-02-08 00:44:52 +02:00
Bruno Oliveira
f86a87a315 Update src/_pytest/assertion/rewrite.py
Co-authored-by: Ran Benita <ran@unusedvar.com>
2022-02-08 00:44:52 +02:00
Bruno Oliveira
66dc79efd4 Update changelog/9608.bugfix.rst
Co-authored-by: Elijah DeLee <kdelee@redhat.com>
2022-02-08 00:44:52 +02:00
Bruno Oliveira
5f1a2f33da Fix invalid importing of importlib.reader in Python 3.9
Fix #9608
2022-02-08 00:44:52 +02:00
Elijah DeLee
15ddccf700 importlib.readers not valid until python 3.10
This exists https://github.com/python/cpython/blob/3.10/Lib/importlib/readers.py and FileReader is in there
This is a 404 https://github.com/python/cpython/blob/3.9/Lib/importlib/readers.py

This change needs to get backported to the 7.0.z branch(s) too
Fixes https://github.com/pytest-dev/pytest/issues/9608
2022-02-08 00:44:52 +02:00
Anthony Sottile
bc33ba0be9 Merge pull request #9638 from asottile/fix-test-pollution
work around test pollution caused by new setuptools mutating global logger level
2022-02-07 17:19:01 -05:00
Anthony Sottile
b3692fe404 work around test pollution caused by new setuptools mutating global logger level 2022-02-07 15:10:03 -05:00
Ran Benita
6f936aa97c Merge pull request #9622 from pytest-dev/update-plugin-list/patch-18c0cfc0d
[automated] Update plugin list
2022-02-07 15:09:58 +02:00
pytest bot
2c3be75b09 [automated] Update plugin list 2022-02-06 00:13:55 +00:00
Ran Benita
18c0cfc0de Merge pull request #9612 from bluetech/namedtuple-class
mark/structures: use class-based NamedTuple syntax
2022-02-05 12:16:00 +02:00
Ran Benita
20c2c30ff2 mark/structures: use class-based NamedTuple syntax
Should hopefully work now in Python>=3.7.
2022-02-05 11:52:36 +02:00
P. L. Lim
d1b394af88 DOC: pytest.warns() fails on zero warning 2022-02-04 17:45:04 -05:00
Florian Bruhin
77a38a3b75 doc: Add changing RTD version to checklist (#9606)
I still think it makes sense to always serve docs from the release branch (rather than the latest tagged release), but that means we need to update it on new releases.
2022-02-04 17:36:31 +01:00
Gabor Szabo
57f8f5d2b3 Mention basetemp in docs as a way to only keep last temp dir (#9607)
Closes #9599
2022-02-04 12:38:26 +00:00
Florian Bruhin
b5a168aa0e doc: Streamline remote handling in releasing docs (#9603)
The docs already assume an 'upstream' remote, so we can only fetch from there instead of fetching all remotes. We also don't need to hardcode the remote URL.
2022-02-04 12:13:33 +01:00
Florian Bruhin
48f01bdcc2 doc: Hide done training (#9602)
Only commenting out as I expect to add trainings at PyConDE and possibly PyConIT soon
2022-02-04 12:12:58 +01:00
Florian Bruhin
dff1a15881 ci: Add missing macOS CI envs (#9601)
alinsa_vix in Discord noticed that we are not testing Python 3.9 and 3.10 on macOS, which seems strange. Maybe this is due how to macOS CI resources were quite scarce for a while, but I believe this has improved since.
2022-02-04 12:11:30 +01:00
Florian Bruhin
dfa7023862 Prepare release 7.0.0 (#9598) (#9604)
* Prepare release version 7.0.0

* Add note to changelog

Co-authored-by: pytest bot <pytestbot@gmail.com>
Co-authored-by: Florian Bruhin <me@the-compiler.org>
(cherry picked from commit e37fbe5685)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-04 07:48:24 -03:00
Florian Bruhin
2982753d80 releasing: Add template for major releases (#9596)
* releasing: Add template for major releases

With pytest 6.0.0, we still used a manual releasing workflow (at least if I
remember correctly), and apparently we never wrote a release announcement
template for major releases. Instead, the minor release template claimed that
the release would contain "breaking changes", which doesn't seem reasonable.
Thus, this adds a new major template based on the former minor template, and
adjusts the latter to only mention fixes and new features instead.

* Update scripts/release.minor.rst

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-02-03 15:33:07 +00:00
Florian Bruhin
12b288d84a releasing: Always set doc_version (#9589)
Looks like something (tox?) does not deal with empty arguments being passed to release.py correctly
2022-02-03 11:48:55 +01:00
Anthony Sottile
90b1c93f7e Merge pull request #9585 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-02-01 01:32:31 -05:00
pre-commit-ci[bot]
9d2ffe207b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-01-31 22:20:16 +00:00
pre-commit-ci[bot]
3aef0b9de6 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.12b0 → 22.1.0](https://github.com/psf/black/compare/21.12b0...22.1.0)
- [github.com/asottile/blacken-docs: v1.12.0 → v1.12.1](https://github.com/asottile/blacken-docs/compare/v1.12.0...v1.12.1)
- [github.com/asottile/reorder_python_imports: v2.6.0 → v2.7.1](https://github.com/asottile/reorder_python_imports/compare/v2.6.0...v2.7.1)
2022-01-31 22:18:51 +00:00
Bruno Oliveira
4b1d9092a8 Merge pull request #9579 from pytest-dev/update-plugin-list/patch-ee9ddff34 2022-01-31 11:37:05 -03:00
Bruno Oliveira
232f44369a Merge pull request #9581 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.7.0 2022-01-31 09:14:21 -03:00
dependabot[bot]
b2701a0272 build(deps): Bump pytest-mock in /testing/plugins_integration
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.6.1 to 3.7.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.6.1...v3.7.0)

---
updated-dependencies:
- dependency-name: pytest-mock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 03:02:08 +00:00
pytest bot
321747628e [automated] Update plugin list 2022-01-30 00:12:51 +00:00
Florian Bruhin
ee9ddff34e doc: Recategorize 7.0.0 changelog items (#9561) 2022-01-27 12:39:32 +00:00
Florian Bruhin
6e1445b521 ci: Bump up timeout (#9560)
macOS apparently can be slow, https://github.com/pytest-dev/pytest/runs/4965510831 for #9556 got cancelled at 91%
2022-01-27 13:33:20 +01:00
Florian Bruhin
597bb9376b Add missing cooperative constructor changelog (#9559)
This was supposed to be part of #9488, but I only now noticed it was lying around uncommitted in my git dir
2022-01-27 13:33:09 +01:00
Florian Bruhin
843f03e3ca doc: Add ellipsis to warning usecase list (#9558)
I feel like this makes it clearer where the code which was inside 'pytest.warns' is supposed to go.
2022-01-27 13:32:37 +01:00
Bruno Oliveira
f064942f2e Make 'warnings' and 'deselected' in assert_outcomes optional (#9475)
Fix #9471
2022-01-27 12:18:36 +01:00
Florian Bruhin
396a7def75 Add additional docs for uncooperative ctor deprecation (#9498)
* Add additional docs for uncooperative ctor deprecation

Fixes #9488

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Break up long line

* Recommend kwonly args

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-27 11:49:18 +01:00
Ran Benita
cd8bfa94ec Merge pull request #9545 from bluetech/doc-version
doc/reference: don't document `pytest.__version__` under "Marks"
2022-01-27 10:46:28 +02:00
Ran Benita
04bddfc655 Merge pull request #9547 from bluetech/refactor-idmaker
Refactor idmaker functions into class IdMaker
2022-01-27 10:46:08 +02:00
Tobias Deiminger
b21b008118 Refactor idmaker functions into class IdMaker
This commit only refactors, it does not change or add functionality yet. Public
API is retained. Reason or refactoring:

User provided parameter IDs (e.g. Metafunc.parametrize(ids=...)) had so far
only been used to calculate a unique test ID for each test invocation. That
test ID was a joined string where each parameter contributed some partial ID.

We're soon going to reuse functionality to generate parameter keys for
reorder_items and FixtureDef cache. We will be interested in the partial
IDs, and only if they originate from explicit user information. Refactoring
makes logic and data accessible for reuse, and increases cohesion in general.
2022-01-26 15:42:34 +02:00
Ran Benita
acd2034535 fixtures: document FixtureDef's attributes 2022-01-25 23:44:59 +02:00
Ran Benita
52fbf3dbaa fixtures: make code flow clearer
Make the two cases (direct/indirect fixture) clearer. The try-catch
forces the reader to jump around.
2022-01-25 22:44:04 +02:00
Ran Benita
e6166ccc3c doc/reference: don't document pytest.__version__ under "Marks" 2022-01-25 22:39:13 +02:00
Ran Benita
5c69eced6c Merge pull request #9532 from bluetech/getdir-cache
config: avoid stat storm in _getconftestmodules
2022-01-25 16:21:44 +02:00
Akuli
a17e708352 With -vv, display the full skip/xfail reason instead of "..." (#9537)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-01-25 10:33:22 -03:00
Anthony Sottile
382e3d346e Merge pull request #9539 from pytest-dev/all-repos_autofix_flake8-typing-imports
upgrade flake8-typing-imports
2022-01-24 08:56:04 -05:00
Bruno Oliveira
2907252693 Merge pull request #9528 from SalmonMode/autouse-linearization-graph 2022-01-24 07:47:43 -03:00
Anthony Sottile
039c3a201d upgrade flake8-typing-imports
Committed via https://github.com/asottile/all-repos
2022-01-23 21:21:26 -05:00
Andrew Svetlov
b9fc678770 Merge pull request #9538 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.17.2
build(deps): Bump pytest-asyncio from 0.16.0 to 0.17.2 in /testing/plugins_integration
2022-01-23 23:23:53 +02:00
Andrew Svetlov
9ae64aae56 Setup strict asyncio mode 2022-01-23 23:07:28 +02:00
dependabot[bot]
7783fb1b1e build(deps): Bump pytest-asyncio in /testing/plugins_integration
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.16.0 to 0.17.2.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.16.0...v0.17.2)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-23 20:37:56 +00:00
Ran Benita
00085391fb Merge pull request #9518 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.5.0
build(deps): Bump anyio[curio,trio] from 3.4.0 to 3.5.0 in /testing/plugins_integration
2022-01-23 22:02:15 +02:00
Ran Benita
bc296443bd Merge pull request #9534 from pytest-dev/update-plugin-list/patch-bb5a4e2d6
[automated] Update plugin list
2022-01-23 21:46:43 +02:00
pytest bot
dddadefa68 [automated] Update plugin list 2022-01-23 00:12:46 +00:00
Ran Benita
aee04cd49f config: avoid stat storm in _getconftestmodules
Fix #9478.
2022-01-22 00:27:43 +02:00
Ran Benita
bb5a4e2d63 Merge pull request #9531 from bluetech/misc
python: fix confused docstring of `Metafunc._resolve_arg_ids`
2022-01-21 17:24:56 +02:00
Ran Benita
471634d6bd python: fix confused docstring of Metafunc._resolve_arg_ids
The docstring (and function name itself) described things as if IDs are
being assigned to the argnames, but actually they're assigned to the
parameter sets.
2022-01-21 16:18:44 +02:00
Ran Benita
888026f7a6 Merge pull request #9171 from bluetech/optimize-keywords-init
Optimizations/fixes around Function `keywords`
2022-01-21 15:19:53 +02:00
Ran Benita
6d128cd52e python: use a more memory-friendly generator 2022-01-21 14:35:25 +02:00
Ran Benita
74571ba55f Add missing keywords type annotations 2022-01-21 14:35:25 +02:00
Ran Benita
456a2538ac python: optimize node keywords initialization
If we do the `update`s in the right order, we can avoid the `mark.name
not in self.keywords` check, since `self.keywords` starts out clean and
`update` will override previously set keywords.
2022-01-21 14:35:25 +02:00
Ran Benita
3c69bc919c python: remove broken/ineffectual keywords marks initialization
By my analysis, this deleted code block has no effect:

1. `self.keywords` is `update`d with `callspec.marks`.
2. `self.own_markers` is `update`d with `callspec.marks`.
3. `self.keywords` is `update`d with `self.own_markers`.

So together steps 2+3 completely undo step 1.
2022-01-21 14:35:24 +02:00
Ran Benita
d9bcfa0c2b python: don't redundantly duplicate parent markers to own keywords
This does have a slight semantic change: in a node hierarchy parent ->
child, if parent has a marker applied, then child is constructed, then
`parent.themarker = "overridden"`, previously
`child.keywords['themarker']` would return `True`, now it returns
`"overridden"`. But that's actually what I would have expected so I see
it as more of a bugfix.
2022-01-21 14:34:27 +02:00
Ran Benita
8713c32462 python: unpacked marks need to be added to keywords on all node types
(except `Instance`)

Currently, `Function` does this manually, but other node types don't get
their markers added to their `keywords`, but they should, if only for
consistency.
2022-01-21 14:34:27 +02:00
Ran Benita
e9bb1aa233 python: be consistent with what value marks have in keywords
Marks are added to keywords in three places:

- `Node.add_marker`: name -> `Mark`
- `Function.__init__(callspec)`: name -> `Mark`
- `Function.__init__ iter_markers`: name -> True

I think it should be consistent, which will also help with some upcoming
code cleaning. The `Mark` seems more useful than just a `True`, so
switch to that.
2022-01-21 14:34:27 +02:00
Ran Benita
4e5fb520b6 python: remove an unneeded normalize_mark_list call
`callspec.mark` is already `List[Mark]` so no need to normalize it.
2022-01-21 14:34:27 +02:00
Ran Benita
6672a10354 fixtures: use node.ihook instead of open-coding it 2022-01-21 14:29:47 +02:00
Bruno Oliveira
4c8fb6f0af Merge pull request #9522 from holmanb/rewrite-test 2022-01-20 13:18:12 -03:00
Chris NeJame
1fd0dcd510 fix missing ref to flattened fixture order image 2022-01-19 09:26:07 -05:00
Brett Holman
3f44b4078c Add test coverage to test rewrite 2022-01-18 11:26:46 -07:00
dependabot[bot]
c393f95c99 build(deps): Bump anyio[curio,trio] in /testing/plugins_integration
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio) from 3.4.0 to 3.5.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.4.0...3.5.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>
2022-01-17 03:02:30 +00:00
Bruno Oliveira
fe1f0e5376 Merge pull request #9516 from pytest-dev/update-plugin-list/patch-a6310c20c
[automated] Update plugin list
2022-01-16 09:03:31 -03:00
pytest bot
947b5dbc47 [automated] Update plugin list 2022-01-16 00:13:41 +00:00
Ran Benita
a6310c20c1 Merge pull request #9512 from bluetech/pluggy-private
testing: avoid private pluggy attributes in test
2022-01-14 18:09:10 +02:00
Ran Benita
3f4eab3f8f testing: avoid private pluggy attributes in test 2022-01-14 17:49:38 +02:00
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
Bruno Oliveira
e9ed4827a4 Merge pull request #9506 from eamanu/fix-9505 2022-01-13 13:52:09 -03:00
Emmanuel Arias
5c2d752e74 improve docs 2022-01-13 13:29:08 -03:00
Emmanuel Arias
0fe0b78a9f Improve on configuration file docs section
To avoid confusions the part of that "the configuration file can
be locate on your tests folder" is removed.
2022-01-13 12:52:18 -03:00
Ran Benita
f1aa7a25de Merge pull request #9493 from bluetech/conftesting
Some conftest changes
2022-01-12 10:38:14 +02:00
Anthony Sottile
202e44b5e6 Merge pull request #9500 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-01-10 18:33:35 -05:00
pre-commit-ci[bot]
8891d1f449 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.930 → v0.931](https://github.com/pre-commit/mirrors-mypy/compare/v0.930...v0.931)
2022-01-10 21:28:04 +00: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
Bruno Oliveira
610edd156e Merge pull request #9497 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.0.1
build(deps): Bump django from 4.0 to 4.0.1 in /testing/plugins_integration
2022-01-10 07:58:56 -03: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
0995e84adb Merge pull request #9492 from pytest-dev/update-plugin-list/patch-abe2a8f4e
[automated] Update plugin list
2022-01-09 13:14:03 +02: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
0ef882364e config: stop resolving symlinks in conftest paths
This became the wrong thing to do since
322190fd84.
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
pytest bot
f0dab8ba8d [automated] Update plugin list 2022-01-09 00:12:59 +00:00
Ran Benita
d98b695fec config: return Sequence instead of List from _getconftestmodules
Nothing should mutate the internal data structure here.
2022-01-09 00:30:18 +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
Ran Benita
0c98f19231 config: make confcutdir check a bit more clear & correct
I think this named function makes the code a bit easier to understand.

Also change the check to explicitly check for "is a sub-path of" instead
of the previous check which only worked assuming that path is within
confcutdir or a direct parent of it.
2022-01-08 22:48:40 +02:00
Ran Benita
1c7644cc7a config: some comments 2022-01-08 22:30:48 +02:00
Ran Benita
5f23157b39 config: remove always truthy condition 2022-01-08 12:36:43 +02:00
Ran Benita
abe2a8f4e1 Merge pull request #9484 from bluetech/getconftestmodules-cache-fix
config: fix incorrect cache hit check in _getconftestmodules
2022-01-07 13:27:45 +02:00
Ran Benita
b19374bc19 config: fix incorrect cache hit check in _getconftestmodules
This made the cache not work as intended, causing a major slowdown.

See #9478 for discussion and context.

Authored-by: Anthony Sottile <asottile@umich.edu>
2022-01-07 12:47:39 +02:00
Dan Alvizu
71baf24b6d Doc update: clarify -W syntax (#9464)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2022-01-04 13:55:01 +00:00
Bruno Oliveira
fa43b8dfb2 Merge pull request #9400 from nicoddemus/configinifile-9396 2022-01-04 10:22:35 -03: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
1860140460 Merge pull request #9472 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2022-01-03 19:43:46 -05:00
pre-commit-ci[bot]
b6350b8b97 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.29.1 → v2.31.0](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.31.0)
2022-01-03 21:08:03 +00:00
github-actions[bot]
56081ca075 [automated] Update plugin list (#9468)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2022-01-03 18:57:32 +01:00
Florian Bruhin
d60771f986 ci: Try backporting via pull_request_target (#9430)
* ci: Try backporting via pull_request_target

* ci: Security improvements
2022-01-03 14:14:40 +00:00
Anthony Sottile
548cc4fc17 Merge pull request #9467 from hugovk/ci-rm-feature-branch-restriction
Remove branch restriction to allow testing feature branches
2022-01-01 18:29:14 -05:00
Hugo van Kemenade
819c67f58e Also test branches prefixed test-me- 2022-01-01 23:36:10 +02:00
Anthony Sottile
9a992df3c9 Merge pull request #9455 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-12-30 11:54:49 -05:00
Anthony Sottile
b0aabe4081 fix mypy 0.930 errors 2021-12-30 06:19:29 -08:00
pre-commit-ci[bot]
cbccc06302 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.0.1 → v4.1.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.0.1...v4.1.0)
- [github.com/pre-commit/mirrors-mypy: v0.920 → v0.930](https://github.com/pre-commit/mirrors-mypy/compare/v0.920...v0.930)
2021-12-30 06:19:29 -08:00
Bruno Oliveira
3c8c0d2a33 Merge pull request #9461 from hugovk/main 2021-12-30 08:49:55 -03:00
Hugo van Kemenade
61417b2551 Drop support for EOL Python 3.6 2021-12-30 13:25:34 +02:00
Bruno Oliveira
325744ef86 Merge pull request #9460 from hugovk/rm-3.6 2021-12-30 08:18:44 -03: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
Hasan Ramezani
0b7c3d1145 Remove Python 3.6 related warning from filterwarnings. 2021-12-28 17:09:27 +01:00
Ran Benita
79dbd19780 Merge pull request #9410 from pytest-dev/dependabot/pip/testing/plugins_integration/django-4.0
build(deps): Bump django from 3.2.10 to 4.0 in /testing/plugins_integration
2021-12-28 18:04:33 +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
Ran Benita
755e2509b6 Merge pull request #9456 from bluetech/tox-plugins-py
ci: run plugins job with python 3.9 instead of 3.7
2021-12-28 17:15:35 +02:00
Hasan Ramezani
e5bf3784a4 Update required Python version in docs. 2021-12-28 15:15:52 +01:00
Hasan Ramezani
b72ad0fa8e Remove has_flags conditions from src._pytest.assertion.rewrite._read_pyc 2021-12-28 10:11:45 +01:00
Hasan Ramezani
77042f77cc Remove breakpoint support checking since all python versions support it. 2021-12-28 10:11:45 +01:00
Hasan Ramezani
400915067f Move nullcontext import to src._pytest.logging. 2021-12-28 10:11:45 +01:00
Hasan Ramezani
3d7cd77017 Update syntax to Python3.7+. 2021-12-28 10:11:35 +01:00
Ran Benita
1522afa1cd ci: run plugins job with python 3.9 instead of 3.7
Latest Django release dropped support for 3.7.
2021-12-28 11:01:23 +02:00
Ran Benita
1131f23e04 Merge pull request #9451 from bluetech/code-path-changelog
doc: document {Code,TracebackEntry}.path changes as breaking
2021-12-27 16:59:42 +02:00
Ran Benita
0db1ff0d82 doc: document {Code,TracebackEntry}.path changes as breaking
Closes #9423.
2021-12-27 15:27:38 +02:00
Ran Benita
69da199f6e Merge pull request #9438 from bluetech/pytest-legacypath-imports
pytest: bring back direct imports of TempdirFactory, Testdir
2021-12-27 15:03:05 +02:00
Ran Benita
fcef7e49fd Merge pull request #9447 from bluetech/code-cut-pathlike
code: accept any `os.PathLike[str]` in `Traceback.cut`
2021-12-27 15:02:20 +02:00
Kian Meng, Ang
55debfad1f Fix typos (#9424) 2021-12-27 09:23:15 -03:00
Ran Benita
0da4760715 code: accept any os.PathLike[str] in Traceback.cut
Before 7.0.0rc1, the function accepted `Union[str, py.path.local]`, and
`py.path.local` compares equal to the string path, so a user was able to
pass the path as a string and it would work. In 7.0.0rc1 we changed the
`py.path.local` to `Path` which doesn't compare equal to the string
path, which breaks compatibility (e.g. the `sybil` package).

This restores compatibility for this function by accepting any
`os.PathLike[str]` and only comparing the string representations.
2021-12-27 11:26:32 +02:00
Ran Benita
7a42db2bf0 Merge pull request #9443 from bluetech/undocumented-hooks
doc/reference: add 4 missing hooks to reference
2021-12-27 11:11:56 +02: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
Hasan Ramezani
5599c5ad45 Drop Python3.6 in CI, setup.cfg, and readme. 2021-12-26 21:08:37 +01:00
Bruno Oliveira
09c0bee288 Merge pull request #9444 from pytest-dev/update-plugin-list/patch-443aa0219
[automated] Update plugin list
2021-12-26 14:10:28 -03:00
Anthony Sottile
d39780f30b Merge pull request #9428 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-12-26 11:50:46 -05:00
pytest bot
427f035b76 [automated] Update plugin list 2021-12-26 00:14:18 +00:00
Ran Benita
05d46ca850 doc/reference: add 4 missing hooks to reference
Fix #9434.
2021-12-25 13:54:42 +02:00
Ran Benita
3128080806 pytest: bring back direct imports of TempdirFactory, Testdir
The monkeypatch approach doesn't work for `import pytest;
pytest.TempdirFactory`.

Fix #9432.
2021-12-25 13:27:02 +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
Ran Benita
443aa0219c Merge pull request #9416 from bluetech/doc-stash-fix
doc: fix a reference in "Writing hook functions"
2021-12-25 10:49:40 +02:00
Ran Benita
8071ad6b90 doc: fix a reference in "Writing hook functions" 2021-12-25 10:30:59 +02:00
Ran Benita
0fecfff2be Merge pull request #9425 from pytest-dev/update-plugin-list/patch-47df71d23
[automated] Update plugin list
2021-12-23 11:07:22 +02:00
Anthony Sottile
c69b84f236 fix typing issues in mypy 0.920 2021-12-21 20:42:32 -05:00
pre-commit-ci[bot]
e358bc65a8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/mirrors-mypy: v0.910-1 → v0.920](https://github.com/pre-commit/mirrors-mypy/compare/v0.910-1...v0.920)
2021-12-20 20:42:31 +00:00
pytest bot
a73a9a12a2 [automated] Update plugin list 2021-12-19 00:12:37 +00:00
Bruno Oliveira
47df71d23f Merge pull request #9417 from nicoddemus/fix-py3.10.1-9413 2021-12-16 10:37:52 -03: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
Bruno Oliveira
d8ff487b07 Merge pull request #9411 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.5.2 2021-12-13 08:54:31 -03: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
Ran Benita
8040cfd965 Merge pull request #9401 from bluetech/doc-hooks-ref
doc: add a `hook` crossref type
2021-12-12 18:02:53 +02:00
Ran Benita
ab8c9848a0 Merge pull request #9408 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2.10
build(deps): Bump django from 3.2.9 to 3.2.10 in /testing/plugins_integration
2021-12-12 18:02:27 +02:00
Ran Benita
0e69c62ece doc: add a hook crossref type
Allow writing

    🪝`pytest_cmdline_main`

instead of

    :func:`pytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>`
2021-12-12 16:29:30 +02: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
Ran Benita
37d44434d8 Merge pull request #9405 from bluetech/ci-backport
ci: add a workflow for backporting to other branches
2021-12-12 16:26:11 +02:00
Bruno Oliveira
0bc77de158 Merge pull request #9406 from pytest-dev/update-plugin-list/patch-dd609e150
[automated] Update plugin list
2021-12-12 11:22:11 -03: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
2d7905b13b support pypy 2021-12-12 15:14:24 +02:00
Yuval Shimon
df74e5c532 fixing pre-commit 2021-12-12 14:53:29 +02:00
pre-commit-ci[bot]
9166ff6cb5 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-12-12 12:49:24 +00:00
Yuval Shimon
8c3b17263b removing unnecessary changes 2021-12-12 14:47:00 +02:00
Yuval Shimon
a67c547536 fixing tests 2021-12-12 14:45:47 +02:00
Yuval Shimon
31f42ef83f small fix 2021-12-12 14:40:46 +02:00
Yuval Shimon
897395afd5 fix 9326 2021-12-12 14:38:45 +02:00
pytest bot
99a8be200a [automated] Update plugin list 2021-12-12 00:12:01 +00:00
Ran Benita
c85b14391d ci: add a workflow for backporting to other branches
To backport a PR, e.g. 1000, to another branch, e.g. `7.0.x`, add a
label `backport 7.0.x` to the PR. This will trigger a workflow which
will create a branch `backport-1000-to-7.0.x` based on the `7.0.x`
branch with a cherry-pick of the PR's merge commit, and create a new PR
for it against the `7.0.x` branch.

It is very simplistic, for instance it doesn't handle cherry-pick
failure gracefully, doesn't validate the state of the PR, doesn't check
if the branch already exists, etc. But we can improve on it later as
needed.

Finally, PRs created by github actions do not themselves trigger further
actions, i.e. the PR isn't checked. You need to close & reopen the PR
for the checks to trigger. There are workarounds for this but they are
either less secure or require more setup.
2021-12-12 01:12:35 +02:00
Ran Benita
dd609e150b Merge pull request #9264 from bluetech/no-pycollector
Make PyCollector an implementation detail - don't use in hook type annotation
2021-12-11 22:57:49 +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
c7be96dae4 Merge pull request #9392 from bluetech/rm-7-deprecated
Remove deprecations scheduled for removal in pytest 7.1
2021-12-08 22:59:42 +02:00
Ran Benita
ee93557ef3 Remove PytestRemovedIn7Warning
Fix #8838.
2021-12-08 15:58:08 +02:00
Ran Benita
e05e696fda Make PyCollector an implementation detail - don't use in hook type annotation
The `pytest_pycollector_makeitem` argument `collector` is currently
annotated with type `PyCollector`. As part of #7469, that would have
required us to expose it in the public API. But really it's an
implementation detail, not something we want to expose. So replace the
annotation with the concrete python collector types that are passed.

Strictly speaking, `pytest_pycollector_makeitem` is called from
`PyCollector.collect()`, so the new type annotation is incorrect if
another type subclasses `PyCollector`. But the set of python collectors
is closed (mapping to language constructs), and the type is private, so
there shouldn't be any other deriving classes, and we can consider it
effectively sealed (unfortunately Python does not provide a way to
express this - yet?).
2021-12-08 15:20:23 +02:00
Anthony Sottile
7ae23ff8ae fix python version in changelog message (#9390) 2021-12-08 10:46:55 +01:00
Bruno Oliveira
3ba9c01f9b Hide internal stack when using pytest.approx() in bool context (#9394)
This makes the error traceback point directly to the offending usage, rather
than to the internal `Approx.__bool__` method.
2021-12-08 10:46:44 +01: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
Ran Benita
4d7a962ca0 Merge pull request #9389 from merwok/patch-1
fix markup typo that breaks rendering
2021-12-07 18:35:42 +02:00
Éric
b691d31897 fix typo 2021-12-07 18:16:59 +02:00
Ran Benita
d4120738b5 Merge pull request #9387 from pytest-dev/releasing-prerelease-tag
RELEASING: should also tag dev0 for prereleases
2021-12-07 17:16:16 +02:00
Ran Benita
49278c1df8 RELEASING: should also tag dev0 for prereleases 2021-12-07 15:04:27 +02:00
Florian Bruhin
21a186bbda scripts: Use release branch for changelog URL (#9380)
* scripts: Use release branch for changelog URL

With a prerelease, /stable won't show the correct changelog.

* [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-12-07 10:24:57 +00:00
Florian Bruhin
5cb50fa13c Fix changelog URL in 7.0.0rc1 announcement (#9379)
The changelog does not exist at /stable because an rc isn't stable...
2021-12-07 10:04:55 +00: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
Ran Benita
ef76c28ea2 Merge pull request #9374 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-12-07 11:20:28 +02:00
Florian Bruhin
0ad452bcba Prepare release version 7.0.0rc1 (#9375) (#9377)
Co-authored-by: pytest bot <pytestbot@gmail.com>
(cherry picked from commit 85897eddc6)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-07 10:13:36 +01:00
Florian Bruhin
fbf64d2529 Don't thank pytest bot (#9372) 2021-12-06 22:55:18 +01:00
Florian Bruhin
3a479db126 Fix hook param name in nonpython example (#9373)
Follow up to #9363
2021-12-06 22:55:06 +01:00
pre-commit-ci[bot]
dd53cc7e38 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-12-06 21:12:33 +00:00
pre-commit-ci[bot]
d7e7c32a5f [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.11b1 → 21.12b0](https://github.com/psf/black/compare/21.11b1...21.12b0)
2021-12-06 21:10:55 +00:00
Bruno Oliveira
70d3d0f390 Drop readline workaround introduced in #1281 (#8848)
Fix #8733
Closes #8847
2021-12-06 19:50:11 +01:00
Florian Bruhin
b3ed595f52 Revert "Fix Dead link in README for 'assert statements' " (#9369)
This reverts commit 15989ddc8f.

Reverts #8945, thus reintroducing #8926 temporarily, but we should be close to
the 7.0.0 release now, where this is the correct URL to use.

Closes #8831 as follow-up to #8858.
2021-12-06 17:56:39 +00:00
Ran Benita
5c55e91d77 Merge pull request #9368 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.5.1
build(deps): Bump pytest-django from 4.4.0 to 4.5.1 in /testing/plugins_integration
2021-12-06 15:39:37 +02:00
Florian Bruhin
663be09723 Improve reference and path/fspath docs (#9341)
* Improve reference and path/fspath docs

Closes #9283

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixups

* Add explanation

* Update wording after #9363

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-06 11:25:05 +01: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
5852d66a6a Merge pull request #9367 from pytest-dev/update-plugin-list/patch-a335ade1f
[automated] Update plugin list
2021-12-05 11:13:37 -03:00
pytest bot
72b7334f1d [automated] Update plugin list 2021-12-05 00:12:43 +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
Bruno Oliveira
96366dca42 Merge pull request #9356 from nicoddemus/copyright 2021-12-02 07:37:16 -03:00
Bruno Oliveira
482b858675 Merge pull request #9357 from GergelyKalmar/remove-unnecessary-newline 2021-12-01 19:08:46 -03:00
GergelyKalmar
82d450f98e Update authors 2021-11-30 19:04:00 +01:00
GergelyKalmar
1bcc2f87a2 Do not display empty worker info 2021-11-30 18:59:46 +01:00
Bruno Oliveira
ed24f29e60 Change copyright notice so yearly updates are not needed
Just learned that we don't need to do this every year: https://hynek.me/til/copyright-years

Followed Go's example of only stating the starting year: https://github.com/golang/go/blob/master/LICENSE

Btw any ideas why the dates vary? Some start in 2004, others 2013, 2015... shouldn't be the same year for all locations?
2021-11-30 09:28:23 -03:00
Zac Hatfield-Dodds
e2ee3144ed Merge pull request #9352 from truth-quark/spelling_fix_9351 2021-11-30 22:47:35 +11:00
Ben Davies
86bcaad828 Fix output of example test method. 2021-11-30 14:55:05 +11:00
Bruno Oliveira
fa240b0bb4 Merge pull request #9345 from aminalaee/patch-1 2021-11-29 11:43:53 -03:00
Bruno Oliveira
7627a7b413 Merge pull request #9348 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.4.0
build(deps): Bump anyio[curio,trio] from 3.3.4 to 3.4.0 in /testing/plugins_integration
2021-11-29 11:32:07 -03: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
64f22dcb80 Merge pull request #9346 from pytest-dev/update-plugin-list/patch-e01231c21
[automated] Update plugin list
2021-11-28 15:25:05 +02:00
pytest bot
7de752a50b [automated] Update plugin list 2021-11-28 00:12:22 +00:00
Amin Alaee
f0d5d523aa Update .readthedocs.yml 2021-11-27 13:15:16 +01:00
Bruno Oliveira
e01231c215 Merge pull request #9332 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-11-26 11:02:59 -03:00
Florian Bruhin
8436d695e5 Fix doc issues in deprecation change (#9336)
Follow-up to #9309.

The issue in the changelog broke the docs build with:

doc/en/_changelog_towncrier_draft.rst:47: WARNING: Inline literal start-string
without end-string.

The second change isn't as critical, but caused the text to be rendered as
monospace including the tilde (i.e. `~pytest.PytestDeprecationwarning`).
2021-11-25 09:43:23 +01:00
pre-commit-ci[bot]
372a6fdfd7 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.10b0 → 21.11b1](https://github.com/psf/black/compare/21.10b0...21.11b1)
- [github.com/asottile/blacken-docs: v1.11.0 → v1.12.0](https://github.com/asottile/blacken-docs/compare/v1.11.0...v1.12.0)
- [github.com/asottile/pyupgrade: v2.29.0 → v2.29.1](https://github.com/asottile/pyupgrade/compare/v2.29.0...v2.29.1)
- [github.com/asottile/setup-cfg-fmt: v1.19.0 → v1.20.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.19.0...v1.20.0)
2021-11-22 20:52:15 +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
github-actions[bot]
4fd897a631 [automated] Update plugin list (#9326)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2021-11-21 17:12:22 +02:00
Bruno Oliveira
cd49075ad7 Merge pull request #9319 from nicoddemus/skip-test-prefix-integration-3.9 2021-11-19 12:23:34 -03: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
Bruno Oliveira
3dc17f1c3b Merge pull request #9293 from hoefling/doc/extlinks-gh-user 2021-11-13 10:57:37 -03:00
Ran Benita
062d91ab47 python: remove the Instance collector node 2021-11-13 14:03:44 +02:00
Florian Bruhin
17b38259fd Pin towncrier to 19.9.0 (#9282)
See https://github.com/twisted/towncrier/issues/346
Closes #8817, supersedes #9045 and #9046.
2021-11-11 16:48:54 +01:00
Bruno Oliveira
c5ab30d907 Merge pull request #9294 from spagh-eddie/patch-1 2021-11-11 07:33:21 -03:00
Eddie
a76df875c7 Remove space inside of dotted attribute 2021-11-10 12:54:21 -08:00
oleg.hoefling
2f1096cd55 replace hardcoded links to github user profiles with extlinks
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-11-10 20:47:27 +01: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
Florian Bruhin
f9afcd2d8a More pytest 7 changelog fixes (#9285)
* Remove changelog entry for #8251

Reverted in #8903

* Move #9202 changelog to to trivial

This won't concern users of pytest

* Streamline deprecation changelogs/docs

* Remove #8994 changelog

This is an impovement for a warning introduced in this release, so including it in a changelog against the last release seems confusing.

* Remove #9241 changelog

This is an impovement for a doc update introduced in this release, so including it in a changelog against the last release seems confusing. The issue number also seems about something different.

* Remove #8897 changelog

Empty file...

* Various minor changelog fixes
2021-11-10 15:16:24 +01:00
Ran Benita
d6e6b9696d Merge pull request #9286 from bluetech/legacypath-subplugins
legacypath: support late-loading of pytester plugin
2021-11-09 15:05:15 +02:00
Ran Benita
63899c76a4 legacypath: support late-loading of pytester plugin
Fixes #9280.

Previous approach didn't support pytester being loaded using
`pytest_plugins = "pytester"` in a conftest.
2021-11-08 21:56:40 +02: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
Bruno Oliveira
b7603fa730 Merge pull request #9278 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2.9 2021-11-08 10:13:19 -03:00
Bruno Oliveira
b378f9a6e0 Merge pull request #9276 from hoefling/doc/extlinks-bpo 2021-11-08 09:41:26 -03:00
Bruno Oliveira
13d23a2dd5 Merge pull request #9275 from hoefling/doc/extlinks-gh-pull 2021-11-08 09:39:50 -03:00
Thomas Hisch
59373fe402 Merge pull request #9271 from thisch/unpack
Inline PercentStyleMultiline._update_message
2021-11-08 12:54:44 +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
86446edc86 Merge pull request #9273 from bluetech/nose-fixtures2
nose: fix class- and module-level fixture behavior
2021-11-07 23:14:39 +02:00
github-actions[bot]
2792f9184e [automated] Update plugin list (#9274)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2021-11-07 23:12:57 +02:00
oleg.hoefling
16e15b99ae sphinx 3 compat
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-11-07 15:24:57 +01:00
oleg.hoefling
36265ccbf6 replace hardcoded links to bugs.python.org with extlinks
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-11-07 15:24:57 +01:00
oleg.hoefling
bba0ce4877 replace hardcoded links to github pull requests with extlinks
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-11-07 15:18:36 +01:00
Simon K
7037a58711 use list comp for getreports in terminal py (#9243) 2021-11-06 16:32:37 +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
Oleg Höfling
49f934618c Replace hardcoded links to Github issues with extlinks (#9234) 2021-11-06 11:16:11 +02:00
Thomas Hisch
d8b647970f Inline PercentStyleMultiline._update_message
and take advantage of dict unpacking operator.
2021-11-05 23:08:30 +01:00
Ran Benita
842814c969 Merge pull request #9262 from bluetech/export-reports
Export CollectReport and TestReport
2021-11-03 15:17:22 +02:00
Ran Benita
b0aa870b11 Export CollectReport and TestReport
Refs #7469.
2021-11-02 20:58:51 +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
Bruno Oliveira
e1b3c2da4b Merge pull request #9256 from pytest-dev/pre-commit-ci-update-config 2021-11-01 19:15:31 -03:00
pre-commit-ci[bot]
2fa37f677b [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.9b0 → 21.10b0](https://github.com/psf/black/compare/21.9b0...21.10b0)
- [github.com/asottile/setup-cfg-fmt: v1.18.0 → v1.19.0](https://github.com/asottile/setup-cfg-fmt/compare/v1.18.0...v1.19.0)
2021-11-01 20:26:52 +00:00
Harshna
9d17cebe64 Use correct input arg type for _bestrelpath (#9238)
Closes #8990
2021-11-01 17:43:05 +02:00
Cristian Vera
f288afde1d Use codecov github action instead of deprecated bash uploader (#9252)
Fixes #9202.
2021-11-01 17:41:56 +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
Ran Benita
11bb9205d7 [automated] Update plugin list (#9253)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2021-11-01 08:42:35 +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
pytest bot
81e2d46302 [automated] Update plugin list 2021-10-31 00:11:03 +00:00
andrewdotn
1824349f74 Use Ubuntu 20.04, lualatex for readthedocs builds (#9242) 2021-10-30 11:21:14 -03:00
Ran Benita
69b0a7b306 ci: remove linting job - covered be pre-commit.ci (#9247) 2021-10-29 19:23:47 -03:00
Ran Benita
e6eac28f0e legacypath: only add testdir and tmpdir fixtures if corresponding plugins are registered
This preserves the existing behavior and gives a proper error message
in case e.g. `testdir` is requested without the `pytester` plugin being
loaded.
2021-10-29 13:11:12 +03: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
d9ca55c648 Move Session.startdir to legacypath plugin 2021-10-28 21:51:51 +03:00
Ran Benita
84722a7904 Move Config.{invocation_dir,rootdir,inifile} to legacypath plugin 2021-10-28 21:51:51 +03:00
Ran Benita
d979f82fb0 Move TerminalReporter.stardir 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
andrewdotn
bcad6e8e9a Make plugin list in PDF docs readable (#9241)
The current PDF docs attempt to format the list of all plugins as a
table, without any word-wrapping of the plugin description. That results
in almost all the information getting cut off. This PR formats the same
information into more of a paragraph format for the PDF, with nothing
cut off.

Fixes #451
2021-10-28 11:31:52 +03:00
Ran Benita
c2ece58aa0 Add legacypath plugin 2021-10-27 09:31:44 +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
3c5c5feb04 Merge pull request #9230 from bluetech/pytester-transitive-public
Export pytester transitive types
2021-10-27 08:05:08 +03:00
Alexander King
14e032088c Change the command for package building in release CI workflow (#9229) 2021-10-25 21:32:12 +03:00
Ran Benita
89f8ff5a6d Merge pull request #9233 from pytest-dev/update-plugin-list/patch-f695e18dd
[automated] Update plugin list
2021-10-25 21:05:55 +03:00
pytest bot
2f0e1cd230 [automated] Update plugin list 2021-10-24 00:11:06 +00:00
Ran Benita
60ca83746b docs: change references to 6.3 -> 7.0
The plans have changed, next version will be 7.0 not 6.3.
2021-10-23 22:49:55 +03:00
Ran Benita
755ce9bc80 hookspec: improve legacy path deprecation docs 2021-10-23 22:49:54 +03:00
Ran Benita
afc7442e22 nodes: inline _imply_path
Only one usage left, and we certainly don't expect more!

Rename `_imply_path_only` to `_imply_path`, that's a less confusing name
now.
2021-10-23 22:10:08 +03:00
Ran Benita
6be3f31dba nodes: remove redundent _imply_path call
The Node ctor will take care of the check.
2021-10-23 21:34:16 +03:00
Ran Benita
853b0a4c29 nodes: fix bug in Node() fspath compat
Since path <-> fspath are converted to each other, we need to check both
before looking at the parent, in case fspath is set but path is not.
2021-10-23 21:33:12 +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
f695e18ddb Merge pull request #9227 from bluetech/config-_cleanup
Use public API for adding config cleanup
2021-10-22 22:50:55 +03:00
Alexander King
005690bd67 Add template for prereleases (#9165)
Fix #8820
2021-10-22 10:00:00 -03:00
Oleg Höfling
1e9e16d829 Replace hardcoded links to PyPI with extlinks (#9224) 2021-10-22 09:47:57 -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
Ran Benita
2af41c5703 Merge pull request #9226 from bluetech/doc-setup-py
doc: modernize discussion of setup.py in "Good Integration Practices"
2021-10-22 11:01:10 +03:00
Ran Benita
7314b32b63 doc: modernize discussion of setup.py in "Good Integration Practices" 2021-10-22 10:24:39 +03:00
Bruno Oliveira
61e506a63f Merge pull request #9223 from nicoddemus/better-filter-warnings-messages 2021-10-21 22:45:00 -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
Bruno Oliveira
4a3834101e Merge pull request #9209 from pytest-dev/update-plugin-list/patch-0696d3eda
[automated] Update plugin list
2021-10-19 06:53:25 -03:00
Bruno Oliveira
20a69e11aa Merge pull request #9214 from nicoddemus/confcutdir-9210 2021-10-19 06:52:52 -03:00
Bruno Oliveira
c000955dde Remove incorrect docs about confcutdir being a config option
Fix #9210
2021-10-18 19:20:27 -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
pytest bot
3cc0c451e7 [automated] Update plugin list 2021-10-17 00:11:56 +00:00
Ran Benita
0696d3eda1 Merge pull request #9207 from bluetech/rm-py-pre
Remove some `py` uses
2021-10-16 22:26:45 +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
Bruno Oliveira
5fc7b21391 Use xelatex engine for better Unicode support (#9197) 2021-10-12 10:12:15 -03:00
pre-commit-ci[bot]
d7752b4d1e [pre-commit.ci] pre-commit autoupdate (#9191)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-10-11 20:09:25 +00: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
James Myatt
ccd3874d7a Recommend not integrating with setuptools (#9185) 2021-10-11 15:28:27 +03: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
github-actions[bot]
4b417ac38e [automated] Update plugin list (#9186)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2021-10-10 12:00:43 -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
e077f1cbd5 Merge pull request #9168 from bluetech/node-keywords-dups
mark/structures: fix NodeKeywords.{__iter__,__len__} given duplicates
2021-10-06 12:01:05 +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
fb52fc5163 Merge pull request #9070 from andrewdotn/main 2021-10-05 16:51:58 -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
d0bdc26490 Merge pull request #9164 from bluetech/optimize-keywords
mark/structures: micro-optimize item.keywords/NodeKeywords
2021-10-05 20:03:42 +03:00
Ran Benita
c4b9b14a44 mark/structures: micro-optimize item.keywords/NodeKeywords 2021-10-05 16:50:22 +03:00
Ran Benita
54811b24e2 Merge pull request #9163 from bluetech/rewrite-end-lineno
rewrite: fixup end_lineno, end_col_offset of rewritten asserts
2021-10-05 16:46:29 +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
Bruno Oliveira
05a97375fd Merge pull request #9162 from pytest-dev/pre-commit-ci-update-config 2021-10-04 18:55:29 -03:00
Zac Hatfield-Dodds
e763fde482 Merge pull request #9158 from hoefling/doc/internal-crossrefs
replace hardcoded urls to docs.pytest.org with internal crossrefs, add crossrefs to numpy docs, use sphinx pep role
2021-10-05 08:43:19 +11:00
pre-commit-ci[bot]
1a8b4343ff [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.28.0 → v2.29.0](https://github.com/asottile/pyupgrade/compare/v2.28.0...v2.29.0)
2021-10-04 19:49:14 +00:00
Ran Benita
483f239d01 Merge pull request #9161 from bluetech/attrs-auto
Use attr.s(auto_attribs=True) in more places
2021-10-04 21:59:52 +03:00
oleg.hoefling
3926526c95 revert changes in doc/en/announce
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-10-04 20:06:13 +02:00
Ronny Pfannschmidt
028eb6fab6 Merge pull request #9115 from RonnyPfannschmidt/fix-regendoc
fix #8818 - run regendoc without tox cachedir
2021-10-04 19:11:45 +02: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
Ran Benita
dced00e60f Merge pull request #9154 from bluetech/refactor-callspec2
python: refactor CallSpec2
2021-10-04 18:56:29 +03:00
Ran Benita
570b1facb7 python: refactor CallSpec2
This type is semi-private; not documented but many plugins access it
through `item.callspec`. However, plugins access the public fields and
almost none try to construct or monkeypatch it. So we should be allowed
to clean it up some.

- Convert to attrs, add slots and frozen

- Instead of doing `new = old.copy(); new.setmulti2()`, do `new =
  old.setmulti()`. This is cleaner and faster.

- Remove the `metafunc` attribute. This causes a reference cycle
  (multifunc._calls -> callspec -> multifunc) for no good reason --
  neither pytest itself or plugins access this attribute, so let's not
  keep the Metafunc objects alive past their due.

- Some comments.

I would have also like to make the dicts and lists themselves immutable,
however some plugins mess with those so that should be done separately,
if at all.
2021-10-04 17:33:52 +03:00
Bruno Oliveira
c4557c3192 Merge pull request #9150 from nicoddemus/issue-9141-fixture-docs 2021-10-04 09:48:19 -03:00
Ran Benita
8a58b0c892 Merge pull request #9155 from pytest-dev/update-plugin-list/patch-0fbfd1ca3
[automated] Update plugin list
2021-10-04 10:46:16 +03:00
Ran Benita
73634ffb49 Merge pull request #9160 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-cov-3.0.0
build(deps): bump pytest-cov from 2.12.1 to 3.0.0 in /testing/plugins_integration
2021-10-04 10:45:21 +03:00
Ronny Pfannschmidt
c21ef7ba22 fix #8818 - run regendoc without tox cachedir
#4270 introduced per tox env pytest cachedirs and
never protected regendoc against it
2021-10-04 08:56:26 +02: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
oleg.hoefling
d58ee2b677 replace hardcoded urls to docs.pytest.org with internal crossrefs, add external crossrefs where possible
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-10-04 00:23:41 +02:00
Ronny Pfannschmidt
35d8c1398c Merge pull request #8134 from RonnyPfannschmidt/setuptools_scm_5
fixes #8133: migrate to setuptools_scm 6.x
2021-10-03 20:46:00 +02:00
pytest bot
618ee0f268 [automated] Update plugin list 2021-10-03 00:11:19 +00:00
Ronny Pfannschmidt
0892c77bc6 fixes #8133: mitigate regendoc issues wrt PRETEND_VERSION
this issues is less likely to hit due to the recent regendoc release
which includes a wheel

* migrate to setuptools_scm 6.3.2
* use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
2021-10-02 20:22:18 +02:00
Ran Benita
0fbfd1ca36 Merge pull request #9152 from bluetech/mark-optimize
mark/structures: slightly optimize some functions
2021-10-02 15:57:57 +03:00
Ran Benita
2cfce8d8c4 Merge pull request #9153 from bluetech/coverage-assert-never
coverage: add assert_never to exclude_lines
2021-10-02 15:56:24 +03:00
Ran Benita
1d0261e5cb coverage: add assert_never to exclude_lines
These are assertions that should never trigger.
2021-10-02 14:26:04 +03:00
Ran Benita
637e8efdd4 mark/structures: slightly optimize some functions
`normalize_mark_list` shows up in pandas collection profiles. It's
simple enough to improve.
2021-10-02 14:06:52 +03:00
Bruno Oliveira
ac3614b999 Add note about fixture teardown and SIGTERM and SIGQUIT signals
Close #9141
2021-10-01 16:12:03 -03:00
Ran Benita
f65dfc39f3 Merge pull request #9123 from pytest-dev/update-plugin-list/patch-112204cf8
[automated] Update plugin list
2021-10-01 16:31:59 +03:00
Ran Benita
8af558723e main: avoid Path(Path(...)) calls, they're slow (#9147) 2021-10-01 16:21:32 +03: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
Ran Benita
d8831c64eb Merge pull request #9148 from bluetech/lru-cache-method
Avoid `@lru_cache` on methods
2021-10-01 16:16:51 +03:00
Ran Benita
3a6eaa9c1c Merge pull request #9145 from bluetech/compat-pattern
compat: replace REGEX_TYPE with typing.Pattern
2021-10-01 16:16:28 +03:00
Ran Benita
c86ceb4d01 main: avoid Path(Path(...)) calls, they're slow 2021-10-01 15:30:03 +03:00
Ran Benita
16e5fbe371 config: optimize PytestPluginManager._getconftestmodules
Now that it's no longer using `@lru_cache`, use another check to avoid
re-computation. Although `@lru_cache` is faster than the full function
call + checks, this approach also has the advantage that the caching
works for more than 128 entries.
2021-10-01 15:25:28 +03:00
Ran Benita
614f5394b5 Avoid @lru_cache on methods
The problem with `@lru_cache` on methods is that it also captures `self`
and leaks it until the entry is evicted (if ever).
2021-10-01 14:41:14 +03:00
Ran Benita
1f938e3ef5 compat: replace REGEX_TYPE with typing.Pattern
Since Python 3.7, there is `re.Pattern` for this, but since we need to
support Python 3.6, can use `typing.Pattern` which works as well.
2021-10-01 14:00:15 +03:00
Ran Benita
631c8b4df2 Merge pull request #9143 from bluetech/docs-stash-typo
Fix syntax typo in writing_hook_functions.rst
2021-10-01 11:38:15 +03:00
Ran Benita
4b13b5993e Fix syntax typo in writing_hook_functions.rst 2021-10-01 10:26:56 +03:00
Brian Okken
6d6cfd839a Add a deselected parameter to assert_outcomes() 2021-09-29 07:22:53 -07:00
Bruno Oliveira
7720154ca0 Merge pull request #9129 from nicoddemus/fix-linting-main
Fix formatting
2021-09-27 23:46:18 -03:00
Bruno Oliveira
7f5e49e70b Fix formatting 2021-09-27 22:51:08 -03:00
Bruno Oliveira
dd6d4b2fe0 Merge pull request #9128 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-09-27 20:37:57 -03:00
pre-commit-ci[bot]
56fda99fa1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-09-27 19:47:18 +00:00
pre-commit-ci[bot]
70858ac266 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.26.0 → v2.28.0](https://github.com/asottile/pyupgrade/compare/v2.26.0...v2.28.0)
2021-09-27 19:44:12 +00: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
Bruno Oliveira
bbd5d55e98 Merge pull request #9126 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.3.2
build(deps): bump anyio[curio,trio] from 3.3.1 to 3.3.2 in /testing/plugins_integration
2021-09-27 08:12:57 -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
pytest bot
4a016db7b4 [automated] Update plugin list 2021-09-26 00:11:24 +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
Ran Benita
037d2903be Merge pull request #9112 from bluetech/plugin-list-escape
scripts/update-plugin-list: escape summary for special RST chars
2021-09-22 17:00:07 +03:00
pre-commit-ci[bot]
24b347507a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-09-22 13:41:33 +00:00
Ran Benita
4ae4bec968 scripts/update-plugin-list: escape summary for special RST chars
A new plugin has this summary:

    Continiously runs pytest on changes in *.py files

The `*` is interpreted as a special character and fails the CI.

Add some rudimentary escaping to hopefully prevent this.
2021-09-22 16:39:15 +03:00
Bruno Oliveira
bec42f7b0b Merge pull request #9092 from nicoddemus/cleanup-projects-page 2021-09-22 10:28:45 -03:00
Ran Benita
3f404418bf Merge pull request #9088 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.3.1
build(deps): bump anyio[curio,trio] from 3.3.0 to 3.3.1 in /testing/plugins_integration
2021-09-22 15:56:28 +03:00
Ran Benita
cf5b7a0958 Merge pull request #9103 from pytest-dev/update-plugin-list/patch-60e995d90
[automated] Update plugin list
2021-09-22 15:55:49 +03:00
Bruno Oliveira
f50652a5d2 Merge pull request #9111 from ziebam/iss4320-better-docs-for-testdir-copy-example 2021-09-22 07:51:42 -03:00
ziebam
70a3c965ea Add myself to AUTHORS file 2021-09-22 00:23:13 +02:00
ziebam
6ea762c46c Add a changelog entry 2021-09-22 00:22:37 +02:00
ziebam
520aa61e19 Improve docs for pytester.copy_example 2021-09-22 00:16:52 +02:00
Bruno Oliveira
fe44409cf6 Merge pull request #9107 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-09-20 21:28:03 -03:00
pre-commit-ci[bot]
43c0687a77 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.8b0 → 21.9b0](https://github.com/psf/black/compare/21.8b0...21.9b0)
2021-09-20 20:00:19 +00:00
pytest bot
86fc02bfcb [automated] Update plugin list 2021-09-19 00:10:14 +00:00
Bruno Oliveira
c761c45cf9 Remove obsolete projects page from docs
The projects page unfortunately contains a lot of old projects, and some information there appears to be stale.

It was created at a time pytest was starting to be used, but seems pointless now as pytest is the most popular testing framework, so listing a few dozen projects which use it seems pointless.

Rather than updating it, I think we should remove it because this has the chance to become stale again soon, and not sure how valuable it is anyway.
2021-09-14 08:04:49 -03:00
Bruno Oliveira
60e995d902 Merge pull request #9091 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-09-13 18:48:26 -03:00
pre-commit-ci[bot]
3867b681cd [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.25.0 → v2.26.0](https://github.com/asottile/pyupgrade/compare/v2.25.0...v2.26.0)
2021-09-13 19:40:27 +00: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
Simon K
0e7bb34081 adding contact and badge for pytest-dev discord server (#9078)
* adding badges/docs for pytest-dev discord and pytest libera web chat
2021-09-12 18:22:44 +01:00
Bruno Oliveira
4e916ce347 Merge pull request #9086 from pytest-dev/update-plugin-list/patch-581b021aa
[automated] Update plugin list
2021-09-11 22:46:19 -03:00
pytest bot
0407c62121 [automated] Update plugin list 2021-09-12 00:11:27 +00:00
Bruno Oliveira
581b021aa2 Merge pull request #9084 from The-Compiler/remove-workshoptage
Remove finished open training
2021-09-10 08:26:21 -03:00
Florian Bruhin
1c1dcf27c8 Remove finished open training 2021-09-09 22:29:34 +02:00
Zac Hatfield-Dodds
8900e3b937 Merge pull request #9041 from hoefling/doc/stdlib-crossrefs 2021-09-07 21:22:24 +10: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
Bruno Oliveira
9d0829f150 Merge pull request #9075 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-twisted-1.13.4
build(deps): bump pytest-twisted from 1.13.3 to 1.13.4 in /testing/plugins_integration
2021-09-06 11:13:00 -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
Bruno Oliveira
01d046ecb3 Merge pull request #9073 from pytest-dev/update-plugin-list/patch-20863c3a0
[automated] Update plugin list
2021-09-05 12:32:19 -03:00
pytest bot
1f00461e57 [automated] Update plugin list 2021-09-05 00:09:51 +00:00
Andrew Neitsch
a9edfdf9db Run black on conf.py 2021-09-02 20:42:29 -06:00
Andrew Neitsch
b46d5f4657 Only use inkscapeconverter if inkscape installed 2021-09-02 20:40:17 -06:00
Andrew Neitsch
e929d15848 Include figures in PDF docs
The PDF documentation on readthedocs was missing the figures in the
fixtures reference chapter. This PR uses a Sphinx plugin that
automatically converts the checked-in SVG files to the PDF input files
that LaTeX requires.

The SVG-to-PDF conversion is done by inkscape, which gave the best
conversion among the tools I tried. However, it [does not yet
understand][href-bug] that you can write a plain `href` instead of
`xlink:href` in svg files, so I’ve had to edit the SVG files
accordingly.

[href-bug]: https://github.com/TeX-Live/luatex.git
2021-09-02 17:40:41 -06:00
Emmanuel Arias
dc9192c8eb add changelog file 2021-09-02 00:14:19 -03: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
Bruno Oliveira
20863c3a0c Merge pull request #9065 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-08-30 16:49:04 -03:00
pre-commit-ci[bot]
7bcdcc0239 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.7b0 → 21.8b0](https://github.com/psf/black/compare/21.7b0...21.8b0)
- [github.com/asottile/blacken-docs: v1.10.0 → v1.11.0](https://github.com/asottile/blacken-docs/compare/v1.10.0...v1.11.0)
- [github.com/asottile/pyupgrade: v2.24.0 → v2.25.0](https://github.com/asottile/pyupgrade/compare/v2.24.0...v2.25.0)
2021-08-30 19:25:44 +00: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
Bruno Oliveira
771c4b9313 Merge pull request #9063 from nicoddemus/cherry-pick-release
Merge pull request #9057 from pytest-dev/release-6.2.5
2021-08-30 15:13:58 -03:00
Bruno Oliveira
ea5ff44ef3 Merge pull request #9057 from pytest-dev/release-6.2.5
(cherry picked from commit 16664a1b72)
2021-08-30 14:44:49 -03:00
Bruno Oliveira
014fa61e0d Merge pull request #9053 from nicoddemus/change-8494-to-trivial 2021-08-29 10:52:01 -03:00
Bruno Oliveira
d023e6344a Merge pull request #9055 from pytest-dev/update-plugin-list/patch-398783521
[automated] Update plugin list
2021-08-29 00:35:42 -03:00
pytest bot
544ecce677 [automated] Update plugin list 2021-08-29 00:09:53 +00:00
Bruno Oliveira
14709f33af As discussed in Discord, move 3.10 changelog to trivial
This was backported to `6.2.x`, but we agreed this should
actually a trivial change and go into `6.2.5`, instead of a new `6.3.0`.
2021-08-28 11:59:53 -03:00
Bruno Oliveira
3987835213 Merge pull request #9049 from nicoddemus/prerelease-option
Fix prepare-release-pr invocation with empty --prerelease argument
2021-08-27 14:47:58 -03:00
Bruno Oliveira
675f8da3a1 Fix prepare-release-pr invocation with empty --prerelease argument 2021-08-27 14:46:28 -03:00
Bruno Oliveira
3c0510894b Merge pull request #9048 from nicoddemus/prerelease-option
'prerelease' input is not required in prepare-release-pr workflow
2021-08-27 14:40:11 -03:00
Bruno Oliveira
9501e54852 'prerelease' input is not required in prepare-release-pr workflow
The default is the correct value when generating a normal release.
2021-08-27 14:26:30 -03:00
Bruno Oliveira
b6aba1d58d Merge pull request #9047 from nicoddemus/changelog-9040
Add changelog for #9040 (pluggy 1.0)
2021-08-27 14:23:49 -03:00
Bruno Oliveira
44ba2fa372 Add changelog for #9040 (pluggy 1.0) 2021-08-27 14:09:21 -03:00
oleg.hoefling
d1aea7d7a8 use intersphinx crossrefs to stdlib docs where possible instead of hardcoded URLs
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-08-26 16:05:03 +02:00
Bruno Oliveira
41dc9bbc44 Merge pull request #9040 from nicoddemus/bump-pluggy 2021-08-26 10:14:27 -03:00
Bruno Oliveira
109bc2649d Adapt docs references to use pluggy 1.0
Also use the intersphinx reference instead of the class directly.
2021-08-26 09:52:05 -03:00
Bruno Oliveira
fbba504cd5 Allow pluggy >=1.0
Now that pluggy 1.0 has been released, we can allow pluggy 1.0 with new pytest versions.
2021-08-26 09:26:51 -03:00
Bruno Oliveira
1a2306cec6 Merge pull request #9033 from kulikjak/fix-cwd-removal-Solaris
Fix cwd removal on Solaris
2021-08-24 10:39:37 -03:00
Bruno Oliveira
78d21dc836 Merge pull request #9034 from williamjamir/williamjamir-patch-1
Fix typo in fixture.rst
2021-08-24 10:38:50 -03:00
William Jamir Silva
696bf96c83 Fix typo in fixture.rst 2021-08-24 09:32:40 -03:00
Bruno Oliveira
59189ebeb5 Merge pull request #9029 from pytest-dev/update-plugin-list/patch-83b609d7f
[automated] Update plugin list
2021-08-24 08:04:29 -03:00
Jakub Kulík
e146aaa2e2 Fix cwd removal on Solaris 2021-08-24 12:11:06 +02:00
Anthony Sottile
ebe5e451d1 Merge pull request #9031 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-08-23 15:27:47 -04:00
pre-commit-ci[bot]
e8aa395346 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.23.3 → v2.24.0](https://github.com/asottile/pyupgrade/compare/v2.23.3...v2.24.0)
2021-08-23 18:58:43 +00:00
pytest bot
1b130d4404 [automated] Update plugin list 2021-08-22 00:09:13 +00:00
Bruno Oliveira
83b609d7f7 Merge pull request #9028 from Exifers/patch-1
Fix typo in documentation
2021-08-21 11:49:11 -03:00
Emmanuel Meric de Bellefon
ec2099e057 Update index.rst 2021-08-21 11:11:37 +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
Florian Bruhin
c9870480e0 doc: Update trainings (#9022) 2021-08-19 18:40:19 +02:00
David Szotten
2367e6e9bf refactor ci helper to prepare for re-use 2021-08-19 11:24:51 +00:00
Bruno Oliveira
16077f2a65 Merge pull request #9017 from hugovk/update-deprecated-unittest-aliases 2021-08-18 08:11:50 -03:00
Hugo van Kemenade
5ec89fd6e5 Docs: refer to non-deprecated unittest alias 2021-08-18 12:43:59 +03:00
Anthony Sottile
720b91df2e Merge pull request #8995 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-08-17 14:36:42 -04:00
Bruno Oliveira
0f79fc6dbb Merge pull request #8752 from azmeuk/issue-7132-syntax-highlight-themes 2021-08-15 09:06:41 -03:00
Bruno Oliveira
36ed2f7d90 Merge pull request #9006 from pytest-dev/update-plugin-list/patch-243972941
[automated] Update plugin list
2021-08-15 09:04:32 -03:00
pytest bot
1cbb67f71b [automated] Update plugin list 2021-08-15 00:09:52 +00:00
Éloi Rivard
7770dacb8d pygments themes are customizable 2021-08-13 19:15:01 +02:00
pre-commit-ci[bot]
108f1d7e5e [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.23.1 → v2.23.3](https://github.com/asottile/pyupgrade/compare/v2.23.1...v2.23.3)
2021-08-09 18:53:50 +00:00
Terje Runde
2439729413 logging: Make it possible to add cli colors to custom log levels
Closes #8803
PR #8804

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Terje Runde <terje.runde@flir.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-08-09 13:48:47 +00:00
Ran Benita
df033f3ab1 Merge pull request #8987 from bluetech/k-backslash
mark/expression: allow backslash characters in identifiers
2021-08-08 17:15:53 +03:00
Ran Benita
25c65616f4 mark/expression: allow backslash characters in identifiers
Fixes #8983.
2021-08-08 11:56:17 +03:00
Bruno Oliveira
a446ee81fd Merge pull request #8985 from pytest-dev/update-plugin-list/patch-bacc8498e
[automated] Update plugin list
2021-08-08 01:43:27 -03:00
pytest bot
4d2944e1d4 [automated] Update plugin list 2021-08-08 00:10:10 +00:00
Simon K
bacc8498e9 pytest_assertion_pass is no longer considered experimental (#8967)
* `pytest_assertion_pass` is no longer considered `experimental`

* adding changelog
2021-08-03 14:31:18 +01:00
Bruno Oliveira
599e3dfdb6 Merge pull request #8970 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-08-02 21:06:34 -03:00
pre-commit-ci[bot]
b33c81b57f [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.23.0 → v2.23.1](https://github.com/asottile/pyupgrade/compare/v2.23.0...v2.23.1)
2021-08-02 18:53:11 +00:00
Bruno Oliveira
bacb8a4a56 Merge pull request #8968 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-21.7.0 2021-08-02 10:19:40 -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
e7916c4f4e [automated] Update plugin list (#8965)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2021-08-01 15:06:40 -03:00
Bruno Oliveira
a83b359cf0 Refactor internal scope handling by introducing Scope enum
PR #8913
2021-08-01 06:11:56 -03:00
pytest bot
fed18fb76d [automated] Update plugin list 2021-08-01 00:10:10 +00: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
Bruno Oliveira
0fd0e2a27c Merge pull request #8963 from symonk/mypy-pathlike-runtime-checkable-fix
typeshed `os.PathLike` is now `@runtime_checkable`, remove mypy ignore
2021-07-31 10:27:58 -03:00
Emmanuel Arias
2834b39b65 Add examples of parametrizing classes and all tests in a module
Closes #8947

PR #8962
2021-07-31 13:26:25 +00:00
symonk
1b9ba65b3f typeshed os.PathLike is now @runtime_checkable, remove mypy ignore 2021-07-31 14:00:36 +01: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
Bruno Oliveira
60d9891474 Fix small typo in pluggy writing hook functions docs (#8961)
Fix small typo in pluggy writing hook functions docs
2021-07-30 22:27:01 -03:00
symonk
a9a934e8ce fix minor typo in writing hook functions documentation 2021-07-31 01:49:53 +01: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
6a1ba80ab7 Merge pull request #8946 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-07-27 07:57:03 -03:00
Bruno Oliveira
df6d3b7dde Fix Dead link in README for 'assert statements' (#8945)
Closes: #8926
2021-07-27 07:56:19 -03:00
pre-commit-ci[bot]
237bdba061 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/reorder_python_imports: v2.5.0 → v2.6.0](https://github.com/asottile/reorder_python_imports/compare/v2.5.0...v2.6.0)
- [github.com/asottile/pyupgrade: v2.21.2 → v2.23.0](https://github.com/asottile/pyupgrade/compare/v2.21.2...v2.23.0)
2021-07-26 18:05:01 +00:00
Emmanuel Arias
15989ddc8f Fix Dead link in README for 'assert statements'
Closes: #8926
2021-07-26 12:14:52 -03:00
Simon K
1d848314d0 some small quality of life changes (#8454)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-07-26 07:48:15 -03: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
Bruno Oliveira
4cc2781ad8 Merge pull request #8943 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.3.0
build(deps): bump anyio[curio,trio] from 3.2.1 to 3.3.0 in /testing/plugins_integration
2021-07-26 06:57:51 -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
9c9d79890d Merge pull request #8941 from pytest-dev/update-plugin-list/patch-305e15df9
[automated] Update plugin list
2021-07-25 12:28:03 +03:00
pytest bot
8b5b3575a0 [automated] Update plugin list 2021-07-25 00:08:36 +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
c6bdeb8491 stash: make Stash and StashKey public
It's had enough time to bake - let's allow external plugins to use it.
2021-07-24 17:40:08 +03:00
Ran Benita
305e15df97 Merge pull request #8937 from nicoddemus/port-8932
contact.rst: Added github discussions
2021-07-24 11:32:07 +03:00
Bruno Oliveira
5e39f43e7c contact.rst: Added github discussions
Ported from #8932
2021-07-23 09:40:11 -03:00
Ronny Pfannschmidt
bd09b79236 Merge pull request #8922 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-07-20 10:42:38 +02:00
pre-commit-ci[bot]
53357f464c [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.6b0 → 21.7b0](https://github.com/psf/black/compare/21.6b0...21.7b0)
- [github.com/asottile/pyupgrade: v2.21.0 → v2.21.2](https://github.com/asottile/pyupgrade/compare/v2.21.0...v2.21.2)
2021-07-19 22:13:39 +00:00
Ran Benita
7ff07ff3e1 Merge pull request #8919 from pytest-dev/update-plugin-list/patch-940c6e233
[automated] Update plugin list
2021-07-18 16:13:14 +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
pytest bot
0a1f58a912 [automated] Update plugin list 2021-07-18 00:08:39 +00:00
Bruno Oliveira
940c6e2337 Merge pull request #8904 from nicoddemus/types-atomicwrites
Add types-atomicwrites to mypy's pre-commit configuration
2021-07-15 12:35:51 -03:00
Thomas Grainger
388691a205 rename tmpdir.rst to tmp_path.rst (#8905) 2021-07-14 12:53: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
d71d31c1e0 Merge pull request #8812 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-07-13 08:31:32 -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
b88ee5bc55 Add types-atomicwrites to mypy's pre-commit configuration
This is a Windows only dependency, so the problem only shows up when trying to commit on Windows.
2021-07-13 08:27:35 -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
Ronny Pfannschmidt
d0bd269b87 Merge pull request #8899 from gsmecher/parameterize-complex-numbers
Generate useful parameterization IDs for complex() numbers.
2021-07-13 07:03:37 +02:00
pre-commit-ci[bot]
7d1efd5c3a [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.19.4 → v2.21.0](https://github.com/asottile/pyupgrade/compare/v2.19.4...v2.21.0)
- [github.com/pre-commit/mirrors-mypy: v0.902 → v0.910](https://github.com/pre-commit/mirrors-mypy/compare/v0.902...v0.910)
2021-07-12 23:27:47 +00:00
Bruno Oliveira
3c18a9ecd0 Rename 8898.trivial.rst to 8898.improvement.rst 2021-07-12 18:09:13 -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
Bruno Oliveira
4a6acea1e3 Merge pull request #8888 from pytest-dev/update-plugin-list/patch-5d8392cb6
[automated] Update plugin list
2021-07-12 10:16:40 -03:00
pytest bot
b6648219ec [automated] Update plugin list 2021-07-11 00:08:26 +00:00
Anthony Sottile
5d8392cb68 Merge pull request #8874 from adamjstewart/monkeypatch/setenv
Docs: monkeypatch.setenv does not accept bool
2021-07-09 11:38:25 -04:00
Anthony Sottile
0182eb3743 Merge pull request #8881 from pytest-dev/asottile-patch-1
Remove upper pinning on tomli
2021-07-09 10:27:58 -04:00
Anthony Sottile
fa42be77a6 Remove upper pinning on tomli
the best practice is to only `<` when you know something is broken, and even then prefer `!=` assuming it will be fixed upstream for maximum compatibility
2021-07-09 10:09:05 -04:00
Bruno Oliveira
e86bf7fda0 Merge pull request #8857 from hukkin/tomli
Support TOML v1.0.0 syntax in `pyproject.toml`
2021-07-09 11:05:46 -03:00
Adam J. Stewart
17f1a0af8e Fix in more places, use default 2021-07-08 12:43:10 -05:00
Adam J. Stewart
3989a9bb05 Docs: monkeypatch.setenv does not accept bool 2021-07-08 12:21:30 -05:00
Sören Wegener
6740fb9da6 doc: Typofix in fixtures how-to (#8860) 2021-07-06 14:31:21 +00:00
Taneli Hukkinen
5987251407 Add a test for invalid TOML file 2021-07-06 16:53:32 +03:00
Taneli Hukkinen
40797dee87 Make news indicate that a dependency changed 2021-07-06 13:14:45 +03:00
Taneli Hukkinen
e1a4b4edd2 Convert TOMLDecodeError to UsageError 2021-07-06 13:10:44 +03:00
pre-commit-ci[bot]
51f645e567 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-07-06 07:18:57 +00: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
Eric Liu
8c25a14032 closes #8824 Changelog rewording for 7.0 (#8826)
* fixed changelog/*.rst docs

* add author name

* fixed-documents

* fix issue 8761 doc

* fix issue 8645 doc

* fix issue 8447 doc

* [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-07-03 12:20:12 +02:00
ericluoliu
501637547e Issue #8823 - remove bots from contributors list (#8828)
* fix-contributors-list

* remove-bots

* delete-extraneous-file

* [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-06-30 13:53:32 +00:00
Srip
9cdb7223b5 doc: Adding the missing sys import (#8819) (#8827)
Co-authored-by: Sripradha Karkala <sripradha.karkala@nutanix.com>
2021-06-30 08:11:20 +02:00
Bruno Oliveira
1d67553403 Merge pull request #8247 from nicoddemus/version-stdout-8246 2021-06-28 16:13:31 -03:00
Florian Bruhin
4d965557e2 ci: Persist git credentials for prepare-release-pr (#8813)
See #8599, follow-up to #8681
2021-06-28 20:58:55 +02:00
Bruno Oliveira
109312ba86 Make --version write to stdout rather than stderr
Fix #8246
2021-06-28 15:56:26 -03:00
Bruno Oliveira
2623ee2e0e Merge pull request #8802 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.2.1
Bump anyio[curio,trio] from 3.2.0 to 3.2.1 in /testing/plugins_integration
2021-06-28 15:37:01 -03:00
Florian Bruhin
ba1ad7d517 Opt-out from regendoc for problematic example (#8810)
* Opt-out from regendoc for problematic example

See #8807

* Add comment
2021-06-28 17:47:49 +00:00
Florian Bruhin
c4c3b6d4fd Adjust fixme comments (#8811) 2021-06-28 17:41:22 +00:00
Florian Bruhin
e729e0d1e6 scripts: Don't capture output in prepare-release-pr.py (#8805)
We don't need to access the output in the script, and if we capture it,
we don't get any output on CI, so no way to see why a release failed.
2021-06-28 12:15:25 +00:00
Florian Bruhin
c19f63d39d Adjust releasing infra/docs (#8795)
* Adjust releasing infra/docs

Follow-up for #8150, see #7507

* Add suggestions
2021-06-28 12:24:48 +02: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
Srip
6573107b97 doc: Adding exit code for pytest usage examples (#8790) (#8800)
* doc: Adding exit code for pytest usage examples (#8790)

Fix #8790 

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Sripradha Karkala <sripradha.karkala@nutanix.com>
2021-06-27 13:29:16 +00:00
Bruno Oliveira
ef395e1c38 Merge pull request #8799 from pytest-dev/update-plugin-list/patch-cb1dba048
[automated] Update plugin list
2021-06-27 00:17:59 -03:00
pytest bot
f0e5640497 [automated] Update plugin list 2021-06-27 00:08:04 +00:00
Florian Bruhin
cb1dba0489 doc: Add new open trainings (#8793) 2021-06-24 20:21:22 +02:00
Bruno Oliveira
0d6cb3b281 Allow prereleases from prepare-release workflow (#8628)
Fix #7551
2021-06-24 18:05:56 +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
James Bourbeau
942789bace Fix API links in 'How to capture warnings' documentation page (#8792) 2021-06-23 19:34:48 +00: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
e44300de7e doc: Add history page (#8784)
Based on #8667
2021-06-23 20:26:08 +02:00
Ronny Pfannschmidt
8eb8c42bd6 Merge pull request #8786 from The-Compiler/outside
tests: Use less conflicting name for directory
2021-06-22 21:59:52 +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
Bruno Oliveira
0a6a1fa225 Merge pull request #8782 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.2.0
Bump anyio[curio,trio] from 3.1.0 to 3.2.0 in /testing/plugins_integration
2021-06-21 07:41:15 -03: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
68b329dda8 Merge pull request #8764 from pytest-dev/pre-commit-ci-update-config 2021-06-20 12:27:03 -03:00
Anthony Sottile
ab3cd644dc add temporary ignore for FileHandler stream close 2021-06-20 08:09:18 -07:00
Anthony Sottile
a1967e9594 fix overload of __getitem__ for Traceback 2021-06-19 21:41:00 -07:00
Anthony Sottile
c4da6fff42 Add missing types-* stub packages 2021-06-19 21:31:17 -07:00
pre-commit-ci[bot]
605fe29d12 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.5b2 → 21.6b0](https://github.com/psf/black/compare/21.5b2...21.6b0)
- [github.com/asottile/pyupgrade: v2.19.1 → v2.19.4](https://github.com/asottile/pyupgrade/compare/v2.19.1...v2.19.4)
- [github.com/pre-commit/pygrep-hooks: v1.8.0 → v1.9.0](https://github.com/pre-commit/pygrep-hooks/compare/v1.8.0...v1.9.0)
- [github.com/pre-commit/mirrors-mypy: v0.812 → v0.902](https://github.com/pre-commit/mirrors-mypy/compare/v0.812...v0.902)
2021-06-14 17:42:33 +00:00
Bruno Oliveira
ced125ad15 Merge pull request #8761 from nicoddemus/version-tuple 2021-06-14 09:27:22 -03: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
6447ca5f1e Merge pull request #8756 from pytest-dev/update-plugin-list/patch-c675d8054
[automated] Update plugin list
2021-06-13 00:56:20 -03:00
pytest bot
5ea541d415 [automated] Update plugin list 2021-06-13 00:10:04 +00:00
Bruno Oliveira
c675d8054d Merge pull request #8754 from nicoddemus/fix-deprecation-docs 2021-06-12 12:52:29 -03:00
Bruno Oliveira
16685dc279 Change os.getuid() guard in tmpdir.py
This matches the guard used by typeshed and avoid mypy errors on Windows:

48a346920b/stdlib/os/__init__.pyi (L388)
2021-06-12 12:31:58 -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
Bruno Oliveira
fb7e36b2f7 Merge pull request #8735 from pytest-dev/update-plugin-list/patch-8300b266a
[automated] Update plugin list
2021-06-12 10:49:02 -03:00
Anthony Sottile
c94766a580 Merge pull request #8738 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.4.0
Bump pytest-django from 4.3.0 to 4.4.0 in /testing/plugins_integration
2021-06-10 17:42:34 -07: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
Anthony Sottile
5a9139c5ec Merge pull request #8739 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-cov-2.12.1
Bump pytest-cov from 2.12.0 to 2.12.1 in /testing/plugins_integration
2021-06-10 17:17:18 -07: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
Anthony Sottile
657e35618f Merge pull request #8737 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2.4
Bump django from 3.2.3 to 3.2.4 in /testing/plugins_integration
2021-06-10 16:09:40 -07:00
Bruno Oliveira
8010fb9f40 Merge pull request #8749 from beniwohli/fix-at-level-type-hints
updated type hints for caplog.at_level to match caplog.set_level
2021-06-10 19:33:35 -03:00
Benjamin Wohlwend
58036d463d updated type hints for caplog.at_level to match caplog.set_level
The underlying logging API accepts the log level both as int and
as string.
2021-06-10 09:34:54 +02:00
Bruno Oliveira
992eabc29e Merge pull request #8747 from asottile/typo-fix
Fix typo in fixture.rst
2021-06-09 19:54:23 -03:00
Jason Haugen
479209bde1 Fix typo in fixture.rst
Example referenced the wrong function name
2021-06-09 15:13:48 -07:00
Bruno Oliveira
68bb0db808 Merge pull request #8742 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-06-09 17:23:14 -03:00
pre-commit-ci[bot]
595b7e894c [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.19.0 → v2.19.1](https://github.com/asottile/pyupgrade/compare/v2.19.0...v2.19.1)
2021-06-08 01:55:19 +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
pytest bot
50b166ff0b [automated] Update plugin list 2021-06-06 00:17:08 +00:00
Bruno Oliveira
8300b266a8 Merge pull request #8732 from domdfcoding/patch-1
Fix typo (setupttools -> setuptools)
2021-06-05 15:10:24 -03:00
Dominic Davis-Foster
7fb5a9d033 Fix typo (setupttools -> setuptools) 2021-06-05 16:03:59 +01:00
Anthony Sottile
bb9683deea Merge pull request #8729 from asottile/revert-traceback-frame
Revert "Merge pull request #8227 from encukou/defensive-get_source"
2021-06-03 12:46:53 -07:00
Anthony Sottile
77235e2759 Revert "Merge pull request #8227 from encukou/defensive-get_source"
This reverts commit 67af623d9e, reversing
changes made to aead41e449.
2021-06-03 08:45:57 -07:00
Florian Bruhin
9ad726a9a0 Switch to irc.libera.chat (#8722) 2021-06-01 17:34:29 +02:00
Bruno Oliveira
cde6920e49 Merge pull request #8719 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-05-31 16:34:45 -03:00
pre-commit-ci[bot]
c51520ab2a [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.5b1 → 21.5b2](https://github.com/psf/black/compare/21.5b1...21.5b2)
- [github.com/asottile/pyupgrade: v2.18.2 → v2.19.0](https://github.com/asottile/pyupgrade/compare/v2.18.2...v2.19.0)
2021-05-31 17:32:52 +00:00
Bruno Oliveira
360ce686f1 Merge pull request #8713 from pytest-dev/update-plugin-list/patch-43faea832
[automated] Update plugin list
2021-05-31 10:54:38 -03:00
Bruno Oliveira
7ce69347ce Merge pull request #8717 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-rerunfailures-10.0
Bump pytest-rerunfailures from 9.1.1 to 10.0 in /testing/plugins_integration
2021-05-31 09:30:19 -03:00
Bruno Oliveira
788d8785ce Merge pull request #8718 from dlax/docs/tmpdir_factory
Fix a typo in documentation about tmpdir_factory
2021-05-31 09:22:26 -03:00
Denis Laxalde
cf7425d22b Fix a typo in documentation about tmpdir_factory
The section refers to tmpdir_factory, but the sentence mentionned
tmp_path_factory.
2021-05-31 09:36:18 +02: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
pytest bot
4b7d8b2edd [automated] Update plugin list 2021-05-30 00:23:19 +00:00
Bruno Oliveira
43faea832d Merge pull request #8704 from offbyone/doc-getting-started-test-instance
Make the test class instance behaviour clearer
2021-05-26 18:42:37 -03:00
Bruno Oliveira
798bca4076 Merge pull request #8705 from MapleCCC/main
Fix cyclic links in goodpractices.rst
2021-05-26 18:41:13 -03:00
MapleCCC
627b446252 Fix cyclic links in goodpractices.rst 2021-05-27 04:33:49 +08:00
Chris Rose
640b2c0e13 Make the test class instance behaviour clearer
In the "Getting Started" doc, the test class instance example for
instance sharing doesn't actually demonstrate anything about the
reinstantiation of the class. This change shows clearly how the instance
data isn't retained between test runs.
2021-05-26 09:12:29 -07:00
Florian Bruhin
1d5ee4dd7c doc: Remove training sidebar (#8701) 2021-05-26 14:15:00 +02:00
Ran Benita
1ba5b48565 Merge pull request #8697 from bluetech/expose-config
config: expose Config and PytestPluginManager for typing purposes
2021-05-26 11:20:42 +03: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
Ran Benita
ef9d01826a Merge pull request #8693 from pytest-dev/update-plugin-list/patch-c198a7a67
[automated] Update plugin list
2021-05-24 19:14:03 +03:00
Ran Benita
847d8f42ea Merge pull request #8696 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.1.0
Bump anyio[curio,trio] from 3.0.1 to 3.1.0 in /testing/plugins_integration
2021-05-24 19:13:20 +03:00
Ran Benita
e6ed28f0e7 Merge pull request #8694 from bluetech/rec-eval-wrapper
code: remove unneeded comparison eval wrapper
2021-05-24 19:12:56 +03:00
Ran Benita
9719237fe6 doc: refer to type by its public name 2021-05-24 12:31:28 +03:00
Ran Benita
c0d525e44c config: expose PytestPluginManager for typing purposes
This type is used in hooks and transitively through `Config`.
2021-05-24 12:27:07 +03:00
Ran Benita
88d84a5791 config: expose Config for typing purposes
This type is used in hooks and fixtures.

The constructor is publicly documented so is not marked private.
2021-05-24 12:26:22 +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
Ran Benita
c90fdc684b code: remove unneeded comparison eval wrapper
Given a `RecursionError` traceback, the `Traceback.recursionindex()`
method returns the index of the frame which started the recursion
(repeated set of frames). To do so it attempts to check whether two
frames are equivalent. Just checking the function/line is not enough
because the recursion variable(s) might differ (e.g. imagine the numeric
value in a recursive factorial implementation). So it also compares the
`f_locals` (local variables) of each frame for equivalence.

For some reason, the locals comparison is wrapped in an `eval` whose
purpose is to evaluate the comparison in one of the compared frame's
context (locals + globals in scope). However, I can not think of any way
in which the global scope could affect the evaluation. It would have an
affect when the locals are bound but that's already done. So this seems
unnecessary - remove it.
2021-05-23 20:59:38 +03:00
pytest bot
11538e35e4 [automated] Update plugin list 2021-05-23 00:12:33 +00:00
Zac Hatfield-Dodds
c198a7a67e Merge pull request #8677 from olgarithms/warns-no-arg-catches-any 2021-05-19 17:47:39 +10:00
Ran Benita
ff6d29717c Merge pull request #8681 from bluetech/ci-permissions
ci: few security/permissions improvements
2021-05-18 22:21:25 +03:00
Ran Benita
864a2bc0a3 ci: use GitHub Actions token instead of chatops/release_notes secrets
It seems more secure to use the controlled & limited token than an
ambient secret.
2021-05-18 16:05:14 +03:00
Ran Benita
6bc6ec323a ci: reduce workflow permissions
Decrease security exposure by restricting what the code executing in the
actions is allowed to do (in terms of GitHub operations).
2021-05-18 16:05:14 +03:00
Ran Benita
e2567a680e scripts: improve upload-coverage.sh
Mostly, verify the bash uploader hash and make it more strict and
verbose.
2021-05-18 16:05:14 +03:00
Anthony Sottile
d52cd08757 Merge pull request #8687 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-05-17 22:11:31 -07:00
pre-commit-ci[bot]
249c5b37dd [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v3.4.0 → v4.0.1](https://github.com/pre-commit/pre-commit-hooks/compare/v3.4.0...v4.0.1)
- [github.com/asottile/pyupgrade: v2.15.0 → v2.16.0](https://github.com/asottile/pyupgrade/compare/v2.15.0...v2.16.0)
2021-05-17 17:29:57 +00:00
Bruno Oliveira
0d502328ea Merge pull request #8653 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.6.1 2021-05-17 08:21:42 -03: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
Bruno Oliveira
88944bec6a Merge pull request #8684 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.3.0
Bump pytest-django from 4.2.0 to 4.3.0 in /testing/plugins_integration
2021-05-17 07:52:55 -03: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
Bruno Oliveira
e59d0c461b Merge pull request #8682 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-cov-2.12.0
Bump pytest-cov from 2.11.1 to 2.12.0 in /testing/plugins_integration
2021-05-17 07:51:24 -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
2414d23c78 Remove default arg from overloaded warns 2021-05-16 13:44:56 +01:00
Olga Matoula
24ad886b15 Remove the option to pass None in warns() 2021-05-16 12:10:32 +01:00
Olga Matoula
dbe66d97b4 Add better warning msg for deprecated warns(None) 2021-05-16 12:07:39 +01:00
Bruno Oliveira
b8f1b7cdc6 Merge pull request #8680 from pytest-dev/update-plugin-list/patch-c516dba
[automated] Update plugin list
2021-05-15 23:47:35 -03:00
pytest bot
a69ed66c2e [automated] Update plugin list 2021-05-16 00:10:52 +00:00
pre-commit-ci[bot]
6ae71a2c2b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-05-15 17:51:55 +00: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
Zack Kneupper
33c6ad5bf7 Replace some for loops, and other minor changes (#8660)
* Replace for loop using the  operator

* Replace for loop with a generator expression inside any()

* Replace for loop with a dictionary comprehension

* Use list comprehension

* Simplify arguments for range()

* Change newfuncargs variable to in-line dictionary comprehension

* is_ancestor: return base.is_relative_to(query)

* Remove unneeded import of pathlib

* Try using PurePath

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Import PurePath on new line

* Revert and remove is_relative_to

Co-authored-by: Zachary Kneupper <zacharykneupper@Zacharys-MBP.lan>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-05-14 09:32:50 +02:00
Ran Benita
364bbe42fc Merge pull request #8649 from Saiprasad16/main
UPDATE LICENSE
2021-05-13 17:34:18 +03:00
Ran Benita
c5de274136 Merge pull request #8650 from pytest-dev/update-plugin-list/patch-3ae0103
[automated] Update plugin list
2021-05-13 17:33:22 +03:00
Ran Benita
850a844779 Merge pull request #8664 from hroncok/test_unittest-ignore_DeprecationWarning-from-twisted
Ignore DeprecationWarnings in test_trial_error
2021-05-13 17:27:43 +03: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
Saiprasad Kale
0d6e3b7005 Update AUTHORS 2021-05-11 16:39:25 +05:30
Zack Kneupper
045ad5ac2d Replaced if-else statements with ternary expression (#8658)
* Replace if-else with ternary expression

* assign out variable in readouterr() with ternary expression

* assign err variable in readouterr() with ternary expression

* Assign precision with ternary expression

* ternary expression for collected/collecting

* Assign thread_name with ternary expression

* Update AUTHORS

Co-authored-by: Zachary Kneupper <zacharykneupper@Zacharys-MBP.lan>
2021-05-11 11:52:55 +02:00
Ronny Pfannschmidt
7cec85a37d Merge pull request #8657 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-05-11 11:42:03 +02:00
Zack Kneupper
b4cd14aae3 Open log file in context manager (#8659)
Co-authored-by: Zachary Kneupper <zacharykneupper@Zacharys-MBP.lan>
2021-05-11 09:10:01 +00:00
James Gerity
822624c252 Update help text for --pdbcls to match behavior (closes #8655) (#8656)
* Clarify help text for --pdbcls

* Add changelog entry for --pdbcls
2021-05-11 09:04:50 +00: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
Zack Kneupper
48f14c48ea Remove unnecessary else clause in repr_failure() (#8661)
* Remove unnecessary else clause in repr_failure()

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Zachary Kneupper <zacharykneupper@Zacharys-MBP.lan>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-05-11 10:36:36 +02:00
pre-commit-ci[bot]
c519dd64ed [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.4b2 → 21.5b1](https://github.com/psf/black/compare/21.4b2...21.5b1)
- [github.com/PyCQA/flake8: 3.9.1 → 3.9.2](https://github.com/PyCQA/flake8/compare/3.9.1...3.9.2)
- [github.com/asottile/pyupgrade: v2.14.0 → v2.15.0](https://github.com/asottile/pyupgrade/compare/v2.14.0...v2.15.0)
2021-05-10 20:25:55 +00:00
pytest bot
e0a3dc7bf8 [automated] Update plugin list 2021-05-09 00:05:23 +00:00
Saiprasad Kale
7caf47acc6 Update AUTHORS 2021-05-08 23:50:17 +05:30
Saiprasad Kale
337a729d95 Update license.rst 2021-05-08 23:45:20 +05:30
Saiprasad Kale
6b53714d57 Update conf.py 2021-05-08 23:43:33 +05:30
Saiprasad Kale
647ac4a79d Update LICENSE 2021-05-08 23:38:48 +05:30
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
886fd70e2a Merge pull request #8594 from bluetech/addini-paths
argparsing: support parser.addini(type="paths") which returns pathlib.Paths
2021-05-07 12:44:53 +03:00
Ross Vandegrift
124691122a Expand command line argument examples with validation examples (#8610)
* Expand command line argument examples with validation examples

This shows how to pass more detailed error messages back to the user when
they've provided an incorrect value for a custom command line option.

* [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-07 10:48:46 +03:00
Ran Benita
113a860a1f argparsing: support parser.addini(type="paths") which returns pathlib.Paths 2021-05-07 09:58:51 +03:00
Rahul Kumaresan
4b6188b3b1 add support for precision bit in LEVEL_NAME_FMT regex 2021-05-07 00:45:52 +05:30
Anthony Sottile
634312b14a Merge pull request #8633 from The-Compiler/ci-colors
ci: Force colors on
2021-05-05 08:09:47 -07:00
Rahul Kumaresan
245eefafcf clarify documentation about tolerance setting in unittest.TestCase.assertAlmost() (#8614) 2021-05-05 14:23:39 +02:00
Florian Bruhin
adc197424d Merge pull request #8555 from The-Compiler/py310-fix
Fix Python 3.10 test issues
2021-05-05 14:21:40 +02:00
mobius-crypt
385988ca1a Updated (#8620) 2021-05-05 14:16:21 +02:00
Tarcísio Fischer
b7416f7abd Suggest numpy testing module on pytest approx docs (#8615)
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
Co-authored-by: Tarcisio Fischer <tarcisio@esss.co>
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-05-04 23:08:41 -03:00
Anthony Sottile
a62a28b4b8 Merge pull request #8635 from asottile/fix-release
fix a command in RELEASING.rst
2021-05-04 09:40:25 -07:00
Bruno Oliveira
2534b7725e Merge pull request #8634 from The-Compiler/tidelift
Add myself to tidelift
2021-05-04 13:40:08 -03:00
Anthony Sottile
27564e7768 Merge pull request #8636 from asottile/cherry-pick-release
cherry-pick release notes from 6.2.4
2021-05-04 09:32:02 -07:00
Anthony Sottile
915ff7640b Merge pull request #8632 from pytest-dev/release-6.2.4
Prepare release 6.2.4

(cherry picked from commit 15a45388fa)
2021-05-04 09:27:16 -07:00
Anthony Sottile
5ae2106059 fix a command in RELEASING.rst 2021-05-04 09:25:11 -07:00
Florian Bruhin
3f71d63067 ci: Force colors on
See #7443
2021-05-04 17:55:47 +02:00
Florian Bruhin
4fc67eea4f Add myself to tidelift 2021-05-04 17:46:35 +02: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
Florian Bruhin
f1570dc038 Ignore various warnings from Python 3.10
https://github.com/benjaminp/six/issues/341
https://github.com/benjaminp/six/pull/352
https://github.com/pypa/setuptools/pull/2517
2021-05-04 17:24:50 +02:00
Anthony Sottile
2637ec3921 Merge pull request #8624 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-05-03 18:27:37 -07:00
alshapton
4e048e0827 8625 - small grammar fix (#8627) 2021-05-03 20:42:23 +00:00
pre-commit-ci[bot]
f772e5e2b3 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 21.4b0 → 21.4b2](https://github.com/psf/black/compare/21.4b0...21.4b2)
- [github.com/asottile/pyupgrade: v2.13.0 → v2.14.0](https://github.com/asottile/pyupgrade/compare/v2.13.0...v2.14.0)
2021-05-03 17:21:32 +00:00
Bruno Oliveira
9c4da3e7b6 Merge pull request #8622 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.0.1
Bump anyio[curio,trio] from 3.0.0 to 3.0.1 in /testing/plugins_integration
2021-05-03 09:32:52 -03: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
Bruno Oliveira
9fa205290e [automated] Update plugin list (#8618)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2021-05-02 10:23:11 -03:00
pytest bot
8f49ffdb57 [automated] Update plugin list 2021-05-02 00:12:49 +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
Anthony Sottile
2049ae271e Merge pull request #8596 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-04-26 10:45:08 -07:00
pre-commit-ci[bot]
f5c22a6b45 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 20.8b1 → 21.4b0](https://github.com/psf/black/compare/20.8b1...21.4b0)
- [github.com/asottile/reorder_python_imports: v2.4.0 → v2.5.0](https://github.com/asottile/reorder_python_imports/compare/v2.4.0...v2.5.0)
- [github.com/asottile/pyupgrade: v2.12.0 → v2.13.0](https://github.com/asottile/pyupgrade/compare/v2.12.0...v2.13.0)
2021-04-26 17:23:05 +00: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
Bruno Oliveira
ff24dfbc9f Merge pull request #8590 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.6.0
Bump pytest-mock from 3.5.1 to 3.6.0 in /testing/plugins_integration
2021-04-26 10:43:41 -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
0341893512 Merge pull request #8584 from nicoddemus/pygments-testing-extra
Make pygments part of 'testing' extras
2021-04-24 19:55:13 -07: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
Bruno Oliveira
aead41e449 Merge pull request #8586 from pytest-dev/update-plugin-list/patch-35c8139
[automated] Update plugin list
2021-04-24 22:51:32 -03:00
pytest bot
788d445b7b [automated] Update plugin list 2021-04-25 00:20:16 +00:00
Bruno Oliveira
35c8139e09 Merge pull request #8575 from domdfcoding/domdfcoding-patch-1
Remove "upload_sphinx" section from setup.cfg
2021-04-24 11:02:58 -03:00
Bruno Oliveira
c9e30a7035 Make pygments part of 'testing' extras
Tests in test_terminalwriter depend on pygments being installed
to work, so it should be installed with the `testing` extras.
2021-04-24 10:11:47 -03: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
Dominic Davis-Foster
f9d1fa4c4b Remove "upload_sphinx" section from setup.cfg
The `Sphinx-PyPI-upload` tool the section corresponds to hasn't been updated since 2009, and the new (c. 2018) PyPI doesn't support documentation uploads anyway.
2021-04-21 16:46:28 +01:00
Ran Benita
4764c85275 Merge pull request #8570 from soxofaan/main
Logging docs: fix reference to pytest.LogCaptureFixture.
2021-04-20 16:42:54 +03:00
Ran Benita
c772d6d6a3 Merge pull request #8563 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-04-20 16:28:01 +03:00
Ran Benita
e5292ed8dc Merge pull request #8561 from pytest-dev/update-plugin-list/patch-9078c3c
[automated] Update plugin list
2021-04-20 16:26:23 +03: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
Ran Benita
c7e146da0f Merge pull request #8567 from codingjoe/patch-1
Fix typos & missing commas in CONTRIBUTING.rst
2021-04-20 16:25:30 +03:00
Stefaan Lippens
7e82f6fc38 Logging docs: fix reference to pytest.LogCaptureFixture. 2021-04-20 15:21:30 +02:00
Johannes Maron
3cbbb0bb0d Fix typos & missing commas in CONTRIBUTING.rst 2021-04-20 12:30:27 +02: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
pre-commit-ci[bot]
5d7fe91bd5 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/PyCQA/flake8: 3.9.0 → 3.9.1](https://github.com/PyCQA/flake8/compare/3.9.0...3.9.1)
2021-04-19 17:11:11 +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
pytest bot
c117bc350e [automated] Update plugin list 2021-04-18 00:18:53 +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
Florian Bruhin
d2f3d40510 doc: Update open trainings (#8551) 2021-04-15 19:09:06 +02:00
Bruno Oliveira
af31c60db1 Merge pull request #8540 from hauntsaninja/assert310 2021-04-15 08:55:42 -03:00
Ran Benita
8dd64622ca Merge pull request #8538 from pytest-dev/update-plugin-list/patch-9653a0e
[automated] Update plugin list
2021-04-14 12:52:29 +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
Albert Villanova del Moral
4b214a6049 Add tmp_path_factory methods to the docs (#8550)
* Add tmp_path_factory methods to the docs

Add the methods of tmp_path_factory to the docs.

Currently, only the class description appears in the docs.

* Add tmpdir_factory methods to the docs
2021-04-14 12:06:35 +03:00
hauntsaninja
e3dc34ee41 fixup comments 2021-04-12 11:34:14 -07: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
pre-commit-ci[bot]
da66f00413 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2021-04-11 22:44:33 +00:00
hauntsaninja
8be1628042 Fix assertion rewriting on Python 3.10
Fixes https://github.com/pytest-dev/pytest/issues/8539

This seems to have been the result of https://bugs.python.org/issue43798
2021-04-11 15:42:42 -07:00
pytest bot
67d61e56e9 [automated] Update plugin list 2021-04-11 00:20:34 +00:00
Ran Benita
9653a0e9f4 Merge pull request #8531 from pytest-dev/graingert-patch-1
fix pytest 6.2.3 #8414 changelog entry grammar
2021-04-10 19:05:19 +03:00
Bruno Oliveira
047c9603f6 Merge pull request #8535 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.8
Bump django from 3.1.7 to 3.1.8 in /testing/plugins_integration
2021-04-08 22:15:45 -03:00
Daniele Procida
70daa279a7 Further rationalised "how to invoke pytest" material. (#8536)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-04-08 21:19:30 -03: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
Thomas Grainger
97a61916a6 fix pytest 6.2.3 #8414 changelog entry grammar 2021-04-08 15:40:58 +01: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
Anthony Sottile
366c36a168 Merge pull request #8522 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-04-05 10:52:33 -07:00
pre-commit-ci[bot]
0b299044d1 [pre-commit.ci] pre-commit autoupdate 2021-04-05 17:10:40 +00:00
Ran Benita
43b547a1cb Merge pull request #8521 from pytest-dev/update-plugin-list/patch-07c6b3f
[automated] Update plugin list
2021-04-04 13:40:37 +03:00
Ran Benita
00f4cfe403 Merge pull request #8520 from bluetech/cherry-pick-release
Cherry pick 6.2.3 release notes
2021-04-04 13:40:18 +03:00
pytest bot
f3337c1854 [automated] Update plugin list 2021-04-04 00:19:23 +00:00
Ran Benita
5d2fad5362 Merge pull request #8519 from pytest-dev/release-6.2.3
Prepare release 6.2.3

(cherry picked from commit 724e22cb00)
2021-04-04 01:08:26 +03:00
Ran Benita
07c6b3fb21 Merge pull request #8516 from bluetech/mktmp
Fix minor temporary directory security issue
2021-04-04 00:33:53 +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
Ran Benita
0dd1e5b4f4 pathlib: inline ensure_reset_dir()
This is only used in TempPathFactory.getbasetemp(). We'll be wanting
further control/care there, so move it into there.
2021-04-03 23:42:53 +03:00
Ran Benita
78122a5304 pathlib: remove useless temporary variable 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
53ebe34ca2 Apply suggestions from code review
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-04-03 12:46:50 +02:00
Ronny Pfannschmidt
deb5b5bd96 fix #8371: fix stack-level 2021-04-02 00:58:05 +02:00
Ronny Pfannschmidt
9c151a65c8 Merge pull request #8503 from pytest-dev/require_setuptools
monkeypatch.syspath_prepend: Skip fixup_namespace_packages if pkg_resources not imported
2021-04-01 21:49:29 +02:00
Miro Hrončok
778d2b2499 monkeypatch.syspath_prepend: Skip fixup_namespace_packages if pkg_resources not imported
Calling pkg_resources.fixup_namespace_packages() is only needed for packages
that use pkg_resources.declare_namespace() and hence they already imported
pkg_resources. When pkg_resources is not imported, we don't need to use it.

This avoids an unneeded runtime dependency on setuptools.
The code is tested by test_syspath_prepend_with_namespace_packages,
behavior should remain unchanged, hence no new test was added.

When people drop pkg_resources from sys.modules, they are on their own.
If someone has a actual use case making this valid to support,
they can come in and provide a test, a reference and a fix.
2021-04-01 20:24:21 +02:00
Mehera Emrich
0061ec5555 Fix typo (#8504) 2021-04-01 15:13:12 +02:00
Bruno Oliveira
b96e229c95 Fix plugin-list label in the docs (#8505)
Last time I "fixed" this I left a `\` at the start of the string
to avoid an initial newline, but didn't realize it was a raw string.

This should fix it now for good.
2021-04-01 15:12:46 +02:00
Ronny Pfannschmidt
bad1963697 fix #8361: address review/quality comments 2021-03-29 22:29:35 +02:00
Bruno Oliveira
ca4a7a085e Merge pull request #8496 from pytest-dev/update-plugin-list/patch-9052a9e
[automated] Update plugin list
2021-03-27 22:53:43 -03:00
pytest bot
bfdfab00dd [automated] Update plugin list 2021-03-28 00:18:38 +00:00
Ronny Pfannschmidt
9052a9e313 Merge pull request #8462 from RonnyPfannschmidt/main_fixup_followup
port the rest of the scripts/docs over to the main branch
2021-03-27 15:49:20 +01:00
Bruno Oliveira
c1bdff9e69 Merge pull request #8494 from nicoddemus/python-3.10 2021-03-27 11:32:31 -03:00
Bruno Oliveira
a7416a535a Add classifier for Python 3.10 and CHANGELOG entry 2021-03-27 11:13:16 -03:00
Bruno Oliveira
913cffa45f Add warnings filter for disutils deprecation
Deprecated in 3.10, scheduled for removal in 3.12
2021-03-27 11:13:16 -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
878a51ef53 Merge pull request #8493 from pytest-dev/docs-fix
tweak documentation of report's sections attribute
2021-03-26 07:47:38 -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
8c65a4f174 Configure support for Python 3.10 2021-03-26 07:33:24 -03:00
Bruno Oliveira
ddbc00d61e Merge pull request #8391 from nicoddemus/ellipsis-verbose-6682
Increase truncation threshold with -v, disable with -vv
2021-03-26 07:29:36 -03:00
Bruno Oliveira
c1e057065c Fix plugin-list label and script
This was changed during the current docs restructing and
we missed that it changed the label.
2021-03-26 07:13:52 -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
Bruno Oliveira
9e8a6b6eeb Merge pull request #8477 from evildmp/evolutionary-documentation-restructure 2021-03-26 06:32:26 -03:00
wim glenn
76ab94e4a0 fix some bunk formatting in the CollectReport, and reword the description of the 'sections' attribute 2021-03-25 22:25:19 -05:00
Bruno Oliveira
8d21df0dc6 Merge pull request #8473 from pytest-dev/update-plugin-list/patch-35df3e6
[automated] Update plugin list
2021-03-25 17:36:25 -03:00
Bruno Oliveira
7dfaaa1e16 Merge pull request #8476 from symonk/cmdline-main-docs
Remove note on conftest.py files as part of pytest_cmdline_main hookspec
2021-03-25 17:23:24 -03:00
pre-commit-ci[bot]
f28421cc70 [pre-commit.ci] pre-commit autoupdate (#8480)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-03-23 19:05:19 +00:00
Daniele Procida
a7d528e058 Restructured 'How to invoke pytest' guide 2021-03-22 22:47:13 +00:00
Simon K
a6cf0a0a0e rename master to main in PULL_REQUEST_TEMPLATE.md (#8481) 2021-03-22 22:06:46 +00: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
symonk
42ece0ca81 remove conftest note on pytest_cmdline_main, the hook is invoked 2021-03-21 20:06:18 +00:00
pytest bot
3add1a4d0f [automated] Update plugin list 2021-03-21 00:50:28 +00: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
Ronny Pfannschmidt
2994022753 reshape typing for hook invocation proxying 2021-03-20 23:02:03 +01:00
Ronny Pfannschmidt
a550db4b6c drop internal py.path.local objects from hook calls 2021-03-20 21:50:40 +01:00
Ran Benita
945cc0b5a1 testing: stop relying on comparing to py.path in fnmatcher tests 2021-03-20 21:58:45 +02:00
Ronny Pfannschmidt
30f1b81eb2 address #8361 - introduce hook caller wrappers that enable backward compat 2021-03-18 23:08:03 +01:00
Ronny Pfannschmidt
ff6d5ae278 port the rest of the scripts/docs over to the main branch 2021-03-18 22:13:12 +01:00
Bruno Oliveira
35df3e68d5 Merge pull request #8459 from bluetech/unnecessary-py-path-3 2021-03-18 09:05:45 -03:00
Jürgen Gmach
fb481c7e6f fix typo (#8460) 2021-03-18 12:34:01 +01: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
202dd9f423 pytester: add & use our own copytree instead of py.path's
Fixes the TODO note.
2021-03-18 10:23:48 +02:00
Ran Benita
ccdadb64ea main: add Session.startpath, make Session.startdir a property that can be deprecated
Same as in Config.
2021-03-18 10:23:48 +02:00
Ran Benita
6a174afdfe terminal: move startdir attribute to a property that can be deprecated
Same as in Config.
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
Ran Benita
f7efb9a01c Merge pull request #8455 from evildmp/evolutionary-documentation-restructure
Explicitly listed the four documentation sections on index.rst
2021-03-18 09:52:31 +02:00
Ronny Pfannschmidt
6071b2c647 Merge pull request #8449 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-03-17 15:09:46 +01: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
Daniele Procida
6ab461f460 Explicitly listed the four documentation sections on index.rst 2021-03-16 20:26:05 +00: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
Petr Viktorin
1f131afb07 Fix value in error message about negative relative tolerance 2021-03-16 18:54:52 +01:00
Bruno Oliveira
2ce446a75f Merge pull request #8451 from evildmp/evolutionary-documentation-restructure 2021-03-16 10:52:49 -03:00
Daniele Procida
7781582d52 Restructured global TOC
* Changed "Table Of Contents" link to a plain heading.
* Removed Customize, API Reference, 3rd party plugins links altogether.
* Added an "About the project" heading
2021-03-15 23:20:55 +00:00
Daniele Procida
c83b05af6b Merge remote-tracking branch 'origin/main' into evolutionary-documentation-restructure 2021-03-15 22:28:50 +00:00
pre-commit-ci[bot]
584fd0f387 [pre-commit.ci] pre-commit autoupdate 2021-03-15 17:01:35 +00: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
Daniele Procida
2641761c1c Merge pull request #8441 from evildmp/evolutionary-documentation-restructure
Moved more sections from reference to how-to.
2021-03-15 10:22:11 +02:00
Daniele Procida
64107be443 Amended plugin list script for moved file. 2021-03-14 22:44:20 +00:00
Daniele Procida
d171a3f52d Moved more sections from reference to how-to.
* re-ordered and grouped how-to guides in how-to landing page
* retitled moved documents appropriately
* separated writing plugins/writing hook functions into two documents
2021-03-14 19:33:43 +00:00
Ran Benita
63bc49de70 Merge pull request #8440 from bluetech/unnecessary-py-path
Remove/replace some unneeded usages of py.path
2021-03-14 15:56:07 +02:00
Ran Benita
59251e8a2a Remove/replace some unneeded usages of py.path 2021-03-14 14:12:28 +02:00
Bruno Oliveira
cdbeb03aef Merge pull request #8442 from pytest-dev/update-plugin-list/patch-ba0193a
[automated] Update plugin list
2021-03-14 07:18:15 -03:00
pytest bot
493b54e21e [automated] Update plugin list 2021-03-14 00:49:15 +00:00
Ran Benita
ba0193ad06 Merge pull request #8439 from bluetech/doc-tmpdir-reduce
doc/tmpdir: significantly reduce space dedicated to tmpdir/tmpdir_factory
2021-03-13 21:35:00 +02:00
Ran Benita
3075078498 Merge pull request #8438 from bluetech/setuptools-dash-deprecation
setup.cfg: fix setuptools dash-separator warnings
2021-03-13 20:56:13 +02:00
Ran Benita
ba7bd3d77c doc/tmpdir: significantly reduce space dedicated to tmpdir/tmpdir_factory
Emphasize tmp_path/tmp_path_factory and just note the legacy ones.
2021-03-13 20:44:23 +02:00
Ran Benita
8c350b9837 setup.cfg: fix setuptools dash-separator warnings
Warnings like this:

python3.9/site-packages/setuptools/dist.py:634: UserWarning: Usage of
dash-separated 'upload-dir' will not be supported in future versions.
Please use the underscore name 'upload_dir' instead
2021-03-13 20:30:24 +02:00
Bruno Oliveira
ef1308c23b Merge pull request #8407 from nicoddemus/type-annotations-description-8405
Add type annotations to the description instead of signature
2021-03-13 14:46:37 -03: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
Bruno Oliveira
9fa6673222 Merge pull request #8434 from evildmp/evolutionary-documentation-restructure 2021-03-13 12:50:45 -03: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
96ef7d678b code: fix outdated reference in ExceptionInfo.exconly docstring
No such thing as `_pytest._code.AssertionError`, it's just the built-in
`AssertionError`.
2021-03-13 14:44:50 +02:00
Ran Benita
5bbfb4e058 Remove _ prefix from TypeVars which appear in public API
The prefixes make the API Reference docs (for e.g. `pytest.raises`,
`pytest.fixture`) uglier.

Being under `_pytest` is sufficient from a privacy perspective, so let's
drop them.
2021-03-13 14:44:50 +02:00
Daniele Procida
dd576509e1 Merge branch 'main' into evolutionary-documentation-restructure 2021-03-13 12:09:36 +00:00
Bruno Oliveira
146eda93e7 Merge pull request #8436 from pytest-dev/doc-fix-toc
doc: fix broken links in left-hand TOC
2021-03-13 08:24:35 -03:00
Ran Benita
639c4e64a1 doc: fix broken links in left-hand TOC
Due to recent renamings.
2021-03-13 12:44:30 +02:00
Daniele Procida
843e9eac2c Added myself to AUTHORS 2021-03-12 23:14:18 +00:00
Daniele Procida
8410d9ac54 Created a new Explanation section and new landing pages for main sections.
Added landing pages for:

How-to guides
Reference guides
Explanation

Added links to the main landing pages to the sidebar.
2021-03-12 22:57:53 +00:00
Daniele Procida
ff2ee96b8c Split fixtures documentation into separate documents.
Sections have been moved to:

* reference/fixtures.rst
* how-to/fixtures.rst
* fixtures.rst

according to their function. Further refinement and rewriting will be required.

Some material has been moved to a new "Anatomy of a test" document, in
anticipation that material from other sections will also find a natural
home there later.

Removed several unneeded reference targets from fixtures documentation.
2021-03-12 22:16:47 +00:00
Bruno Oliveira
32ad70dea8 Merge pull request #8433 from evildmp/evolutionary-documentation-restructure
Added how-to and reference directories.
2021-03-11 19:26:09 -03:00
Daniele Procida
d8695410a4 Added how-to and reference directories.
Moved various documents into subdirectories, how-to and
reference.

Updated multiple links to use `:ref:` instead of `:doc:`,
meaning that files can henceforth be moved around without
breaking references.
2021-03-11 22:13:01 +00:00
Bruno Oliveira
4b7edef08f Merge pull request #8431 from evildmp/evolutionary-documentation-restructure
Moved documentation topics to group them by theme.
2021-03-11 16:32:16 -03:00
Daniele Procida
a362200d47 Moved documentation topics to group them by theme.
Reordered items in:

* _templates/globaltoc.html
* contents.rst
2021-03-11 17:22:54 +00:00
Ran Benita
2a789b9e3a Merge pull request #8409 from pytest-dev/update-plugin-list/patch-620e819
[automated] Update plugin list
2021-03-11 18:26:12 +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
Ran Benita
ce2ad8ebd4 Merge pull request #8430 from evildmp/evolutionary-documentation-restructure
Renamed Install to Getting started; moved notes to index.
2021-03-11 09:17:03 +02:00
Daniele Procida
d2d975d6cf Reworded titles of some clear how-to guides
Files retitled:

assert.rst
bash-completion.rst
capture.rst
existingtestsuite.rst
mark.rst
monkeypatch.rst
nose.rst
parametrize.rst
plugins.rst
skipping.rst
tmpdir.rst
usage.rst
2021-03-10 20:26:06 +00:00
Daniele Procida
4a19533ba5 Renamed Install to Getting started; moved notes to index 2021-03-10 19:20:32 +00:00
Ronny Pfannschmidt
bfbf733a3e Merge pull request #8425 from RonnyPfannschmidt/main-fixes
reconfigure everything for main
2021-03-09 22:54:01 +01: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
38d8deb74d Merge pull request #8419 from pytest-dev/all-repos_autofix_all-repos-manual
clean up mkdtemp usage
2021-03-09 07:04:32 -08: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
pre-commit-ci[bot]
125633728f [pre-commit.ci] pre-commit autoupdate 2021-03-08 16:54:31 +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
Bruno Oliveira
fc651fb158 Merge pull request #8251 from RonnyPfannschmidt/pathlib-node-path 2021-03-07 11:10:07 -03: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
pytest bot
f0ad73c4b0 [automated] Update plugin list 2021-03-07 00:48:50 +00:00
Florian Bruhin
620e819656 Add enterPy training (#8396) 2021-03-06 22:59:33 +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
Bruno Oliveira
7c792e96c6 Add type annotations to the description instead of signature
This configures Sphinx autodoc to include the type annotations
along with the description of the function/method, instead of including
it into the signature.

Fix #8405
2021-03-05 22:22:53 -03: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
4dbb29431a Merge pull request #8385 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-03-02 17:33:55 -03: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
Bruno Oliveira
284b9dba9d Merge pull request #8382 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--2.2.0
build(deps): bump anyio[curio,trio] from 2.1.0 to 2.2.0 in /testing/plugins_integration
2021-03-02 17:33:09 -03:00
pre-commit-ci[bot]
decca74788 [pre-commit.ci] pre-commit autoupdate 2021-03-01 16:53:28 +00: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
Bruno Oliveira
cd783eba03 Merge pull request #8376 from pytest-dev/update-plugin-list/patch-22c0dac
[automated] Update plugin list
2021-02-28 07:55:43 -03:00
pytest bot
a623b1b086 [automated] Update plugin list 2021-02-28 00:48:46 +00:00
Simon K
22c0dace3b change istestfunction to callable() (#8374) 2021-02-25 20:32:27 +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
Bruno Oliveira
bbea18d7f9 Merge pull request #8367 from The-Compiler/class-fromparent-kw 2021-02-23 16:25:14 -03:00
Bruno Oliveira
690fb26ec7 Merge pull request #8368 from The-Compiler/fromparent-changelog
Fix typo in changelog
2021-02-23 16:24:24 -03:00
Florian Bruhin
9d09d19911 Fix typo in changelog
See #7143
2021-02-23 18:03:10 +01: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
Bruno Oliveira
d6522b517b Merge pull request #8364 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-02-22 18:36:43 -03:00
Bruno Oliveira
d37fe13af5 Merge pull request #8362 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.7
build(deps): bump django from 3.1.6 to 3.1.7 in /testing/plugins_integration
2021-02-22 17:36:58 -03:00
Bruno Oliveira
d76f7b3039 Merge pull request #8359 from pytest-dev/update-plugin-list/patch-4964b46
[automated] Update plugin list
2021-02-22 17:34:40 -03:00
pre-commit-ci[bot]
e503e27579 [pre-commit.ci] pre-commit autoupdate 2021-02-22 17:04:30 +00: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
pytest bot
56421aed01 [automated] Update plugin list 2021-02-21 00:46:01 +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
4964b468c8 Merge pull request #8354 from feanil/patch-1
Remove a redundant paragraph
2021-02-20 17:19:54 +02:00
Feanil Patel
e6012612b9 Remove a redundant paragraph
doc This paragraph looks like it is a more verbose version of the sentence right above it.  Removing it doesn't reduce the amount of information here but does make the section flow a little better.
2021-02-19 13:46:29 -05:00
Ran Benita
a44dcf5ece Merge pull request #8351 from vpoulailleau/patch-1
Update number of plugins
2021-02-18 17:28:44 +02:00
Vincent Poulailleau
565fe0fb7d Update number of plugins
According to the source, there are 801 plugins now!
2021-02-18 15:27:39 +01:00
Bruno Oliveira
c9d623971a Merge pull request #8349 from maskypy40/patch-1
Removes 2 empty lines from example code
2021-02-18 08:16:54 -03:00
maskypy40
532543b4ef Remove empty lines from code-block
In assert.rst at line 175 and further there is an example of an assert encountering comparisons. The code-block for this example starts with a comment (line 177)  and then it has 2 empty lines. Comparing this example code (test_assert2.py) with the previously mentioned example code on the same page (i.e. test_assert1.py) you can see that there should not be 2 empty lines after the comment. These 2 empty lines are removed.
2021-02-17 09:33:04 +01:00
Ran Benita
ab2eb94054 Merge pull request #8345 from pytest-dev/update-plugin-list/patch-16e21c2
[automated] Update plugin list
2021-02-15 15:08:17 +02:00
pytest bot
a0ae5fd652 [automated] Update plugin list 2021-02-14 00:45:06 +00:00
Bruno Oliveira
16e21c22a3 Merge pull request #8336 from sbellem/typos/setup.cfg
Remove duplicate '>=' in setup.cfg
2021-02-11 07:53:02 -03:00
Sylvain Bellemare
3d831225bb Remove duplicate '>=' in setup.cfg 2021-02-10 22:17:39 +00:00
Anthony Sottile
92959fe236 Merge pull request #8329 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-02-08 09:38:02 -08:00
pre-commit-ci[bot]
6432fc2302 [pre-commit.ci] pre-commit autoupdate 2021-02-08 16:50:48 +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
f85427b92a Merge pull request #8326 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.6
build(deps): bump django from 3.1.5 to 3.1.6 in /testing/plugins_integration
2021-02-08 08:09:23 -03:00
Bruno Oliveira
e9d554c5f5 Merge pull request #8324 from pytest-dev/update-plugin-list/patch-bcfe253
[automated] Update plugin list
2021-02-08 08:04:16 -03: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
Bruno Oliveira
ee5afb2a8f Merge pull request #8325 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--2.1.0
build(deps): bump anyio[curio,trio] from 2.0.2 to 2.1.0 in /testing/plugins_integration
2021-02-08 08:02:41 -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
Ronny Pfannschmidt
325d701f6e Merge pull request #8248 from RonnyPfannschmidt/mixin-mro-position
alter the PyObjMixin to carry over typing information from Node
2021-02-07 18:44:44 +01:00
pytest bot
3c6bd7eb27 [automated] Update plugin list 2021-02-07 00:44:13 +00:00
Ran Benita
5822888d73 runner: add clarifying comments on why runtestprotocol re-inits the FixtureRequest 2021-02-06 20:46:08 +02: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
f674f6da9f runner: add a safety assert to SetupState.prepare
This ensures that the teardown for the previous item was done properly
for this (next) item, i.e. there are no leftover teardowns.
2021-02-06 20:46:08 +02:00
Pax
bcfe253f5b Type annotation for request.param (#8319) 2021-02-05 22:03:58 +02:00
Bruno Oliveira
150bdceb7a Merge pull request #8322 from pytest-dev/fixture-docs
doc: Remove confusing fixture sentence
2021-02-05 15:11:17 -03:00
Florian Bruhin
c604f3f0c5 doc: Remove confusing fixture sentence
There is no previous `test_ehlo` example (it follows much later) - and the same thing is described further down in ""Requesting" fixtures" already.
2021-02-05 17:47:37 +01:00
Bruno Oliveira
ed8cabe4fd Merge pull request #8320 from nicoddemus/change-update-plugins-cron
Update plugin-list every Sunday instead of everyday
2021-02-05 07:48:31 -03:00
Bruno Oliveira
e3c0fd3203 Update plugin-list every Sunday instead of everyday
Every day seems a bit excessive lately, let's make it less frequent.
2021-02-05 07:29:12 -03:00
Bruno Oliveira
375e95180c Merge pull request #8318 from pytest-dev/update-plugin-list/patch-b3115c1
[automated] Update plugin list
2021-02-04 23:10:54 -03:00
pytest bot
16af1a31fd [automated] Update plugin list 2021-02-05 00:24:50 +00:00
Ran Benita
b3115c1b06 Merge pull request #8315 from bluetech/parser-proper-deprecation
config/argparsing: use proper deprecations instead of ad-hoc DeprecationWarning
2021-02-05 00:37:38 +02:00
Ran Benita
d358a060ad config/argparsing: use proper deprecations instead of ad-hoc DeprecationWarning
Proper for removing this in the next major pytest release.
2021-02-05 00:05:47 +02:00
Hong Xu
80c223474c Type annotation polishing for symbols around Pytester.run (#8298)
* Type annotation polishing for symbols around Pytester.run

Hopefully these will help document readers understand pertinent methods
and constants better.

Following up #8294

* Use NOTSET instead of object
2021-02-04 23:44:22 +02:00
Bruno Oliveira
bebb6953eb Merge pull request #8312 from matthewhughes934/add-regendoc-runs-for-fixture-docs 2021-02-04 15:50:48 -03:00
Matthew Hughes
709c211e68 Run regendoc over fixture docs
This is the result of running:

    $ cd doc/en && make regen REGENDOC_FILES=fixture.rst
2021-02-04 18:32:52 +00:00
Matthew Hughes
97cfd66806 Add regendoc runs for emaillib tests in fixture
Also update these tests ensure they pass, and be explicit about the test
file called in an existing test to avoid unintentional calls to the
added tests
2021-02-04 18:32:28 +00:00
Bruno Oliveira
287bab09a4 Merge pull request #8314 from pytest-dev/update-plugin-list/patch-275174e
[automated] Update plugin list
2021-02-04 11:54:29 -03:00
Bruno Oliveira
7c622d7462 Merge pull request #8316 from The-Compiler/training-update
doc: Remove past training
2021-02-04 10:02:02 -03:00
Florian Bruhin
b77f071bef doc: Remove past training 2021-02-04 11:40:28 +01:00
Ran Benita
3907856cb3 Merge pull request #8297 from pytest-dev/monkeypatch-docs
doc: Point out two-argument form of monkeypatch.setattr
2021-02-04 10:13:27 +02:00
pytest bot
1d895dd46c [automated] Update plugin list 2021-02-04 00:26:06 +00:00
Matthew Hughes
298541f540 Add basic emaillib for tests in fixture.rst
This will be used to power regendoc runs for later tests
2021-02-03 13:14:31 +00:00
Matthew Hughes
100c8deab5 Fix various typos in fixture docs 2021-02-03 13:14:31 +00:00
Bruno Oliveira
275174e147 Merge pull request #8308 from pytest-dev/update-plugin-list/patch-c26dddc
[automated] Update plugin list
2021-02-02 09:05:04 -03:00
Bruno Oliveira
3568df22b0 Merge pull request #8302 from pytest-dev/update-plugin-list/patch-ed8f424
[automated] Update plugin list
2021-02-02 08:43:51 -03:00
pytest bot
3165b1e323 [automated] Update plugin list 2021-02-02 00:31:11 +00:00
Bruno Oliveira
c26dddc651 Merge pull request #8306 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-02-01 17:37:14 -03:00
pre-commit-ci[bot]
1b2ca22e9b [pre-commit.ci] pre-commit autoupdate 2021-02-01 16:49:41 +00:00
pytest bot
5c61d60b0d [automated] Update plugin list 2021-02-01 00:32:44 +00:00
Ran Benita
ed8f424bcb Merge pull request #8299 from pytest-dev/update-plugin-list/patch-38a3e30
[automated] Update plugin list
2021-01-30 15:13:22 +02:00
Ran Benita
c971f2f474 ci: give pytest bot the credit for updating the plugin list 2021-01-30 13:04:10 +02:00
bluetech
de06f468ed [automated] Update plugin list 2021-01-30 00:30:28 +00:00
Florian Bruhin
f0f19aa8d9 doc: Point out two-argument form of monkeypatch.setattr
See the "for convenience" part here: https://docs.pytest.org/en/stable/reference.html#pytest.MonkeyPatch.setattr
2021-01-29 21:08:37 +01:00
Bruno Oliveira
38a3e30cd9 Merge pull request #8296 from bluetech/mypy-800-ignores
Remove some no longer needed type-ignores
2021-01-29 16:35:33 -03:00
Ran Benita
afea190797 Remove some no longer needed type-ignores 2021-01-29 20:40:43 +02:00
Hong Xu
07f0eb26b4 Doc: Clarify pytester.run (#8294)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-01-29 12:54:06 -03:00
Ran Benita
63ea727bc2 changelog: fix missing tick (#8295)
Messes with the rendering.
2021-01-29 16:21:25 +02:00
Maximilian Cosmo Sitter
beda7a8a31 Add plugin list 2021-01-29 16:19:54 +02:00
Ran Benita
0b510bcc51 changelog: fix missing tick
Messes with the rendering.
2021-01-29 16:06:36 +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
7b4ee65bdc Merge pull request #8284 from encukou/patch-1
Doc: Fix typo
2021-01-27 09:40:55 -03:00
Bruno Oliveira
0365b1be64 Merge pull request #8280 from xuhdev/module
Doc: Move the module declaration to index.rst
2021-01-27 09:05:36 -03:00
Petr Viktorin
56cea26445 Doc: Fix typo 2021-01-27 10:23:18 +01:00
Ran Benita
0939c3e022 Merge pull request #8279 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2021-01-26 11:17:58 +02:00
Hong Xu
8bb3977cb6 Doc: Move the module declaration to index.rst
When the declaration stays in reference.rst, it creates duplicated
"pytest" symbols such as `pytest.pytest.mark.filterwarnings`.
2021-01-26 00:48:01 -08:00
Bruno Oliveira
dfe933cdb4 Remove mypy workaround after 0.800 update 2021-01-25 15:23:13 -03:00
pre-commit-ci[bot]
6806091b93 [pre-commit.ci] pre-commit autoupdate 2021-01-25 16:41:17 +00:00
Bruno Oliveira
33861098d9 Only re-enable fauthandler during unconfigure if it was enabled before 2021-01-25 12:28:00 -03:00
Christian Steinmeyer
781b73bb52 Mention that class variables are shared between tests
Close #8252
2021-01-25 12:02:59 -03:00
Bruno Oliveira
f3efc4e049 Merge pull request #8277 from nicoddemus/cherry-pick-release
Merge pull request #8275 from pytest-dev/release-6.2.2
2021-01-25 12:02:49 -03:00
Bruno Oliveira
2a890286f8 Merge pull request #8275 from pytest-dev/release-6.2.2
Prepare release 6.2.2

(cherry picked from commit 8220eca963)
2021-01-25 11:53:05 -03:00
Ran Benita
fff9f28fdd Merge pull request #8272 from bluetech/setupstate-refactor-2
runner: avoid using node's store in SetupState
2021-01-25 16:00:05 +02:00
Bruno Oliveira
5cc295e74b Merge pull request #8273 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-cov-2.11.1
build(deps): bump pytest-cov from 2.10.1 to 2.11.1 in /testing/plugins_integration
2021-01-25 09:12:14 -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
48fb989a71 runner: avoid using node's store in SetupState
SetupState maintains its own state, so it can store the exception
itself, instead of using the node's store, which is better avoided when
possible.

This also reduces the lifetime of the reference-cycle-inducing exception
objects which is never a bad thing.
2021-01-24 15:05:03 +02:00
Ran Benita
d5df8f99ab Merge pull request #8219 from bluetech/setupstate-refactor
runner: refactor SetupState
2021-01-24 14:51:58 +02: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
0d19aff562 runner: schedule node.teardown() call already at setup
This is more elegant.
2021-01-24 14:08:39 +02:00
Ran Benita
1db78bec31 runner: use insertion-ordered dict instead of stack, dict pair
Since dicts are now ordered, we can use the finalizers dict itself as
the dict, simplifying the code.
2021-01-24 14:08:39 +02:00
Ran Benita
03c3a90c68 runner: replace setdefault with an unconditional set
The already-exists case is not supposed to happen.
2021-01-24 14:08:39 +02:00
Ran Benita
960ebae943 runner: enable a commented assertion in SetupState.addfinalizer
The assertion ensures that when `addfinalizer(finalizer, node)` is
called, the node is in the stack. This then would ensure that the
finalization is actually properly executed properly during the node's
teardown. Anything else indicates something is wrong.

Previous commits fixed all of the tests which previously failed this, so
can be reenabeld now.
2021-01-24 14:08:39 +02:00
Ran Benita
6db082a448 fixtures: make sure to properly setup stack for _fill_fixtures_impl
This code is weird, dead, deprecated and will be removed in pytest 7,
but for now some tests execute it, so fix it up in preparation for
some changes.
2021-01-24 14:08:39 +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
0d4121d24b runner: collapse exception handling in SetupState.teardown_exact()
This is equivalent but simpler.
2021-01-24 14:08:39 +02:00
Ran Benita
bb3d43c9a6 runner: ensure item.teardown() is called even if a finalizer raised
If one finalizer fails, all of the subsequent finalizers still run, so
the `teardown()` method should behave the same.
2021-01-24 14:08:39 +02:00
Ran Benita
14d71b2c22 runner: make sure SetupState._finalizers is always set for a node in the stack
This makes the stack <-> _finalizers correspondence clearer.
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
Ran Benita
5f4e55fb6d runner: remove dead code in teardown_all()
When the stack is empty, the finalizers which are supposed to be
attached to nodes in the stack really ought to be empty as well. So the
code here is dead. If this doesn't happen, the assert will trigger.
2021-01-24 14:08:39 +02:00
Ran Benita
42ae8180dd runner: inline SetupState._teardown_towards()
Doesn't add much.
2021-01-24 14:08:39 +02:00
Ran Benita
410622f719 runner: reorder SetupState method to make more sense
The setup stuff happens before the teardown stuff, so put it first so
that reading the code from top to bottom makes more sense.
2021-01-24 14:08:39 +02:00
Ran Benita
f7b0b1dd1f runner: use node's Store to keep private SetupState state instead of an attribute
This way it gets proper typing and decoupling.
2021-01-24 14:08:39 +02:00
Ran Benita
da70f61f67 runner: complete type annotations of SetupState 2021-01-24 14:08:39 +02:00
Hong Xu
d4f8e4b40c Explain how to create binary files in the doc of pytest.makefile. (#8255) 2021-01-21 09:58:52 -03: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
Jeff Widman
eef2d1a8e2 Fix pep8 import order in docs (#8253) 2021-01-19 11:45:45 -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
7f782c72ba Merge pull request #8242 from bluetech/deprecate-unittest-skip-collection
Deprecate raising unittest.SkipTest to skip tests during collection
2021-01-18 17:46:00 +02:00
Ronny Pfannschmidt
a9e43152bc alter the PyObjMixin to carry over typing information from Node
as PyObjMixin is always supposed to be mixed in the mro
before nodes.Node the behavior doesn't change,
but all the typing information carry over to help mypy.

extracted from #8037
2021-01-17 14:36:28 +01:00
Ran Benita
c9e9a599fe Merge pull request #8241 from bluetech/skip-improvements
Minor code improvements in nose, unittest, skipping
2021-01-15 15:35:57 +02: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
Ran Benita
7f989203ed Improve way in which skip location is fixed up when skipped by mark
When `pytest.skip()` is called inside a test function, the skip location
should be reported as the line that made the call, however when
`pytest.skip()` is called by the `pytest.mark.skip` and similar
mechanisms, the location should be reported at the item's location,
because the exact location is some irrelevant internal code.

Currently the item-location case is implemented by the caller setting a
boolean key on the item's store and the `skipping` plugin checking it
and fixing up the location if needed. This is really roundabout IMO and
breaks encapsulation.

Instead, allow the caller to specify directly on the skip exception
whether to use the item's location or not. For now, this is entirely
private.
2021-01-14 18:07:25 +02:00
Ran Benita
3dde519f53 nose: type annotate with some resulting refactoring 2021-01-14 17:42:38 +02:00
Ran Benita
096bae6c68 unittest: add clarifying comment on unittest.SkipTest -> pytest.skip code
I was tempted to remove it, until I figured out why it was there.
2021-01-14 17:06:14 +02:00
Ran Benita
addbd3161e nose,fixtures: use the public item API for adding finalizers 2021-01-14 16:53:07 +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
Bruno Oliveira
203a9b3ab2 Merge pull request #8234 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.5.1
build(deps): bump pytest-mock from 3.4.0 to 3.5.1 in /testing/plugins_integration
2021-01-11 08:24:33 -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
f6529fd3a1 Merge pull request #8232 from imrehg/doc
Add missing import into example script in documentation
2021-01-08 14:08:47 +02:00
Gergely Imreh
80c33c8178 Add missing import into example script in documentation 2021-01-08 11:43:51 +00:00
Petr Viktorin
78fb97105f Make code.FormattedExcinfo.get_source more defensive
When line_index was a large negative number, get_source failed
on `source.lines[line_index]`.
Use the same dummy Source as with a large positive line_index.
2021-01-06 13:33:33 +01:00
Bruno Oliveira
31ae4e1764 Merge pull request #8225 from The-Compiler/training-update
doc: Add note about training early bird discount
2021-01-05 16:31:04 -03:00
Florian Bruhin
65b8391ead doc: Add note about training early bird discount 2021-01-05 19:39:50 +01:00
Bruno Oliveira
329fff69a3 Merge pull request #8220 from xuhdev/module-doc
DOC: Mark pytest module
2021-01-05 13:25:02 -03: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
8d16bec329 Merge pull request #8216 from xuhdev/testdir-pytester
DOC: Update multiple references to testdir to pytester
2021-01-02 11:58:59 +02:00
Hong Xu
14b5f5e528 DOC: Mark pytest module
Pytest document currently does not index the top-level package name
`pytest`, which causes some trouble when building documentation that
cross-refers to the pytest package via ``:mod:`pytest` ``.
2021-01-02 00:34:52 -08:00
Ran Benita
2ff88098a7 python: inline a simple method
I don't think it adds much value!
2021-01-01 23:23:08 +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
ade253c790 fixtures: type annotate FixtureRequest.keywords 2021-01-01 23:18:17 +02:00
Ran Benita
6c575ad8c8 fixtures: simplify FixtureRequest._get_fixturestack() 2021-01-01 23:15:57 +02:00
Hong Xu
b02f1c8ae7 DOC: Update multiple references to testdir to pytester
In https://docs.pytest.org/en/stable/reference.html#testdir, it is
suggested:

> New code should avoid using testdir in favor of pytester.

Multiple spots in the documents still use testdir and they can be quite
confusing (especially the plugin writing guide).
2021-01-01 12:21:39 -08: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
73c4105230 reports: improve a type annotation 2021-01-01 15:22:05 +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
mefmund
5f11a35b99 Add missing fixture (#8207)
Co-authored-by: Florian Bruhin <me@the-compiler.org>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-12-31 15:25:44 -03: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
Ran Benita
7751904875 Merge pull request #8194 from bluetech/typing-public-3
Export pytest.Metafunc and pytest.Callinfo, hide NodeKeywords
2020-12-29 18:22:02 +02:00
Ran Benita
e772f02d15 Merge pull request #8188 from antonblr/subprocess-coverage
coverage: Include code that runs in subprocesses
2020-12-28 19:05:33 +02:00
Christophe Bedard
bf9b59b3c8 Add missing space in '--version' help message 2020-12-28 10:50:06 -05:00
antonblr
8550c29180 coverage: Include code that runs in subprocesses 2020-12-26 16:59:07 -08:00
Ran Benita
96ea867fec runner: export pytest.CallInfo 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.

This also documents `from_call` as public, because at least
pytest-forked uses it, so we must treat it as public already anyway.
2020-12-26 21:38:37 +02: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
6d3a66d947 nodes: avoid needing to expose NodeKeywords for typing
It adds no value over exporting just the ABC so do that to reduce the
API surface.
2020-12-26 19:54:07 +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
Bruno Oliveira
da01ee0a4b Merge pull request #8185 from bluetech/revert-docs-pygments-workaround
Revert "doc: temporary workaround for pytest-pygments lexing error"
2020-12-22 20:36:29 -03:00
Bruno Oliveira
af5da977e3 Merge pull request #8187 from pytest-dev/asottile-patch-1
Add badge for pre-commit.ci
2020-12-22 20:08:01 -03:00
Anthony Sottile
35d6a7e78e Add badge for pre-commit.ci
See #8186
2020-12-22 14:57:04 -08:00
Ran Benita
5e323becb7 Revert "doc: temporary workaround for pytest-pygments lexing error"
Support was added in pytest-pygments 2.2.0.

This reverts commit 0feeddf8ed.
2020-12-22 21:15:27 +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
a218413008 pathlib: missing type annotation for fnmatch_ex 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
Bruno Oliveira
d64706c33d Merge pull request #8180 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-mock-3.4.0
build(deps): bump pytest-mock from 3.3.1 to 3.4.0 in /testing/plugins_integration
2020-12-21 09:38:00 -03: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
69c302479e mark: export pytest.MarkDecorator 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:06 +02:00
Ran Benita
2ec372df8b mark: export pytest.Mark 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:58:49 +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
Ran Benita
73586be08f terminal: remove unused union arm in WarningReport.fslocation 2020-12-19 13:33:34 +02:00
Ran Benita
89dcfbf293 Merge pull request #8168 from antonblr/testdir-to-pytester-incr2
tests: Migrate to pytester - final update
2020-12-19 13:32:20 +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
Anthony Sottile
f14ab08de3 Merge pull request #8172 from pytest-dev/revert-8171-fix-ci-setup-python
Use new pypy3 github actions syntax
2020-12-18 11:01:48 -08:00
Anthony Sottile
293a7c962d Use new pypy3 github actions syntax 2020-12-18 10:45:28 -08:00
Anthony Sottile
4da445dc2e Revert "infra: Temporary pin setup-python GH action to v2.1.4" 2020-12-18 10:44:20 -08:00
Bruno Oliveira
403424d60b Merge pull request #8171 from antonblr/fix-ci-setup-python
infra: Temporary pin setup-python GH action to v2.1.4
2020-12-18 08:02:44 -03:00
antonblr
1264404fe7 infra: Temporary pin setup-python GH action to v2.1.4 2020-12-17 21:01:20 -08:00
Adam Johnson
bd894e3065 Add Changelog to setup.cfg (#8166)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-12-17 13:55:36 -03:00
Bruno Oliveira
ce206ae462 Merge pull request #8162 from nicoddemus/rm-travis-badge 2020-12-17 09:10:21 -03:00
Bruno Oliveira
3eef150f2e Remove other references to Travis 2020-12-17 08:19:50 -03:00
Ran Benita
02e69e5cdc Merge pull request #8152 from bluetech/empty-skip
terminal: fix "(<Skipped instance>)" skip reason in test status line
2020-12-17 12:58:00 +02:00
Bruno Oliveira
8255effc5b Remove Travis badge from README
Since we stopped testing Python 3.5, we no longer use Travis.
2020-12-16 15:43:58 -03:00
Chris NeJame
534d174fd2 Clarify fixture execution order and provide visual aids (#7381)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-12-16 13:53:14 -03:00
Bruno Oliveira
cab16f3aac Use transparent PNG for logo (#8159) 2020-12-16 11:19:45 -03:00
Bruno Oliveira
a1c5111a40 Fix events variable in prepare-release-pr.yml 2020-12-16 07:53:05 -03:00
Bruno Oliveira
f1a1de2257 Use manual trigger to prepare release PRs (#8150)
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-12-16 07:50:02 -03:00
Ran Benita
d46ecbc18b terminal: fix "(<Skipped instance>)" skip reason in test status line 2020-12-15 22:24:25 +02:00
Bruno Oliveira
950fbbc326 Merge pull request #8151 from nicoddemus/cherry-pick-release
Merge pull request #8149 from pytest-dev/release-6.2.1
2020-12-15 15:58:13 -03:00
Bruno Oliveira
56600414df Merge pull request #8149 from pytest-dev/release-6.2.1
Prepare release 6.2.1

(cherry picked from commit a566eb9c70)
2020-12-15 12:41:02 -03: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
Bruno Oliveira
382cb2aae1 Merge pull request #8138 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-bdd-4.0.2
build(deps): bump pytest-bdd from 4.0.1 to 4.0.2 in /testing/plugins_integration
2020-12-14 08:13:22 -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
Ran Benita
ad65e816e4 Merge pull request #8111 from antonblr/testdir-to-pytester-python
tests: Migrate testing/python to pytester fixture
2020-12-13 23:19:31 +02: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
Ran Benita
fa784e1436 Merge pull request #8104 from bot2x/patch-1
migrates test_warnings.py from testdir to pytester
2020-12-13 15:21:37 +02: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
09582048be Merge pull request #8131 from bluetech/cherry-pick-release
Merge pull request #8130 from pytest-dev/release-6.2.0
2020-12-12 23:28:31 +02:00
Ran Benita
54a7356a9f Merge pull request #8130 from pytest-dev/release-6.2.0
Prepare release 6.2.0

(cherry picked from commit c475106f12)
2020-12-12 23:23:19 +02:00
Ran Benita
683f29f84d Merge pull request #8129 from bluetech/docs-pygments-workaround
doc: temporary workaround for pytest-pygments lexing error
2020-12-12 22:31:10 +02:00
Ran Benita
0feeddf8ed doc: temporary workaround for pytest-pygments lexing error
pytest-pygments doesn't yet recognize the skip reason in summary line
added recently. Workaround it until we get to updating it.
2020-12-12 22:18:23 +02:00
Ran Benita
b478275777 Merge pull request #8128 from bluetech/skip-reason-empty
terminal: when the skip/xfail is empty, don't show it as "()"
2020-12-12 22:18:06 +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
Ran Benita
59bd0f6912 Merge pull request #8126 from bluetech/tox-regen-pretend-scm2
tox: use pip legacy resolver for regen job
2020-12-12 20:50:10 +02:00
Ran Benita
6298ff1f4e tox: use pip legacy resolver for regen job
The env var effects all of the pip installs, including regendoc which
also uses setuptools-scm, so it gets the wrong version, and fails to
install with the new pip resolver:

    ERROR: Requested regendoc from 206e495142/regendoc-0.6.1.tar.gz (sha256)=db1e8c9ae02c1af559eae105bfd77ba41ed07fc8ca7030ea59db5f3f161236a4 has different version in metadata: '6.2.0'
2020-12-12 20:27:59 +02:00
Ran Benita
d51ecbd44d Merge pull request #8125 from bluetech/tox-rm-pip-req
tox: remove requires: pip>=20.3.1
2020-12-12 19:11:27 +02:00
Ran Benita
f237b077fc tox: remove requires: pip>=20.3.1
Causes some trouble in CI and not really needed as old pip should still
work.
2020-12-12 18:31:52 +02:00
Ran Benita
95e0e19b8d Merge pull request #8124 from bluetech/s0undt3ch-feature/skip-context-hook
Add `pytest_markeval_namespace` hook.
2020-12-12 18:14:02 +02:00
Anton
cf1051cfba infrastructure: Stricter tox dependensies (#8119) 2020-12-12 18:08:15 +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
Ran Benita
902739cfc3 Merge pull request #7208 from CarycaKatarzyna/issue2044
Issue 2044 - show skipping reason in verbose mode
2020-12-09 10:11:47 +02: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
Bruno Oliveira
f3006ecb2b Merge pull request #8106 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.4
build(deps): bump django from 3.1.3 to 3.1.4 in /testing/plugins_integration
2020-12-07 08:52:36 -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
Bruno Oliveira
68a0f22eee Merge pull request #8100 from nicoddemus/doctest-alternatives
List pytest-doctestplus in doctest docs
2020-12-05 17:42:09 -03:00
Ran Benita
1a1bb61340 Merge pull request #8038 from matthewhughes934/note-tmpdir-lifetime
Docs: Note lifetime of temporary directories
2020-12-05 21:54:04 +02: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
Bruno Oliveira
4fc20c8d28 List pytest-doctestplus in doctest docs
As per https://github.com/pytest-dev/pytest/discussions/8088
2020-12-04 15:24:56 -03:00
Ran Benita
954151cdbd Merge pull request #8092 from cmecklenborg/pytester_refactor_test_pastebin
Migrate test_pastebin.py from testdir to pytester
2020-12-02 18:17:59 +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
Shubham Adep
d1cb9de211 Custom multiple marker execution order (#8065)
* Custom multiple marker execution order

https://github.com/pytest-dev/pytest/issues/8020 issue stated that ordering of multiple custom markers is from inside - out. I have added example for the same in the documentation. Please let me know for further changes / concerns.

* remove trailing spaces

The last commit was failing due to extra spaces

* Ran tox tests locally to debug white space trimming issues

* Resolve: ERROR:   docs: commands failed for tox -e docs

* Update doc/en/reference.rst

Committed PR suggestions.

Co-authored-by: Florian Bruhin <me@the-compiler.org>

* Added reference to Node.iter_markers_with_node in documentation

* Add myself to Authors

Co-authored-by: Shubham <shubham.adep@wsu.edu>
Co-authored-by: Florian Bruhin <me@the-compiler.org>
2020-11-30 16:48:08 +01:00
Matthew Hughes
6a256606c6 Docs: Note lifetime of temporary directories
Explanation: The default handling of these lifetimes is done in
`tmpdir.TempPathFactory.getbasetemp`, which passes `keep=3` to
`pathlib.make_numbered_dir_with_cleanup`.

GH Issue: #8036
2020-11-28 21:18:16 +00:00
Prakhar Gurunani
3405c7e6a8 Add more info about skipping doctests (#8080)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-11-28 12:47:02 -03:00
Dominic Mortlock
775ba63c67 Refactor acceptance_test to use pytester (#8070) 2020-11-25 14:42:47 +02:00
Ran Benita
70823da7ed Merge pull request #8064 from symonk/fix-typo-in-mock-timing
fix mock_timing fixture name (typo) in timing.py
2020-11-25 12:29:34 +02:00
Jürgen Gmach
d27806295a fix typo (#8069) 2020-11-24 22:27:34 +01:00
Simon K
b310872300 fix mock_timing fixture name (typo) in timing.py 2020-11-23 20:45:12 +00:00
Ran Benita
d50df85e26 Add unraisableexception and threadexception plugins 2020-11-21 21:11:48 +02:00
Ran Benita
d59a4996ae Merge pull request #8057 from nicoddemus/changelog-links
Add links to some CHANGELOG entries
2020-11-21 20:47:27 +02:00
Maximilian Cosmo Sitter
0cef530d10 Add str() support to LineMatcher (#8050) 2020-11-21 20:45:20 +02:00
Bruno Oliveira
31021ac8d5 Add links to some CHANGELOG entries
While adding links to https://github.com/pytest-dev/pytest/pull/8052, noticed
a few more missing.
2020-11-21 11:05:54 -03: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
148e3c582a pytester: always close stdin pipe in pytester.run()
If the user passed stdin=PIPE for some reason, they have no way to close
it themselves since it is not exposed.
2020-11-20 17:55:30 +02:00
Ran Benita
3e0bbd2f57 testing: fix ResourceWarning in broken-pipe test 2020-11-20 17:55:23 +02:00
Tim Hoffmann
afd53ede6f Link mentioned functions instead of using literals (#8045) 2020-11-19 15:44:59 +01:00
Bruno Oliveira
329e66c22e Merge pull request #8051 from The-Compiler/nose-fixup
Fix nose documentation
2020-11-19 10:04:59 -03:00
Florian Bruhin
c6ac618baf Fix nose documentation
Follow-up to #8048 which seems to have been merged without the suggested changes.
2020-11-19 13:54:40 +01:00
Bruno Oliveira
42f9622a90 Merge pull request #8048 from mickeypash/patch-1
Add small section on migrating from nose to pytest.
2020-11-19 09:02:04 -03:00
mickeypash
ce825ed16c Add small section on migrating from nose to pytest
The section currently features the nose2pytest tool with plans to expand
on some of the common gotchas when performing such migrations.
2020-11-19 08:50:11 -03:00
Petter Strandmark
eda681af2b Call Python 3.8 doClassCleanups (#8033) 2020-11-19 12:07:15 +02:00
Tim Hoffmann
b7ba76653d Prefix contextmanagers with module name in doc examples (#8044)
* Prefix contextmanagers with module name in doc examples

* Import pytest explicitly for doctests

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-11-19 12:06:24 +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
Ran Benita
8ea8cdb36d Merge pull request #8040 from symonk/remove-unused-var-in-pytester
stop assigning nextline if its potentially not used
2020-11-17 18:00:17 +02:00
symonk
3b677f79f4 stop assigning nextline if its potentially not used 2020-11-17 11:30:09 +00:00
Ran Benita
537215a16c Merge pull request #7987 from bluetech/ci-deprecated
ci: fix deprecation message & couple updates
2020-11-16 23:29:35 +02:00
Ran Benita
c2f949d68e Merge pull request #8013 from itsmegarvi/master
#7942 migrate from tempdir to pytester
2020-11-16 19:44:43 +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
767cbeb086 Merge pull request #8002 from mcsitter/add-pythonenv-gitignore
Add pythonenv* to gitignore
2020-11-13 23:14:23 +02:00
Maximilian Cosmo Sitter
25e4dd0d2c Fix scope to accomodate requested changes 2020-11-13 20:00:44 +00:00
Ran Benita
c14f498622 Merge pull request #7908 from bluetech/post-release-tag
RELEASING: make sure we have an accurate version in a commit in master
2020-11-13 12:57:53 +02:00
Ran Benita
f6b682ad49 RELEASING: start new dev cycle by tagging MAJOR.{MINOR+1}.0.dev0 in master
This is needed so setuptools-scm in master shows an accurate version.
In particular, higher than the stable branch.
2020-11-13 12:38:58 +02:00
Ran Benita
701ff1f5a1 ci: only deploy to PyPI on X.Y.Z{,rcN} tags
We want to reserve other tags for our own purposes without it creating a
release.
2020-11-13 12:38:30 +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
b050578882 pytester: split asserts to a separate plugin, don't rewrite pytester itself
An upcoming commit wants to import from `_pytest.pytester` in the public
`pytest` module. This means that `_pytest.pytester` would start to get
imported during import time, which it hasn't up to now -- it was
imported by the plugin loader (if requested). When a plugin is loaded,
it is subjected to assertion rewriting, but only if the module isn't
imported yet, it issues a warning "Module already imported so cannot be
rewritten" and skips the rewriting. So we'd end up with the pytester
plugin not being rewritten, but it wants to be.

Absent better ideas, the solution here is to split the pytester
assertions to their own plugin (which will always only be imported by
the plugin loader) and exclude pytester itself from plugin rewriting.
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
Bruno Oliveira
843bca8c0c Merge pull request #8025 from adamchainz/issue_8023_norecursedirs
Add 'node_modules' to norecursedirs
2020-11-12 07:36:38 -03: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
Bruno Oliveira
ff9e35243e Merge pull request #7928 from graingert/feature-request-template 2020-11-11 09:20:00 -03: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
Adam Johnson
39b2706f6a Add 'node_modules' to norecursedirs
Fixes #8023.
2020-11-11 01:52:18 +00: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
Ran Benita
7aa5e49fc4 Merge pull request #8012 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.3
build(deps): bump django from 3.1.2 to 3.1.3 in /testing/plugins_integration
2020-11-09 11:26:35 +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
Bruno Oliveira
b2e7b9df9e Merge pull request #8010 from nicoddemus/pluralize 2020-11-08 13:31:27 -03:00
Bruno Oliveira
c7f8ad17f5 Rename _make_plural to pluralize
A bit shorter and a better name, IMHO.
2020-11-08 12:42:52 -03: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
29f2f4e854 Merge pull request #8005 from bluetech/pytest-import
Stop importing `pytest` to avoid upcoming import cycles
2020-11-08 14:15:19 +02:00
Bruno Oliveira
10a3a49bd6 Merge pull request #8007 from bluetech/dont-ignore-already-imported
testing: don't ignore "Module already imported so cannot be rewritten" warning
2020-11-07 22:46:15 -03:00
frankgerhardt
9bc633064b Capitalize headlines (#8008) 2020-11-07 22:44:04 -03:00
Ran Benita
361f9e20c3 testing: don't ignore "Module already imported so cannot be rewritten" warning
The test suite passes without it being ignored. The absence of this
warning cost me some head-scratching time, so enable it again.
2020-11-07 18:14:21 +02:00
Ran Benita
1cbb0c3554 Stop importing pytest to avoid upcoming import cycles
Don't import `pytest` from within some `_pytest` modules since an
upcoming commit will import from them into `pytest`.

It would have been nice not to have to do it, so that internal plugins
look more like external plugins, but with the existing layout this seems
unavoidable.
2020-11-07 18:08:30 +02:00
Ran Benita
c784c142a4 Merge pull request #7988 from bluetech/deprecate-yield-fixture
fixtures: deprecate pytest.yield_fixture()
2020-11-07 18:07:00 +02: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
Maximilian Cosmo Sitter
a73fb6e006 Add pythonenv* to gitignore 2020-11-06 14:29:12 +00:00
Bruno Oliveira
30287b49cd Deprecate --strict (#7985)
Fix #7530
2020-11-06 09:48:20 +01:00
Anthony Sottile
4cd0fde277 Merge pull request #8001 from bluetech/silence-pyparsing-warning
testing: silence deprecation warning from older pyparsing releases
2020-11-05 08:46:50 -08:00
Ran Benita
070f8e0f9d testing: silence deprecation warning from older pyparsing releases
This causes some tests to fail when using these older versions.
2020-11-05 16:08:54 +02:00
Ran Benita
1d4cc7eb36 Merge pull request #7997 from duthades/master
#7942 test_session.py migrate from testdir to Pytester
2020-11-05 15:55:36 +02: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
3adece9fb7 Merge pull request #7990 from bluetech/xunit-quadratic-3
unittest: fix quadratic behavior in collection of unittests using setUpClass/setup_method
2020-11-03 18:01:25 +02:00
Ran Benita
489f6f4499 unittest: fix quadratic behavior in collection of unittests using setUpClass/setup_method
This is similar to 50114d4731876dae; I missed that unittest does the
same thing.
2020-11-01 15:17:42 +02:00
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
8aa9ea95e1 ci: test on Python 3.9 final 2020-11-01 09:49:41 +02:00
Ran Benita
76226182ae ci: change cache action to v2
Supposed to be faster.
2020-11-01 09:49:41 +02:00
Ran Benita
f9d82a34f4 ci: replace deprecated ::set-env 2020-11-01 09:49:23 +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
Bruno Oliveira
2753859ff0 Merge pull request #7979 from nicoddemus/metafunc-ref
Add FunctionDefinition to the reference docs
2020-10-31 10:00:48 -03:00
Ran Benita
a14a229d1b Merge pull request #7982 from bluetech/symlink-collect
pathlib: fix symlinked directories not followed during collection
2020-10-31 14:46:50 +02:00
Karthikeyan Singaravelan
9a0f4e57ee Add support to display field names in namedtuple diffs. 2020-10-31 14:41:53 +02:00
Ran Benita
dd323980f9 Merge pull request #7978 from nicoddemus/port-4.6-release-notes
Manually add the remaining 4.6.x release notes to the changelog
2020-10-31 14:37:45 +02:00
Ran Benita
6cdae8ed40 pathlib: fix symlinked directories not followed during collection 2020-10-31 14:22:15 +02:00
Bruno Oliveira
569c091769 Add FunctionDefinition to the reference docs
Fix #7968
2020-10-31 08:45:34 -03:00
Bruno Oliveira
0c7233032f Manually add the remaining 4.6.x release notes to the changelog
Fix #7967
2020-10-31 08:36:26 -03: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
Ran Benita
5913cd20ec assertion/util: remove unhelpful type_fns indirection
It doesn't serve any purpose that I am able to discern.
2020-10-30 21:15:48 +02: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
Ran Benita
0cd190f037 Merge pull request #7970 from cmecklenborg/pytester_refactor_test_assertion
Migrate test_assertion.py from testdir to pytester
2020-10-30 20:56:21 +02:00
Christine Mecklenborg
47ff911c8f Migrate test_assertion.py from testdir to pytester 2020-10-29 20:39:44 -05:00
Ran Benita
8f52fc777a Merge pull request #7962 from bluetech/mypy-typed-deps
pre-commit: install typed dependencies in the mypy target
2020-10-29 17:52:12 +02:00
Ran Benita
65dfa98877 Merge pull request #7961 from bluetech/rm-checkqa-mypy
tox: remove checkqa-mypy environment
2020-10-29 17:25:51 +02: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
Ran Benita
e3ce5d6b53 pre-commit: install typed dependencies in the mypy target
Otherwise, mypy doesn't know about them and their types are considered
Any.
2020-10-28 22:22:33 +02:00
Ran Benita
de810152ec tox: remove checkqa-mypy environment
We run mypy through pre-commit, and we don't keep duplicate targets in
tox for all of the other linters. Since this adds some (small)
maintenance overhead, remove it.
2020-10-28 22:16:25 +02:00
Bruno Oliveira
b95991aeea Merge pull request #7960 from nicoddemus/cherry-pick-release
Merge pull request #7958 from pytest-dev/release-6.1.2
2020-10-28 14:36:37 -03:00
Bruno Oliveira
5711ced250 Merge pull request #7958 from pytest-dev/release-6.1.2
Prepare release 6.1.2

(cherry picked from commit 1ed903e8fc)
2020-10-28 14:23:09 -03:00
Christine M
8d369f73ba Migrate test_skipping.py from testdir to pytester (#7953) 2020-10-28 17:05:54 +02:00
Ran Benita
6cd6d9b61a Merge pull request #7949 from gcamargo1/gcamargo1-patch-1
Update doctest.rst
2020-10-28 15:56:59 +02:00
Vasilis Gerakaris
a431310c0a Increase temp dir deletion period to 3 days (#7914)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-10-28 08:23:35 -03: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
Gustavo Camargo
b308c6ddb3 Update doctest.rst 2020-10-26 14:30:00 -05:00
Ran Benita
0fe8a8dfe6 Merge pull request #7945 from proggga/fix_test_helpconfig_7942
#7942 test_helpconfig.py migrate from testdir to pytester
2020-10-26 17:52:41 +02:00
Mikhail Fesenko
cd9b3618c7 #7942 test_helpconfig.py migrate from testdir to pytester 2020-10-26 18:30:48 +03:00
Bruno Oliveira
20b710c4b4 Merge pull request #7948 from bluetech/testing-conftest-pytester
testing: make conftest stuff check for pytester not testdir
2020-10-26 12:08:19 -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
Ran Benita
096d096539 Merge pull request #7946 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.1.0
build(deps): bump pytest-django from 4.0.0 to 4.1.0 in /testing/plugins_integration
2020-10-26 14:36:49 +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
8105e60f20 Merge pull request #7937 from bluetech/testing-fixes
testing: fix pexpect hang
2020-10-25 16:53:03 +02:00
Ran Benita
ca82214444 pytester: workaround issue causing spawn to crash or hang
In pytester tests, pytest stashes & restores the sys.modules for each
test. So if the test imports a new module, it is initialized anew each
time.

Turns out the readline module isn't multi-init safe, which causes
pytester.spawn to crash or hang. So preserve it as a workaround.
2020-10-25 16:31:47 +02: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
65e6e39b76 Merge pull request #7931 from bluetech/xunit-quadratic-2
fixtures: fix quadratic behavior in the number of autouse fixtures
2020-10-25 01:24:38 +03:00
Ran Benita
470ea504e2 fixtures: fix quadratic behavior in the number of autouse fixtures
It turns out all autouse fixtures are kept in a global list, and thinned
out for a particular node using a linear scan of the entire list each
time.

Change the list to a dict, and only take the nodes we need.
2020-10-25 00:49:23 +03: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
Bruno Oliveira
f7d4f457d0 Merge pull request #7934 from symonk/small-adjustment-to-hookspec-docstrings
Replace term 'triple' with 'tuple' in hookspec docstrings
2020-10-24 08:01:05 -03:00
symonk
751575fa97 make some hookspec docstrings technically correct 2020-10-24 10:59:25 +01:00
Thomas Grainger
e14b724ff4 Update .github/ISSUE_TEMPLATE/2_feature_request.md 2020-10-23 22:35:56 +01:00
Bruno Oliveira
daa11ab9f1 Merge pull request #7930 from bluetech/pytester-doc-fixes
pytester: minor doc fixes
2020-10-23 17:21:22 -03:00
Ran Benita
0b14350f23 Merge pull request #7929 from bluetech/xunit-quadratic-1
python: fix quadratic behavior in collection of items using xunit fixtures
2020-10-23 23:10:25 +03:00
Ran Benita
50114d4731 python: fix quadratic behavior in collection of items using xunit fixtures
Since commit 0f918b1a9d pytest uses auto-generated autouse
pytest fixtures for the xunit fixtures
{setup,teardown}_{module,class,method,function}. All of these fixtures
were given the same name.

Unfortunately, pytest fixture lookup for a name works by grabbing all of
the fixtures globally declared with a name and filtering to only those
which match the specific node. So each xunit-using item iterates over a
list (of fixturedefs) of a size of all previous same-xunit-using items,
i.e. quadratic.

Fixing this properly to use a better data structure is likely to take
some effort, but we can avoid the immediate problem by just using
a different name for each item's autouse fixture, so it only matches
itself.

A benchmark is added to demonstrate the issue. It is still way too slow
after the fix and possibly still quadratic, but for a different reason
which is another matter.

Running --collect-only, before (snipped):

         202533232 function calls (201902604 primitive calls) in 86.379 seconds

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000   85.688   85.688 main.py:320(pytest_collection)
        1    0.000    0.000   85.688   85.688 main.py:567(perform_collect)
80557/556    0.021    0.000   85.050    0.153 {method 'extend' of 'list' objects}
85001/15001  0.166    0.000   85.045    0.006 main.py:785(genitems)
    10002    0.050    0.000   84.219    0.008 runner.py:455(collect_one_node)
    10002    0.049    0.000   83.763    0.008 runner.py:340(pytest_make_collect_report)
    10002    0.079    0.000   83.668    0.008 runner.py:298(from_call)
    10002    0.019    0.000   83.541    0.008 runner.py:341(<lambda>)
     5001    0.184    0.000   81.922    0.016 python.py:412(collect)
     5000    0.020    0.000   81.072    0.016 python.py:842(collect)
    30003    0.118    0.000   78.478    0.003 python.py:218(pytest_pycollect_makeitem)
    30000    0.190    0.000   77.957    0.003 python.py:450(_genfunctions)
    40001    0.081    0.000   76.664    0.002 nodes.py:183(from_parent)
    30000    0.087    0.000   76.629    0.003 python.py:1595(from_parent)
    40002    0.092    0.000   76.583    0.002 nodes.py:102(_create)
    30000    0.305    0.000   76.404    0.003 python.py:1533(__init__)
    15000    0.132    0.000   74.765    0.005 fixtures.py:1439(getfixtureinfo)
    15000    0.165    0.000   73.664    0.005 fixtures.py:1492(getfixtureclosure)
    15000    0.044    0.000   57.584    0.004 fixtures.py:1653(getfixturedefs)
    30000   18.840    0.001   57.540    0.002 fixtures.py:1668(_matchfactories)
 37507500   31.352    0.000   38.700    0.000 nodes.py:76(ischildnode)
    15000   10.464    0.001   15.806    0.001 fixtures.py:1479(_getautousenames)
112930587/112910019   7.333    0.000    7.339    0.000 {built-in method builtins.len}

After:

         51890333 function calls (51259706 primitive calls) in 27.306 seconds

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.000    0.000   26.783   26.783 main.py:320(pytest_collection)
        1    0.000    0.000   26.783   26.783 main.py:567(perform_collect)
80557/556    0.020    0.000   26.108    0.047 {method 'extend' of 'list' objects}
85001/15001  0.151    0.000   26.103    0.002 main.py:785(genitems)
    10002    0.047    0.000   25.324    0.003 runner.py:455(collect_one_node)
    10002    0.045    0.000   24.888    0.002 runner.py:340(pytest_make_collect_report)
    10002    0.069    0.000   24.805    0.002 runner.py:298(from_call)
    10002    0.017    0.000   24.690    0.002 runner.py:341(<lambda>)
     5001    0.168    0.000   23.150    0.005 python.py:412(collect)
     5000    0.019    0.000   22.223    0.004 python.py:858(collect)
    30003    0.101    0.000   19.818    0.001 python.py:218(pytest_pycollect_makeitem)
    30000    0.161    0.000   19.368    0.001 python.py:450(_genfunctions)
    30000    0.302    0.000   18.236    0.001 python.py:1611(from_parent)
    40001    0.084    0.000   18.051    0.000 nodes.py:183(from_parent)
    40002    0.116    0.000   17.967    0.000 nodes.py:102(_create)
    30000    0.308    0.000   17.770    0.001 python.py:1549(__init__)
    15000    0.117    0.000   16.111    0.001 fixtures.py:1439(getfixtureinfo)
    15000    0.134    0.000   15.135    0.001 fixtures.py:1492(getfixtureclosure)
    15000    9.320    0.001   14.738    0.001 fixtures.py:1479(_getautousenames)
2020-10-23 22:36:23 +03:00
Ran Benita
1c0c56dfb9 pytester: minor doc fixes 2020-10-23 21:01:31 +03:00
Emiel van de Laar
0d9e27a363 doc: Remove unused imports in examples (#7924)
The "os" imports in the `tmp_path` and `tmpdir` fixture examples are
unused and thus have been removed to prevent confusion.
2020-10-23 17:31:17 +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
Thomas Grainger
03363473f7 expand feature request issue template 2020-10-23 14:03:24 +01:00
Matthias Gabriel
e8504e04f3 Fix small typo in reference.rst (#7922)
Co-authored-by: Ronny Pfannschmidt <opensource@ronnypfannschmidt.de>
2020-10-22 07:11:49 -03:00
Bruno Oliveira
824e9cf67a Merge pull request #7917 from bluetech/ci-timeout
ci: decrease job timeout from 6 hours to 30 minutes
2020-10-21 08:02:30 -03:00
Ran Benita
fe69d0d680 ci: decrease job timeout from 6 hours to 30 minutes
We don't have any jobs that should go beyond that, so let's be nicer to
the CI host and quicker to report the failure.
2020-10-21 10:17:25 +03:00
Ran Benita
a66b6b857a Merge pull request #7915 from bluetech/fix-lf-package
cacheprovider: fix some files in packages getting lost from --lf
2020-10-21 10:12:32 +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
Bruno Oliveira
f453460ae7 Merge pull request #7912 from hugovk/rm-3.5 2020-10-19 10:27:49 -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
f61d4ed9d5 Merge pull request #7907 from bluetech/mypy-790
Update mypy 0.782 -> 0.790, iniconfig typing
2020-10-19 00:28:04 +03:00
Ran Benita
09e38b1697 runner: combine a sort+reverse to a sort(reverse=True)
Suggested by Zac-HD.
2020-10-19 00:02:01 +03:00
Ran Benita
1b23a111d2 Update mypy 0.782 -> 0.790 2020-10-17 19:25:45 +03:00
Ran Benita
e5e47c1097 Fix typing related to iniconfig
iniconfig now has typing stubs which reveal a couple issues.
2020-10-17 19:25:45 +03:00
Bruno Oliveira
0a258f534f Fix linting 2020-10-17 08:42:15 -03:00
Bruno Oliveira
f58d0a8c3d Merge pull request #7903 from ekrecker/patch-1
Fix typos
2020-10-17 08:41:10 -03:00
Nimesh Vashistha
991bc7bd50 Added note to writing_plugins.rst (#7896)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-10-17 08:26:30 -03:00
kwgchi
fc70fd23a2 Fix typos 2020-10-16 21:29:58 +09:00
Bruno Oliveira
b4c28dcaa2 Merge pull request #7893 from nicoddemus/testdir-docs-7892
List Testdir members in the docs
2020-10-14 10:34:49 -03:00
Prashant Sharma
5182c73fea Add example for registering multiple custom mark (#7886) 2020-10-14 15:17:50 +03:00
Bruno Oliveira
3cae145e41 List Testdir members in the docs
Also include docstrings pointing to the counterparts in Pytester.

Fix #7892
2020-10-13 12:01:11 -03:00
Bruno Oliveira
69419cb700 New pytester fixture (#7854) 2020-10-12 12:13:06 -03:00
Bruno Oliveira
cb578a918e Merge pull request #7883 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.2
build(deps): bump django from 3.1.1 to 3.1.2 in /testing/plugins_integration
2020-10-12 09:43:17 -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
Bruno Oliveira
3434488af4 Merge pull request #7882 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--2.0.2
build(deps): bump anyio[curio,trio] from 2.0.0 to 2.0.2 in /testing/plugins_integration
2020-10-12 09:38:54 -03:00
Ronny Pfannschmidt
cdaa1b52be Merge pull request #7884 from bluetech/release-on-comment-fixes
release-on-comment: add "Closes <release issue number>" to release PR
2020-10-11 10:49:45 +02:00
Ran Benita
008863aeb9 release-on-comment: add "Closes <release issue number>" to release PR 2020-10-10 19:01:41 +03: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
Ran Benita
55127b2142 Merge pull request #7879 from charlesaracil-ulti/ask_for_commit_after_in_contributing
ask for commit after changelog and authors file edit in contributing
2020-10-09 22:34:06 +03:00
Charles Aracil
2e322f183c ask for commit after changelog and authors file edit (#7878) 2020-10-09 16:10:54 +02:00
Zac Hatfield-Dodds
dbd082af96 Merge pull request #7874 from tanvimehta/master 2020-10-08 17:36:54 +11:00
Tanvi Mehta
d093931464 Added name to authors list 2020-10-07 22:57:52 -07:00
Tanvi Mehta
779b511bfe Fixed formatting 2020-10-07 22:25:27 -07:00
Tanvi Mehta
43b1eb3c9e Use instead of a in Issue #7868
Use `collections.Counter` instead of a `dict` in `terminal.py` Issue #7868
2020-10-07 21:51:28 -07:00
Kyle Altendorf
5acc55e838 Merge pull request #7872 from altendky/addini_takes_string
Document that Parser.addini() can take, and defaults to, 'string'
2020-10-07 19:12:54 -04:00
Kyle Altendorf
1630c37266 Added changelog/7872.doc.rst 2020-10-07 18:06:13 -04:00
Kyle Altendorf
76acb44330 Update tests to cover explicit None and "string" as addini() types 2020-10-07 17:56:54 -04:00
Kyle Altendorf
af3759a503 Parser.addini() can take and defaults to 'string' 2020-10-07 17:21:55 -04:00
Anthony Sottile
95917f8833 Merge pull request #7863 from asottile/py36_order_preserving_dict
py36+: remove _pytest.compat.order_preserving_dict
2020-10-06 08:35:38 -07: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
b6b75383ce py36+: remove _pytest.compat.order_preserving_dict 2020-10-06 00:22:09 -07:00
Anthony Sottile
f54ec30a6d Merge pull request #7862 from asottile/comm2ann
py36+: com2ann
2020-10-06 00:20:57 -07:00
Anthony Sottile
33d119f71a py36+: com2ann 2020-10-05 18:33:17 -07:00
William Jamir Silva
703e89134c Update reference.rst informing the default junit_family (#7860)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-10-05 14:04:37 -03: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
1c08f1dd0f Merge pull request #7844 from bluetech/typing-fixtures
fixtures: some type annotations, remove cyclic dependency
2020-10-04 17:41:33 +03:00
Bruno Oliveira
7581f0b3a1 Merge pull request #7853 from albertvillanova/doc-patch-1 2020-10-04 09:15:46 -03:00
Albert Villanova del Moral
8593b57666 Update link to numpy 2020-10-04 08:54:43 +02:00
Ran Benita
d0a3f1dcbc nodes: remove cyclic dependency on _pytest.fixtures
- Change the fixtures plugin to store its one piece of data on the node's
  Store instead of directly.

- Import FixtureLookupError lazily.
2020-10-04 09:44:45 +03:00
Ran Benita
bf09e7792f fixtures: some type annotations 2020-10-04 09:43:58 +03:00
Ran Benita
7f794b7aff Merge pull request #7851 from bluetech/cherry-pick-release
Merge pull request #7849 from pytest-dev/release-6.1.1
2020-10-03 22:57:41 +03:00
Anthony Sottile
66bd44c13a py36+: pyupgrade: py36+ 2020-10-03 12:46:54 -07:00
Anthony Sottile
b1bcb9fba8 Merge pull request #7850 from asottile/py36_pathlib_export
py36+: remove rexport of Path and PurePath
2020-10-03 12:43:25 -07:00
Ran Benita
fd74dd3dcb Merge pull request #7849 from pytest-dev/release-6.1.1
Prepare release 6.1.1

(cherry picked from commit 69d903260d)
2020-10-03 22:38:33 +03:00
Anthony Sottile
fb1d550aac py36+: remove rexport of Path and PurePath 2020-10-03 12:16:52 -07:00
Anthony Sottile
022ac9b9e8 Merge pull request #7846 from asottile/py36_black
py36+: update the target version of black to py36
2020-10-03 11:45:45 -07:00
Anthony Sottile
3b957c2244 Merge pull request #7845 from pytest-dev/py36_overload
py36+: remove _pytest.compat.overload
2020-10-03 11:45:29 -07:00
Hugo van Kemenade
133e8af4ee Merge pull request #7805 from hugovk/pytest-rerunfailures
Smoke test pytest-rerunfailures
2020-10-03 20:17:06 +03:00
Anthony Sottile
f295b0267d py36+: update the target version of black to py36 2020-10-03 08:17:22 -07:00
Anthony Sottile
7f0d2beb50 py36+: remove _pytest.compat.overload 2020-10-03 08:01:22 -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
Anthony Sottile
c2a197f351 Merge pull request #7839 from asottile/py36_compat_fspath
py36+: remove _pytest.compat.fspath
2020-10-03 07:42:54 -07:00
Ran Benita
5efddd32db Merge pull request #7826 from bluetech/doc-final
doc: patch Sphinx to detect our `@final` for marking classes as `final`
2020-10-03 13:29:17 +03:00
Ran Benita
7705e5e624 doc: patch Sphinx to detect our @final for marking classes as final
Thanks to Dominic Davis-Foster for code & assistance.
2020-10-03 13:13:14 +03: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
be43c7c67b py36+: remove _pytest.compat.fspath 2020-10-02 19:49:32 -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
ced0a52a87 Merge pull request #7837 from asottile/py36_union_pattern_match
py36+: remove workaround for Union[Pattern/Match] bug
2020-10-02 19:47:50 -07:00
Anthony Sottile
2c7b7d8f66 Merge pull request #7836 from asottile/py36_typing_X
py36+: replace typing.X with X
2020-10-02 19:47:42 -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
a6ef0f8f67 Merge pull request #7833 from asottile/py36_ModuleNotFoundError
py36+: remove _pytest.compat.MODULE_NOT_FOUND_ERROR
2020-10-02 19:47:18 -07:00
Anthony Sottile
7836c2c371 Merge pull request #7832 from asottile/py36_pathlib2
py36+: remove pathlib2 compatibility shim
2020-10-02 19:47:10 -07:00
Bruno Oliveira
6ee1eadd1c Fake setuptools-scm into using version 6.2.0a1
Due to pytest-rerunfailures latest version requiring 6.1.0, which is not
tagged on master.
2020-10-02 23:40:50 -03:00
Anthony Sottile
daba7ceb71 py36+: remove requires_ordered_markup 2020-10-02 15:06:59 -07:00
Anthony Sottile
e622cb7c41 py36+: remove workaround for Union[Pattern/Match] bug 2020-10-02 15:06:02 -07:00
Anthony Sottile
cf220b92a2 py36+: replace typing.X with X 2020-10-02 15:05:13 -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
Anthony Sottile
3c93eb0f04 py36+: remove pathlib2 compatibility shim 2020-10-02 14:59:07 -07:00
Anthony Sottile
325b988ca8 Merge pull request #7831 from asottile/py36_drop_in_CI
py36+: drop python3.5 in CI and setup.cfg
2020-10-02 14:55:02 -07:00
Anthony Sottile
179f4326df py36+: drop python3.5 in CI and setup.cfg 2020-10-02 14:00:11 -07:00
Max Voitko
cb0a13a523 Fix minor typos in doctest.rst (#7828) 2020-10-02 15:39:15 +02: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
3ecdad67b7 terminal: improve condition on whether to display testpaths in header
Make it match better the condition on whether testpaths is used (found
in config/__init__.py).
2020-09-29 15:23:47 +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
db08c7fbb0 pathlib: improve comments on commonpath and bestrelpath 2020-09-29 13:11:47 +03:00
Hugo van Kemenade
875f226d3b Smoke test pytest-rerunfailures 2020-09-29 12:47:46 +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
f324b27d02 Merge pull request #7748 from nicoddemus/fix-plugin-order-docs
Improve docs about plugin discovery/loading at startup
2020-09-27 13:19:58 +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
Anthony Sottile
28ba9ab737 Merge pull request #7801 from pytest-dev/fix-bot-typo
Fix typos in pytestbot
2020-09-26 15:53:14 -07:00
Hugo van Kemenade
14de6781d8 Fix typos in pytestbot 2020-09-26 23:46:58 +03:00
Ran Benita
e0ea00a70d Merge pull request #7798 from bluetech/cherry-pick-release
Cherry-pick 6.1.0 release notes
2020-09-26 21:24:11 +03:00
Ran Benita
19c78ab574 Merge pull request #7797 from pytest-dev/release-6.1.0
Prepare release 6.1.0

(cherry picked from commit 08a1ab3a8a)
2020-09-26 21:11:48 +03:00
Ran Benita
0b327cc75b Merge pull request #7796 from bluetech/changelog-cleanups
changelog: some consistency cleanups
2020-09-26 20:13:45 +03:00
Ran Benita
d3c746eb8e changelog: some consistency cleanups 2020-09-26 20:04:17 +03:00
Kamran Ahmad
d3f47bf346 Improved 'Declaring new hooks' section in docs. (#7782)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-09-23 11:15:55 -03:00
Bruno Oliveira
3db24893b4 Merge pull request #7784 from nicoddemus/use-new-pip-solver-7783
Use new pip resolver in plugins tox env
2020-09-23 09:32:02 -03:00
Bruno Oliveira
8215625135 Use new pip resolver in plugins tox env
Fix #7783
2020-09-23 09:16:48 -03:00
Ran Benita
5cfd7c0ddd Merge pull request #7780 from bluetech/final
Mark some public and to-be-public classes as `@final`
2020-09-23 13:42:11 +03:00
Ran Benita
a99ca879e7 Mark some public and to-be-public classes as @final
This indicates at least for people using type checkers that these
classes are not designed for inheritance and we make no stability
guarantees regarding inheritance of them.

Currently this doesn't show up in the docs. Sphinx does actually support
`@final`, however it only works when imported directly from `typing`,
while we import from `_pytest.compat`.

In the future there might also be a `@sealed` decorator which would
cover some more cases.
2020-09-22 12:40:40 +03:00
Bruno Oliveira
050c2df737 Use multiple issue template types and mention Discussions (#7739) 2020-09-21 20:22:25 +02:00
Bruno Oliveira
7324e90199 Update doc/en/writing_plugins.rst
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-09-19 16:14:28 -03:00
Bruno Oliveira
cdfdb3a25d Add docs about reusing fixtures from other projects (#7772)
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-09-19 16:10:22 -03:00
Ran Benita
8eefe4eaf5 Merge pull request #7741 from bluetech/releasing-order
RELEASING: ~~first merge PR, then tag~~ clarify where to push the tag
2020-09-19 22:01:00 +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
Ran Benita
027415502a RELEASING: clarify where to push the tag 2020-09-19 21:35:17 +03:00
Ran Benita
9f164b7227 Merge pull request #7766 from nicoddemus/backporting-docs
Add guidelines section about backporting
2020-09-19 21:18:41 +03:00
Ran Benita
4e460cdd9e Merge pull request #7773 from nicoddemus/xml-properties-xdist-docs
Warning about record_testsuite_property not working with xdist
2020-09-19 21:06:40 +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
c4ce5f2c98 Warning about record_testsuite_property not working with xdist
Related to #7767
2020-09-19 12:36:08 -03:00
Bruno Oliveira
9bfd14a443 Merge pull request #7749 from bluetech/fix-get_source-crash 2020-09-19 10:38:32 -03:00
Bruno Oliveira
895a8cf296 Add guidelines section about backporting
From https://github.com/pytest-dev/pytest/pull/7723#issuecomment-693310439
2020-09-17 10:06:04 -03:00
Bruno Oliveira
98608c439f Merge pull request #7760 from finn0/docs/punctuation-mark
[Docs] remove semi-colon punctuation mark
2020-09-16 12:42:20 -03:00
Faris A Chugthai
9ceb4e6efc Mistyped was mistyped (#7762) 2020-09-16 12:18:03 +02: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
Vipul Kumar
7470270f20 [Docs] remove semi-colon punctuation mark
Usually, we use semi-colon punctuation mark to connect closely related
ideas. Sentences which are after semicolon, begins with small letter,
and last sentence always ends with a period mark, see "Garner's Modern
American Usage" book for more information about usage of punctuation
mark. So removing punctuation mark altogether is a good idea, as
@gnikonorov suggested [1].

[1]: https://github.com/pytest-dev/pytest/pull/7760#pullrequestreview-489232607
2020-09-16 06:17:17 +00:00
Faris A Chugthai
cdf2024070 Update writing_plugins.rst (#7757)
Capitalize the first word in a sentence and add a period at the end.
2020-09-15 16:41:27 +02:00
Bruno Oliveira
f42c0cd1ec Merge pull request #7747 from nicoddemus/cmdline-flags-docs
Add full command-line flags to the reference docs
2020-09-14 13:47:43 -03:00
Bruno Oliveira
4b46db8ae5 Add full command-line flags to the reference docs
Fix #7728
2020-09-14 13:42:06 -03:00
Anthony Sottile
7f7e383daf Merge pull request #7753 from pytest-dev/asottile-patch-1
Update to deadsnakes/action@v2.0.0
2020-09-14 08:55:25 -07:00
Anthony Sottile
a5fd2895b6 Update to deadsnakes/action@v2.0.0
should be a noop (despite the major version bump) -- I rewrote the action to be more stable and need fewer security updates
2020-09-13 12:55:56 -07:00
Anthony Sottile
bc0020ad96 Merge pull request #7750 from pytest-dev/graingert-patch-1
permit tox config in non-tox.ini files for pytest-dev member projects
2020-09-13 09:37:35 -07:00
Anthony Sottile
e04bc05e7e Merge pull request #7751 from pytest-dev/graingert-patch-2
remove unused bitbucket link
2020-09-12 20:16:38 -07:00
Thomas Grainger
51752108b8 remove unused bitbucket link 2020-09-13 03:02:10 +01:00
Thomas Grainger
24c26a046e permit tox config in non-tox.ini files for pytest-dev member projects 2020-09-13 00:41:00 +01: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
Ran Benita
35350e11cd assertion/rewrite: rewrite condition to be easier to follow 2020-09-12 22:57:50 +03:00
Bruno Oliveira
541b30a044 Improve docs about plugin discovery/loading at startup
Fix #7691
2020-09-12 14:11:43 -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
Bruno Oliveira
ec58ae5bae Merge pull request #7736 from nicoddemus/extend-fixture-parametrize-1953 2020-09-12 08:08:31 -03:00
Anthony Sottile
96a17b1683 Fix INTERNALERROR when accessing locals / globals with faulty exec 2020-09-11 18:13:48 -07:00
Ran Benita
389e30283c Merge pull request #7744 from bluetech/cherry-pick-release
Merge pull request #7720 from pytest-dev/release-6.0.2
2020-09-12 02:21:41 +03:00
Ran Benita
e0dd2111a0 Merge pull request #7720 from pytest-dev/release-6.0.2
Prepare release 6.0.2

(cherry picked from commit fe69bd5baf)
2020-09-12 02:05:47 +03:00
Bruno Oliveira
e36adbaadc Use ParameterSet to extract argnames from parametrize mark 2020-09-11 16:53:34 -03: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
78ed3e48db Merge pull request #7729 from bluetech/doc-fix-crossrefs
doc: fix a few broken cross references
2020-09-11 12:44:29 +03:00
Bruno Oliveira
9c0e0c756a Merge pull request #7734 from pytest-dev/asottile-patch-1
Update pytest-dev requirements
2020-09-09 10:37:03 -03:00
Joseph Lucas
6ae0f741ef Add example for __test__ (#7733)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-09-09 10:33:39 -03:00
Anthony Sottile
7da6ebede0 Update pytest-dev requirements
- be more vague about "packaging metadata" over explicitly mentioning `setup.py`
  (such that `pyproject.toml`-based distributions are allowed)
- drop extensions on `README.txt` / `LICENSE.txt` (it's more common to have `.md`
  / `.rst` / no extension)
- remove duplicate mention of license packaging metadata
2020-09-08 09:52:59 -07:00
Ran Benita
e503c9a9f8 doc: fix broken cross references 2020-09-06 19:06:43 +03:00
Anthony Sottile
4df39e3a1d Merge pull request #7722 from The-Compiler/update-trainings
doc: Remove Workshoptage training
2020-09-05 18:00:34 -07:00
Florian Bruhin
5bdfd719e6 doc: Remove Workshoptage training
The sign-up is closed.
2020-09-05 18:11:23 +02:00
Sorin Sbarnea
1df2471f17 Make min duration configurable for slowest tests (#7667)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-09-05 09:18:29 -03:00
Bruno Oliveira
54f7a87ea8 Merge pull request #7714 from bluetech/doc-prefer-public
doc: prefer to reference by public name when possible
2020-09-04 20:39:03 -03:00
Bruno Oliveira
db12d79c2a Merge pull request #7713 from bluetech/doc-one-pm
doc/reference: include PluginManager in PytestPluginManager and remove it
2020-09-04 20:38:20 -03:00
Bruno Oliveira
44fc0192bc Merge pull request #7719 from nicoddemus/fix-release-script
Use tox to execute release script
2020-09-04 18:45:29 -03:00
Bruno Oliveira
5371be4cf6 Use tox to execute release script
The release-on-comment script is always executed on *master*, so we should
execute the `release.py` script using tox to ensure we create the
right environment.

Also fixed errors in the error handling code.
2020-09-04 18:35:54 -03:00
Ran Benita
0ca2327069 doc: prefer to reference by public name when possible
When a name is exported from `pytest`, prefer to refer to it by that
rather than its `_pytest` import path. It is shorter and more
appropriate in user-facing documentation (although that's not really
visible).

Our plan is to expose more names for typing purposes, in which can this
could be more comprehensive.
2020-09-04 20:46:15 +03:00
Ran Benita
48a8c373a0 doc/reference: include PluginManager in PytestPluginManager and remove it
Before, `PluginManager` was a copy of the pluggy doc, and
`PytestPluginManager` was documented separately.

pytest users only really need to know about `PytestPluginManager`, so
instead of splitting have the `PytestPluginManager` documentation
include all of `PluginManager` members and remove `PluginManager` from
the reference (it is still shown as the base class).
2020-09-04 20:14:39 +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
Ran Benita
a346028006 config: add Config.{rootpath,inipath}, turn Config.{rootdir,inifile} to properties 2020-09-04 18:04:25 +03:00
Ran Benita
3085c99e47 config: small doc improvements 2020-09-04 18:04:25 +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
Anthony Sottile
91dbdb6093 Merge pull request #7698 from bluetech/rm-scopedproperty
fixture: remove `@scopeproperty`
2020-08-28 17:26:10 -07:00
Bruno Oliveira
877c62166a Merge pull request #7699 from bluetech/optimize-makeitem
python: small optimization in PyCollector.collect()
2020-08-28 09:53:00 -03:00
Bruno Oliveira
21aa6c42b7 Merge pull request #7697 from nicoddemus/file-docs 2020-08-28 09:52:02 -03:00
Bruno Oliveira
ceea6000ba Add missing File reference to the docs
As related in #7696
2020-08-28 08:49:22 -03:00
Ran Benita
12de92cd2b fixture: remove @scopeproperty
I think the straight code is easier to understand.
2020-08-28 10:02:02 +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
2fcf763d7e Merge pull request #7671 from bluetech/ignored-names
RFC: python: skip work pytest_pycollect_makeitem work on certain names
2020-08-27 10:03:09 +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
Bruno Oliveira
8730a7bb14 Merge pull request #7687 from bluetech/idval-notset
python: fix empty parametrize() leading to "NotSetType.token" id
2020-08-25 19:48:26 -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
Florian Bruhin
00996adeb8 Update talks/trainings page (#7661)
* Update talks/trainings page

- Remove past webinar
- Add new open training
- Add some talks/webinars by Oliver Bestwalter and by me
- Remove some stale link targets

* Move sidebar to index
2020-08-25 17:02:33 +02:00
Ran Benita
ff41e7ad5d Merge pull request #7670 from bluetech/session-inline
Start simplifying collection code in Session
2020-08-25 10:28:07 +03:00
Ran Benita
c1f975668e main: couple of code simplifications 2020-08-24 18:15:11 +03:00
Ran Benita
023f0510af main: move collection cache attributes to local variables in collect()
They are only used for the duration of this function.
2020-08-24 18:15:11 +03:00
Ran Benita
c867452488 main: inline matchnodes() into collect()
Now all of the logic is in one place and may be simplified and
refactored in more sensible way.
2020-08-24 18:15:11 +03:00
Ran Benita
d0e8b71404 main: inline _collect() into collect()
This removes an unhelpful level of indirection and enables some upcoming
upcoming simplifications.
2020-08-24 18:15:11 +03:00
Ran Benita
eec13ba57e main: get rid of NoMatch
Things are easier to understand without the weird exception.
2020-08-24 18:15:11 +03:00
Ran Benita
c4fd461617 main: better name for _collection_node_cache3
The weird name was due to f3967333a1, now
that I understand it a bit better can give it a more descriptive name.
2020-08-24 18:15:11 +03:00
Ran Benita
c2256189ae main: make matchnodes non-recursive
It's a little more sane this way.
2020-08-24 18:15:11 +03:00
Ran Benita
841521fedb main: only perform one recursive matchnodes call per node 2020-08-24 18:15:11 +03:00
Ran Benita
0c6b2f39b2 main: move NoMatch raising to _collect()
This is a more sensible interface for matchnodes.

This also fixes a sort-of bug where a recursive call to matchnodes
raises NoMatch which would terminate the entire tree, even if other
branches may find a match. Though I don't think it's actually possible.
2020-08-24 18:15:11 +03:00
Ran Benita
a2c919d350 main: refactor a bit to reduce indentation 2020-08-24 18:15:11 +03:00
Ran Benita
adaec2da90 main: remove impossible condition in matchnodes
Already covered in a condition above.
2020-08-24 18:15:11 +03:00
Ran Benita
1b2de81404 main: remove unneeded condition in matchnodes
The end result in the `else` branch is the same, but flows naturally.
2020-08-24 18:15:11 +03:00
Ran Benita
5356a0979a main: small code simplification in matchnodes 2020-08-24 18:15:11 +03:00
Ran Benita
0b41b79dcb main: better solution to a type ignore 2020-08-24 18:15:11 +03:00
Ran Benita
57aca11d4a hookspec: type annotate parent argument to pytest_collect_file 2020-08-24 18:15:11 +03:00
Ran Benita
4b8e1a1771 Revert "Move common code between Session and Package to FSCollector"
This reverts commit f10ab021e2.

The commit was good in that it removed a non-trivial amount of code
duplication. However it was done in the wrong layer (nodes.py) and split
up a major part of the collection (the filesystem traversal) to a
separate class making it harder to understand.

We should try to reduce the duplication, but in a more appropriate
manner.
2020-08-24 18:15:11 +03:00
Ran Benita
32edc4655c main: inline Session._matchnodes() into Session.matchnodes()
Similar to the previous commit, this makes things more straightforward.
2020-08-24 18:15:11 +03:00
Ran Benita
d121d7c917 main: inline Session._perform_collect() into perform_collect()
It doesn't add much, mostly just an eye sore, particularly with the
overloads.
2020-08-24 18:15:10 +03:00
Ran Benita
1dad5c6433 Merge pull request #7669 from bluetech/collection-doc
hookspec: improve collection phase documentation a bit
2020-08-24 14:57:37 +03:00
Ran Benita
172b6e15c5 hookspec: improve collection phase documentation a bit
Make it a bit more accurate and use the same format that
pytest_runtest_protocol uses.
2020-08-24 13:00:09 +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
Bruno Oliveira
6cf89338d3 Merge pull request #7677 from bluetech/flaky-no-tests-ran
testing: fix flaky test when executed slowly
2020-08-23 09:25:26 -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
Bruno Oliveira
d69abff2c7 Merge pull request #7660 from nicoddemus/deprecated-features 2020-08-19 09:04:10 -03:00
Bruno Oliveira
372a094005 PytestDeprecationWarning no longer a hard error 2020-08-19 08:14:28 -03:00
Bruno Oliveira
7605150eaa Move --no-print-logs removal notice to 'Removed Features' 2020-08-19 08:14:28 -03:00
Bruno Oliveira
ef946d557c Remove resultlog plugin 2020-08-19 08:14:28 -03:00
Bruno Oliveira
b32c48ee05 Add bottom changelog deprecation notice 2020-08-19 08:14:28 -03:00
Bruno Oliveira
52b0cc4f19 Remove broken pytest_collect_directory hook 2020-08-19 08:14:25 -03:00
Bruno Oliveira
457d351941 Remove deprecated TerminalReporter.writer property 2020-08-19 08:13:34 -03:00
Bruno Oliveira
345a59dd53 Add note about pytest.collect deprecation 2020-08-19 08:13:06 -03:00
Bruno Oliveira
6ecbd008c4 Change junit_family default to xunit2 2020-08-19 08:13:06 -03:00
Bruno Oliveira
73e06373dc Hard failure when constructing Node subclasses 2020-08-19 08:13:03 -03:00
Bruno Oliveira
c747dc5248 Drop support for positional arguments in @pytest.fixture 2020-08-19 08:11:42 -03:00
Bruno Oliveira
98530184a5 Remove funcargnames compatibility property 2020-08-19 08:11:39 -03:00
Ran Benita
c98525bd21 Merge pull request #7648 from bluetech/pylint-abc2
Only define gethookproxy, isinitpath on Session
2020-08-18 15:45:11 +03:00
Bruno Oliveira
afa4760cb8 Merge pull request #7643 from nicoddemus/issue-7628 2020-08-17 16:58:56 -03:00
Ran Benita
0d5a65091d capture: fix disabled()/global_and_fixture_disabled() enabling capturing when it was disabled
The `CaptureManager.global_and_fixture_disabled()` context manager (and
`CaptureFixture.disabled()` which calls it) did `suspend(); ...;
resume()` but if the capturing was already suspended, the `resume()`
would resume it when it shouldn't.

This caused caused some messages to be swallowed when `--log-cli` is
used because it uses `global_and_fixture_disabled` when capturing is not
necessarily resumed.
2020-08-16 23:21:45 +03:00
Bruno Oliveira
b426bb3443 Refactor Session._parsearg into a separate function for testing 2020-08-15 13:23:55 -03:00
Bruno Oliveira
2213016e40 Fix Module.name from full path without drive letter
Fix #7628
2020-08-15 09:39:14 -03:00
Bruno Oliveira
3f0abcc6a5 Merge pull request #7639 from nicoddemus/issue-7638 2020-08-15 09:17:37 -03:00
Ran Benita
eddd993cf4 Only define gethookproxy, isinitpath on Session
This fixes an issue where pylint complains about missing implementations
of abstract methods in subclasses of `File` which only override
`collect()` (as they should).

It is also cleaner and makes sense, these methods really don't need to
be overridden.

The previous methods defined directly on `FSCollector` and `Package` are
deprecated, to be removed in pytest 7.

See commits e2934c3f8c and
f10ab021e2 for reference.
2020-08-15 13:40:16 +03:00
Bruno Oliveira
f76b162263 Add ref to Python bug 2020-08-14 11:36:07 -03:00
Ran Benita
d426a79a90 Merge pull request #7645 from bluetech/pylint-abc
Don't use NotImplementedError in `@overload`s
2020-08-14 15:33:35 +03:00
Ran Benita
f28af14457 Don't use NotImplementedError in @overloads
We used it as a shortcut for avoiding coverage, but pylint has a special
interpretation of it as an abstract method which we don't want.
2020-08-14 13:54:46 +03:00
Ran Benita
2c5403b951 Merge pull request #7644 from bluetech/changelog-7631
Add changelog for PR #7631
2020-08-14 11:54:31 +03:00
Ran Benita
8056a677b4 Add changelog for PR #7631 2020-08-14 11:02:44 +03:00
Thomas Grainger
02c6e4455c document toml use of filterwarnings (#7611)
and include a demo of toml 'literal strings'

Update doc/en/warnings.rst
Apply suggestion by Ran
Fix linting

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-08-14 10:08:17 +03:00
Bruno Oliveira
10f98e1d2f Merge pull request #7641 from hynek/patch-1
Replace inactive Azure Pipelines badge with GHA
2020-08-13 11:49:45 -03:00
Hynek Schlawack
82181fde3e Replace inactive Azure Pipelines badge with GHA
Currently the badge encourages you to set it up now. :)
2020-08-13 14:18:36 +02:00
Bruno Oliveira
36c8bb492e get_dirs_from_args handles paths with invalid syntax
Fix #7638
2020-08-12 17:20:09 -03:00
Maximilian Cosmo Sitter
15d8293241 Remove faq.rst from docs (#7635) 2020-08-12 14:47:34 -03:00
Ran Benita
4c92584364 Merge pull request #7631 from bluetech/capture-1
capture: add type annotations to CaptureFixture
2020-08-10 18:38:05 +03:00
Ran Benita
acc9310c17 capture: add type annotations to CaptureFixture
It now has a str/bytes type parameter.
2020-08-10 18:14:47 +03:00
Ran Benita
8a66f0a96d capture: overcome a mypy limitation by making CaptureResult a regular class
See the code comment for the rationale.
2020-08-10 18:14:47 +03:00
Bruno Oliveira
bee72e1925 Merge pull request #7629 from samestep/patch-1
Fix typos in Ali Afshar's name
2020-08-07 20:02:26 -03:00
Sam Estep
a27c539a85 Fix typos in Ali Afshar's name
The correct name is visible in the Bitbucket link.
2020-08-07 15:22:10 -07:00
Ran Benita
384b6f6866 Merge pull request #7619 from bluetech/py-to-pathlib
Some py.path -> pathlib conversions
2020-08-07 11:33:21 +03:00
Ran Benita
f8c4e038fd Replace some usages of py.path.local 2020-08-06 18:46:17 +03:00
Ran Benita
70f3ad1c1f config/findpaths: convert from py.path.local to pathlib 2020-08-06 18:46:17 +03:00
Ran Benita
9e55288ba4 pathlib: add absolutepath() as alternative to Path.resolve()
Didn't call it absolute or absolute_path to avoid conflicts with
possible variable names.

Didn't call it abspath to avoid confusion with os.path.abspath.
2020-08-06 18:16:04 +03:00
Ran Benita
e0d0951945 pathlib: add analogues to py.path.local's bestrelpath and common
An equivalent for these py.path.local functions is needed for some
upcoming py.path -> pathlib conversions.
2020-08-06 18:16:04 +03:00
Ran Benita
aa9905d72e Merge pull request #7625 from nicoddemus/pypy3-async-unittest-7624
Fix test_plain_unittest_does_not_support_async on pypy3
2020-08-06 08:31:46 +03:00
Bruno Oliveira
67cb7ef673 Fix test_plain_unittest_does_not_support_async on pypy3
Fix #7624
2020-08-05 15:24:08 -03:00
Rüdiger Busche
a64298ff5e Document registering markers in pyproject.toml (#7622)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-08-05 12:03:27 -03:00
Bruno Oliveira
44cd8a3a86 Demonstrate that plain unittest does not support async tests (#7607)
Co-authored-by: Ran Benita <ran@unusedvar.com>
2020-08-04 19:37:41 -03:00
Ran Benita
2bd0d97fcc Merge pull request #7601 from bluetech/typing-longrepr
typing: resultlog, pytester, longrepr
2020-08-04 23:23:56 +03:00
Ran Benita
fbf251f11d Improve typing of reports' longrepr field 2020-08-04 22:52:24 +03:00
Ran Benita
f0eb82f7d4 pytester: improve type annotations 2020-08-04 22:46:30 +03:00
Ran Benita
62ddf7a0e5 resultlog: add missing type annotations 2020-08-04 22:45:46 +03:00
Ran Benita
303030c141 Merge pull request #7613 from bluetech/typing-warn-unreachable
typing: set warn_unreachable
2020-08-04 22:44:21 +03:00
Bruno Oliveira
0d65e4b454 Merge pull request #7606 from nicoddemus/pre-release-docs
Add docs for releasing major/release candidates
2020-08-04 15:37:19 -03:00
Yutaro Ikeda
84c4b64354 Better document -k partial matching (#7610) 2020-08-04 15:30:08 -03:00
Bruno Oliveira
d688fefecb Merge pull request #7614 from The-Compiler/log-print
Properly remove log_print
2020-08-04 13:39:21 -03:00
Ran Benita
9ab14c6d9c typing: set warn_unreachable
This makes mypy raise an error whenever it detects code which is
statically unreachable, e.g.

    x: int
    if isinstance(x, str):
        ... # Statement is unreachable  [unreachable]

This is really neat and finds quite a few logic and typing bugs.

Sometimes the code is intentionally unreachable in terms of types, e.g.
raising TypeError when a function is given an argument with a wrong
type. In these cases a `type: ignore[unreachable]` is needed, but I
think it's a nice code hint.
2020-08-04 09:59:46 +03:00
Florian Bruhin
1c9b84756f Properly remove log_print
This is a follow up to 3f8200676f which didn't
make it clear that log_print is also removed in the changelog and didn't remove
it from the reference docs.
2020-08-04 08:53:09 +02:00
Ran Benita
0dd5e169d0 Merge pull request #7603 from bluetech/flake8-docstrings
Enforce some pydocstyle lints with flake8-docstrings & docstring fixes in testing/
2020-08-04 08:15:55 +03:00
Ran Benita
9a18b57c7c Enforce some pydocstyle lints with flake8-docstrings
There are some ones we *would* like to enforce, like
    D401 First line should be in imperative mood
but have too many false positives, so I left them out.
2020-08-03 10:21:59 +03:00
Ran Benita
b8471aa527 testing: fix some docstring issues
In preparation for enforcing some docstring lints.
2020-08-03 10:10:43 +03:00
Anthony Sottile
701998bf2c Merge pull request #7598 from nicoddemus/setuptools-scm-pyproject
Configure setuptools_scm using pyproject.toml
2020-08-01 19:17:33 -07:00
Ran Benita
be354b36f3 Merge pull request #7604 from bluetech/typing-disallow-any-generics
typing: set disallow_any_generics
2020-08-01 20:55:45 +03:00
Ran Benita
be656dd4e4 typing: set disallow_any_generics
This prevents referring to a generic type without filling in its generic
type parameters.

The FixtureDef typing might need some more refining in the future.
2020-08-01 20:39:15 +03:00
Bruno Oliveira
d1fa749b83 Add readthedocs config file to use pip for installation 2020-08-01 14:21:36 -03:00
Bruno Oliveira
d7ad55bb2a Add docs for releasing major/release candidates
Fix #7447
2020-08-01 13:51:12 -03:00
Ran Benita
1e9c638468 Merge pull request #7602 from ctb/patch-1
Minor formatting fix in xunit_setup.rst
2020-08-01 18:08:03 +03:00
C. Titus Brown
a2d562d369 Minor formatting fix in xunit_setup.rst
Fixed location of double-backquote for verbatim text.
2020-08-01 07:33:03 -07:00
Ran Benita
49827adcb9 Merge pull request #7510 from bluetech/docstrings
Format docstrings in a consistent style
2020-08-01 17:32:01 +03:00
Ran Benita
cbec0f8c6a CONTRIBUTING: document the docstring style we use 2020-08-01 17:14:38 +03:00
Ran Benita
0242de4f56 Format docstrings in a consistent style 2020-08-01 17:14:37 +03:00
Bruno Oliveira
6882c0368b Merge pull request #7593 from bluetech/typing-no-implicit-reexport
typing: set no_implicit_reexport
2020-08-01 11:03:47 -03:00
Bruno Oliveira
07f7372aff Merge pull request #7586 from nicoddemus/cp-release
Merge pull request #7584 from pytest-dev/release-6.0.1
2020-08-01 11:00:38 -03:00
Anthony Sottile
d5a49100cf Try this maybe? 2020-07-31 21:44:44 -07:00
Bruno Oliveira
4f0793a462 Require setuptools >=42 2020-07-31 18:17:12 -03:00
Bruno Oliveira
09265eb7c7 Configure setuptools_scm using pyproject.toml 2020-07-31 15:46:02 -03:00
Ran Benita
a1ba8dfe2a Merge pull request #7587 from bluetech/rm-more-itertools
Stop using more-itertools
2020-07-31 13:08:34 +03:00
Ran Benita
8d98de8f8a typing: set no_implicit_reexport
In Python, if module A defines a name `name`, and module B does `import
name from A`, then another module C can `import name from B`.

Sometimes it is intentional -- module B is meant to "reexport" `name`.
But sometimes it is just confusion/inconsistency on where `name` should
be imported from.

mypy has a flag `--no-implicit-reexport` which puts some order into
this. A name can only be imported from a module if

1. The module defines the name
2. The module's `__all__` includes the name
3. The module imports the name as `from ... import .. as name`.

This flag is included in mypy's `--strict` flag.

I like this flag, but I realize it is a bit controversial, and in
particular item 3 above is a bit unfriendly to contributors who don't
know about it. So I didn't intend to add it to pytest.

But while investigating issue 7589 I came upon mypy issue 8754 which
causes `--no-implicit-reexport` to leak into installed libraries and
causes some unexpected typing differences *in pytest* if the user uses
this flag.

Since the diff mostly makes sense, let's just conform to it.
2020-07-31 10:09:11 +03:00
Ran Benita
96a48f0c66 Stop using more-itertools
We barely use it; the couple places that do are not really worth the
extra dependency, I think the code is clearer without it.

Also simplifies one (regular) itertools usage.

Also improves a check and an error message in `pytest.raises`.
2020-07-30 20:19:24 +03:00
Bruno Oliveira
e49f1d6f60 Merge pull request #7584 from pytest-dev/release-6.0.1
Prepare release 6.0.1

(cherry picked from commit 022bff27a7)
2020-07-30 09:46:53 -03:00
Ran Benita
645cbc91fc Merge pull request #7581 from bluetech/logging-setlevel-handler-restore
Add missing changelog for issue 7569
2020-07-30 13:41:02 +03:00
Ran Benita
924e466c98 Add missing changelog for issue 7569 2020-07-30 12:38:40 +03:00
Hugo van Kemenade
d756b4a543 Fix typo: remove stray indefinite article from release notes (#7552)
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-07-29 12:19:33 -03:00
Mattreex
1e66ed0b1c Warn about --basetemp removing the entire directory (#7555)
Co-authored-by: mattreex <mattreex.9@gail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-07-29 11:58:18 -03:00
Bruno Oliveira
49628786f0 Merge pull request #7575 from nicoddemus/fix-changelog-entries-release-process 2020-07-29 11:56:11 -03:00
Bruno Oliveira
22acbaf393 Minor changes to the release process
As discussed in https://github.com/pytest-dev/pytest/pull/7556
2020-07-29 11:35:27 -03:00
Bruno Oliveira
e691d3ee52 Merge remote-tracking branch 'upstream/6.0.x' into fix-changelog-entries-release-process 2020-07-29 11:27:08 -03:00
Bruno Oliveira
095bf191e2 Merge pull request #7561 from nicoddemus/longreprtext-7559 2020-07-29 09:47:04 -03:00
Bruno Oliveira
cefe064bb0 Merge pull request #7571 from bluetech/logging-setlevel-handler-restore
logging: fix capture handler level not reset on teardown after caplog.set_level()
2020-07-29 09:37:57 -03:00
Bruno Oliveira
d3267bc49d Fix TestReport.longreprtext when TestReport.longrepr is not a string
Fix #7559
2020-07-29 09:31:15 -03:00
Ran Benita
0e0275d8d9 logging: fix capture handler level not reset on teardown after caplog.set_level()
This probably regressed in fcbaab8.
2020-07-29 14:59:29 +03:00
Ran Benita
422685d0bd Merge pull request #7567 from bluetech/pylint-callable-2-space
mark: fix extraneous spaces in dummy type-checking marks
2020-07-29 12:40:21 +03:00
Ran Benita
b473e515bc Merge pull request #7541 from bluetech/py-visit
pathlib: stop using py.path.local.visit(), use os.scandir
2020-07-29 12:04:06 +03:00
Ran Benita
20a3a28815 Merge pull request #7536 from bluetech/junitxml-etree
junitxml: convert from py.xml to xml.etree.ElementTree
2020-07-29 12:01:33 +03:00
Ran Benita
54e08b7230 mark: fix extraneous spaces in dummy type-checking marks 2020-07-29 11:58:54 +03:00
Ran Benita
f9837f953c Merge pull request #7565 from bluetech/pylint-callable-2
mark: fix pylint not-callable error on pytest.mark.parametrize(...), again
2020-07-29 11:49:41 +03:00
Ran Benita
c755840793 pre-commit: extend list of rejected py modules
We now only use `py.path.local`.
2020-07-29 10:52:21 +03:00
Ran Benita
f86e4516eb junitxml: convert from py.xml to xml.etree.ElementTree
Part of the effort to reduce dependency on the py library.

Besides that, py.xml implements its own XML serialization which is
pretty scary.

I tried to keep the code with minimal changes (though it could use some
cleanups). The differences in behavior I have noticed are:

- Attributes in the output are not sorted.

- Some unneeded escaping is no longer performed, for example escaping
  `"` to `&quot;` in a text node.
2020-07-29 10:52:21 +03:00
Ran Benita
1653c49b1b junitxml: simplify bin_xml_escape
1. Remove sys.maxunicode check & comment. Nowadays it is always a
   constant 0x10ffff.
2. Pre-generate the pattern. Possible due to 1.
3. Compile the regex lazily. No reason to pay startup cost for it.
4. Add docstring in particular to explain a subtle point.
2020-07-29 10:52:21 +03:00
Ran Benita
6ea6f0dac8 junitxml: compile a regex lazily
Instead of slowing down startup, and making the code harder to follow,
compile it lazily (it is still cached internally).
2020-07-29 10:52:21 +03:00
hp310780
27a4c6cd6d Fix --help crash on add_ini(.., help='') and improve message on help=None (#7427) 2020-07-29 10:48:38 +03:00
Ran Benita
b36bcd13e9 mark: fix pylint not-callable error on pytest.mark.parametrize(...), again
Apparently the previous fix c1ca42b5c2 didn't work.
Hopefully this time I'm testing this correctly.
2020-07-29 10:39:13 +03:00
Drew Devereux
88cc636c18 Update markers.rst (#7563)
Extra colon to make code block render correctly
2020-07-29 09:10:13 +02:00
Bruno Oliveira
c7216ae0f6 Merge pull request #7557 from nicoddemus/announce-templates 2020-07-28 21:20:26 -03:00
Bruno Oliveira
df09a31646 Merge pull request #7556 from nicoddemus/cherry-pick-release
Merge pull request #7550 from pytest-dev/release-6.0.0
2020-07-28 21:04:26 -03:00
Bruno Oliveira
109b6cb32c Update text and links in announce templates
The links were still pointing to the latest version (instead of stable)
and also took the opportunity to update the text a bit.
2020-07-28 17:29:09 -03:00
Bruno Oliveira
70764bef4f Merge pull request #7550 from pytest-dev/release-6.0.0 2020-07-28 17:01:27 -03:00
Ran Benita
3633b691d8 pathlib: make visit() independent of py.path.local, use os.scandir
`os.scandir()`, introduced in Python 3.5, is much faster than
`os.listdir()`. See https://www.python.org/dev/peps/pep-0471/.

It also has a `DirEntry` which can be used to further reduce syscalls in
some cases.
2020-07-25 00:47:29 +03:00
Ran Benita
c15bb5d3de pathlib: replace py.path.local.visit() with our own function
Part of reducing dependency on `py`. Also enables upcoming improvements.

In cases where there are simpler alternatives (in tests), I used those.

What's left are a couple of uses in `_pytest.main` and `_pytest.python`
and they only have modest requirements, so all of the featureful code
from py is not needed.
2020-07-25 00:26:49 +03:00
390 changed files with 51613 additions and 22833 deletions

View File

@@ -25,5 +25,7 @@ exclude_lines =
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
^\s*assert False(,|$)
^\s*assert_never\(
^\s*if TYPE_CHECKING:
^\s*@overload( |$)

View File

@@ -1,10 +1,16 @@
---
name: 🐛 Bug Report
about: Report errors and problems
---
<!--
Thanks for submitting an issue!
Here's a quick checklist for what to provide:
Quick check-list while reporting bugs:
-->
- [ ] a detailed description of the bug or suggestion
- [ ] a detailed description of the bug or problem you are having
- [ ] output of `pip list` from the virtual environment you are using
- [ ] pytest and operating system versions
- [ ] minimal example if possible

View File

@@ -0,0 +1,25 @@
---
name: 🚀 Feature Request
about: Ideas for new features and improvements
---
<!--
Thanks for suggesting a feature!
Quick check-list while suggesting features:
-->
#### What's the problem this feature will solve?
<!-- What are you trying to do, that you are unable to achieve with pytest as it currently stands? -->
#### Describe the solution you'd like
<!-- A clear and concise description of what you want to happen. -->
<!-- Provide examples of real-world use cases that this would enable and how it solves the problem described above. -->
#### Alternative Solutions
<!-- Have you tried to workaround the problem using a pytest plugin or other tools? Or a different approach to solving this issue? Please elaborate here. -->
#### Additional context
<!-- Add any other context, links, etc. about the feature here. -->

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ❓ Support Question
url: https://github.com/pytest-dev/pytest/discussions
about: Use GitHub's new Discussions feature for questions

View File

@@ -13,7 +13,7 @@ If this change fixes an issue, please:
Unless your change is trivial or a small documentation fix (e.g., a typo or reword of a small section) please:
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](https://github.com/pytest-dev/pytest/blob/master/changelog/README.rst) for details.
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](https://github.com/pytest-dev/pytest/blob/main/changelog/README.rst) for details.
Write sentences in the **past or present tense**, examples:

17
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/testing/plugins_integration"
schedule:
interval: weekly
time: "03:00"
open-pull-requests-limit: 10
allow:
- dependency-type: direct
- dependency-type: indirect
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
time: "03:00"
open-pull-requests-limit: 10

51
.github/workflows/backport.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: backport
on:
# Note that `pull_request_target` has security implications:
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
# In particular:
# - Only allow triggers that can be used only be trusted users
# - Don't execute any code from the target branch
# - Don't use cache
pull_request_target:
types: [labeled]
# Set permissions at the job level.
permissions: {}
jobs:
backport:
if: startsWith(github.event.label.name, 'backport ') && github.event.pull_request.merged
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: true
- name: Create backport PR
run: |
set -eux
git config --global user.name "pytest bot"
git config --global user.email "pytestbot@gmail.com"
label='${{ github.event.label.name }}'
target_branch="${label#backport }"
backport_branch=backport-${{ github.event.number }}-to-"${target_branch}"
subject="[$target_branch] $(gh pr view --json title -q .title ${{ github.event.number }})"
git checkout origin/"${target_branch}" -b "${backport_branch}"
git cherry-pick -x --mainline 1 ${{ github.event.pull_request.merge_commit_sha }}
git commit --amend --message "$subject"
git push --set-upstream origin --force-with-lease "${backport_branch}"
gh pr create \
--base "${target_branch}" \
--title "${subject}" \
--body "Backport of PR #${{ github.event.number }} to $target_branch branch. PR created by backport workflow."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

60
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,60 @@
name: deploy
on:
push:
tags:
# These tags are protected, see:
# https://github.com/pytest-dev/pytest/settings/tag_protection
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
# Set permissions at the job level.
permissions: {}
jobs:
deploy:
if: github.repository == 'pytest-dev/pytest'
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5
- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install --upgrade tox
- name: Publish GitHub release notes
env:
GH_RELEASE_NOTES_TOKEN: ${{ github.token }}
run: |
sudo apt-get install pandoc
tox -e publish-gh-release-notes

View File

@@ -1,212 +0,0 @@
name: main
on:
push:
branches:
- master
- "[0-9]+.[0-9]+.x"
tags:
- "*"
pull_request:
branches:
- master
- "[0-9]+.[0-9]+.x"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
"windows-py35",
"windows-py36",
"windows-py37",
"windows-py37-pluggy",
"windows-py38",
"ubuntu-py35",
"ubuntu-py36",
"ubuntu-py37",
"ubuntu-py37-pluggy",
"ubuntu-py37-freeze",
"ubuntu-py38",
"ubuntu-py39",
"ubuntu-pypy3",
"macos-py37",
"macos-py38",
"docs",
"doctesting",
]
include:
- name: "windows-py35"
python: "3.5"
os: windows-latest
tox_env: "py35-xdist"
use_coverage: true
- name: "windows-py36"
python: "3.6"
os: windows-latest
tox_env: "py36-xdist"
- name: "windows-py37"
python: "3.7"
os: windows-latest
tox_env: "py37-numpy"
- name: "windows-py37-pluggy"
python: "3.7"
os: windows-latest
tox_env: "py37-pluggymaster-xdist"
- name: "windows-py38"
python: "3.8"
os: windows-latest
tox_env: "py38-unittestextras"
use_coverage: true
- name: "ubuntu-py35"
python: "3.5"
os: ubuntu-latest
tox_env: "py35-xdist"
- name: "ubuntu-py36"
python: "3.6"
os: ubuntu-latest
tox_env: "py36-xdist"
- name: "ubuntu-py37"
python: "3.7"
os: ubuntu-latest
tox_env: "py37-lsof-numpy-oldattrs-pexpect"
use_coverage: true
- name: "ubuntu-py37-pluggy"
python: "3.7"
os: ubuntu-latest
tox_env: "py37-pluggymaster-xdist"
- name: "ubuntu-py37-freeze"
python: "3.7"
os: ubuntu-latest
tox_env: "py37-freeze"
- name: "ubuntu-py38"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-xdist"
- name: "ubuntu-py39"
python: "3.9-dev"
os: ubuntu-latest
tox_env: "py39-xdist"
- name: "ubuntu-pypy3"
python: "pypy3"
os: ubuntu-latest
tox_env: "pypy3-xdist"
- name: "macos-py37"
python: "3.7"
os: macos-latest
tox_env: "py37-xdist"
- name: "macos-py38"
python: "3.8"
os: macos-latest
tox_env: "py38-xdist"
use_coverage: true
- name: "docs"
python: "3.7"
os: ubuntu-latest
tox_env: "docs"
- name: "doctesting"
python: "3.7"
os: ubuntu-latest
tox_env: "doctesting"
use_coverage: true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
if: matrix.python != '3.9-dev'
with:
python-version: ${{ matrix.python }}
- name: Set up Python ${{ matrix.python }} (deadsnakes)
uses: deadsnakes/action@v1.0.0
if: matrix.python == '3.9-dev'
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coverage
- name: Test without coverage
if: "! matrix.use_coverage"
run: "tox -e ${{ matrix.tox_env }}"
- name: Test with coverage
if: "matrix.use_coverage"
env:
_PYTEST_TOX_COVERAGE_RUN: "coverage run -m"
COVERAGE_PROCESS_START: ".coveragerc"
_PYTEST_TOX_EXTRA_DEP: "coverage-enable-subprocess"
run: "tox -e ${{ matrix.tox_env }}"
- name: Prepare coverage token
if: (matrix.use_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' ))
run: |
python scripts/append_codecov_token.py
- name: Report coverage
if: (matrix.use_coverage)
env:
CODECOV_NAME: ${{ matrix.name }}
run: bash scripts/report-coverage.sh -F GHA,${{ runner.os }}
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: set PY
run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install tox
- run: tox -e linting
deploy:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest'
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools tox
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}
- name: Publish GitHub release notes
env:
GH_RELEASE_NOTES_TOKEN: ${{ secrets.release_notes }}
run: |
sudo apt-get install pandoc
tox -e publish-gh-release-notes

View File

@@ -0,0 +1,52 @@
name: prepare release pr
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to base the release from'
required: true
default: ''
major:
description: 'Major release? (yes/no)'
required: true
default: 'no'
prerelease:
description: 'Prerelease (ex: rc1). Leave empty if not a pre-release.'
required: false
default: ''
# Set permissions at the job level.
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools tox
- name: Prepare release PR (minor/patch release)
if: github.event.inputs.major == 'no'
run: |
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --prerelease='${{ github.event.inputs.prerelease }}'
- name: Prepare release PR (major release)
if: github.event.inputs.major == 'yes'
run: |
tox -e prepare-release-pr -- ${{ github.event.inputs.branch }} ${{ github.token }} --major --prerelease='${{ github.event.inputs.prerelease }}'

View File

@@ -1,31 +0,0 @@
# part of our release process, see `release-on-comment.py`
name: release on comment
on:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]
jobs:
build:
runs-on: ubuntu-latest
if: (github.event.comment && startsWith(github.event.comment.body, '@pytestbot please')) || (github.event.issue && !github.event.comment && startsWith(github.event.issue.body, '@pytestbot please'))
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools tox
- name: Prepare release
run: |
tox -e release-on-comment -- $GITHUB_EVENT_PATH ${{ secrets.chatops }}

215
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,215 @@
name: test
on:
push:
branches:
- main
- "[0-9]+.[0-9]+.x"
- "test-me-*"
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
pull_request:
branches:
- main
- "[0-9]+.[0-9]+.x"
env:
PYTEST_ADDOPTS: "--color=yes"
# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Set permissions at the job level.
permissions: {}
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 45
permissions:
contents: read
strategy:
fail-fast: false
matrix:
name: [
"windows-py37",
"windows-py37-pluggy",
"windows-py38",
"windows-py39",
"windows-py310",
"windows-py311",
"windows-py312",
"ubuntu-py37",
"ubuntu-py37-pluggy",
"ubuntu-py37-freeze",
"ubuntu-py38",
"ubuntu-py39",
"ubuntu-py310",
"ubuntu-py311",
"ubuntu-py312",
"ubuntu-pypy3",
"macos-py37",
"macos-py39",
"macos-py310",
"macos-py312",
"docs",
"doctesting",
"plugins",
]
include:
- name: "windows-py37"
python: "3.7"
os: windows-latest
tox_env: "py37-numpy"
- name: "windows-py37-pluggy"
python: "3.7"
os: windows-latest
tox_env: "py37-pluggymain-pylib-xdist"
- name: "windows-py38"
python: "3.8"
os: windows-latest
tox_env: "py38-unittestextras"
use_coverage: true
- name: "windows-py39"
python: "3.9"
os: windows-latest
tox_env: "py39-xdist"
- name: "windows-py310"
python: "3.10"
os: windows-latest
tox_env: "py310-xdist"
- name: "windows-py311"
python: "3.11"
os: windows-latest
tox_env: "py311"
- name: "windows-py312"
python: "3.12-dev"
os: windows-latest
tox_env: "py312"
- name: "ubuntu-py37"
python: "3.7"
os: ubuntu-latest
tox_env: "py37-lsof-numpy-pexpect"
use_coverage: true
- name: "ubuntu-py37-pluggy"
python: "3.7"
os: ubuntu-latest
tox_env: "py37-pluggymain-pylib-xdist"
- name: "ubuntu-py37-freeze"
python: "3.7"
os: ubuntu-latest
tox_env: "py37-freeze"
- name: "ubuntu-py38"
python: "3.8"
os: ubuntu-latest
tox_env: "py38-xdist"
- name: "ubuntu-py39"
python: "3.9"
os: ubuntu-latest
tox_env: "py39-xdist"
- name: "ubuntu-py310"
python: "3.10"
os: ubuntu-latest
tox_env: "py310-xdist"
- name: "ubuntu-py311"
python: "3.11"
os: ubuntu-latest
tox_env: "py311"
use_coverage: true
- name: "ubuntu-py312"
python: "3.12-dev"
os: ubuntu-latest
tox_env: "py312"
use_coverage: true
- name: "ubuntu-pypy3"
python: "pypy-3.7"
os: ubuntu-latest
tox_env: "pypy3-xdist"
- name: "macos-py37"
python: "3.7"
os: macos-latest
tox_env: "py37-xdist"
- name: "macos-py39"
python: "3.9"
os: macos-latest
tox_env: "py39-xdist"
use_coverage: true
- name: "macos-py310"
python: "3.10"
os: macos-latest
tox_env: "py310-xdist"
- name: "macos-py312"
python: "3.12-dev"
os: macos-latest
tox_env: "py312-xdist"
- name: "plugins"
python: "3.9"
os: ubuntu-latest
tox_env: "plugins"
- name: "docs"
python: "3.7"
os: ubuntu-latest
tox_env: "docs"
- name: "doctesting"
python: "3.7"
os: ubuntu-latest
tox_env: "doctesting"
use_coverage: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
check-latest: ${{ endsWith(matrix.python, '-dev') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coverage
- name: Test without coverage
if: "! matrix.use_coverage"
run: "tox -e ${{ matrix.tox_env }}"
- name: Test with coverage
if: "matrix.use_coverage"
run: "tox -e ${{ matrix.tox_env }}-coverage"
- name: Generate coverage report
if: "matrix.use_coverage"
run: python -m coverage xml
- name: Upload coverage to Codecov
if: "matrix.use_coverage"
uses: codecov/codecov-action@v3
continue-on-error: true
with:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true
check-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1.5

View File

@@ -0,0 +1,49 @@
name: Update Plugin List
on:
schedule:
# At 00:00 on Sunday.
# https://crontab.guru
- cron: '0 0 * * 0'
workflow_dispatch:
# Set permissions at the job level.
permissions: {}
jobs:
update-plugin-list:
if: github.repository_owner == 'pytest-dev'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install packaging requests tabulate[widechars] tqdm
- name: Update Plugin List
run: python scripts/update-plugin-list.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@38e0b6e68b4c852a5500a94740f0e535e0d7ba54
with:
commit-message: '[automated] Update plugin list'
author: 'pytest bot <pytestbot@users.noreply.github.com>'
branch: update-plugin-list/patch
delete-branch: true
branch-suffix: short-commit-hash
title: '[automated] Update plugin list'
body: '[automated] Update plugin list'

5
.gitignore vendored
View File

@@ -34,6 +34,7 @@ issue/
env/
.env/
.venv/
/pythonenv*/
3rdparty/
.tox
.cache
@@ -49,6 +50,10 @@ coverage.xml
.project
.settings
.vscode
__pycache__/
# generated by pip
pip-wheel-metadata/
# pytest debug logs generated via --debug
pytestdebug.log

View File

@@ -1,16 +1,18 @@
default_language_version:
python: "3.10"
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 23.3.0
hooks:
- id: black
args: [--safe, --quiet]
- repo: https://github.com/asottile/blacken-docs
rev: v1.7.0
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies: [black==19.10b0]
additional_dependencies: [black==23.1.0]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -20,34 +22,56 @@ repos:
- id: debug-statements
exclude: _pytest/(debugging|hookspec).py
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.2
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.2
hooks:
- id: autoflake
name: autoflake
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"]
language: python
files: \.py$
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
language_version: python3
additional_dependencies: [flake8-typing-imports==1.9.0]
additional_dependencies:
- flake8-typing-imports==1.12.0
- flake8-docstrings==1.5.0
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.0
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: ['--application-directories=.:src', --py3-plus]
args: ['--application-directories=.:src', --py37-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v2.4.4
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py3-plus]
args: [--py37-plus]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.9.0
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
# TODO: when upgrading setup-cfg-fmt this can be removed
args: [--max-py-version=3.9]
args: ["--max-py-version=3.12", "--include-version-classifiers"]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-use-type-annotations
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.780 # NOTE: keep this in sync with setup.cfg.
rev: v1.1.1
hooks:
- id: mypy
files: ^(src/|testing/)
args: []
additional_dependencies:
- iniconfig>=1.1.0
- attrs>=19.2.0
- packaging
- tomli
- types-pkg_resources
# for mypy running on python>=3.11 since exceptiongroup is only a dependency
# on <3.11
- exceptiongroup>=1.0.0rc8
- repo: local
hooks:
- id: rst
@@ -70,9 +94,17 @@ repos:
_code\.|
builtin\.|
code\.|
io\.(BytesIO|saferepr|TerminalWriter)|
io\.|
path\.local\.sysfind|
process\.|
std\.
std\.|
error\.|
xml\.
)
types: [python]
- id: py-path-deprecated
name: py.path usage is deprecated
exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py|src/_pytest/legacypath.py
language: pygrep
entry: \bpy\.path\.local
types: [python]

22
.readthedocs.yml Normal file
View File

@@ -0,0 +1,22 @@
version: 2
python:
install:
# Install pytest first, then doc/en/requirements.txt.
# This order is important to honor any pins in doc/en/requirements.txt
# when the pinned library is also a dependency of pytest.
- method: pip
path: .
- requirements: doc/en/requirements.txt
build:
os: ubuntu-20.04
tools:
python: "3.9"
apt_packages:
- inkscape
formats:
- epub
- pdf
- htmlzip

View File

@@ -1,60 +0,0 @@
language: python
dist: trusty
python: '3.5.1'
cache: false
env:
global:
- PYTEST_ADDOPTS=-vv
# setuptools-scm needs all tags in order to obtain a proper version
git:
depth: false
install:
- python -m pip install --upgrade --pre tox
jobs:
include:
# Coverage for Python 3.5.{0,1} specific code, mostly typing related.
- env: TOXENV=py35 PYTEST_COVERAGE=1 PYTEST_ADDOPTS="-k test_raises_cyclic_reference"
before_install:
# Work around https://github.com/jaraco/zipp/issues/40.
- python -m pip install -U 'setuptools>=34.4.0' virtualenv==16.7.9
before_script:
- |
# Do not (re-)upload coverage with cron runs.
if [[ "$TRAVIS_EVENT_TYPE" = cron ]]; then
PYTEST_COVERAGE=0
fi
- |
if [[ "$PYTEST_COVERAGE" = 1 ]]; then
export COVERAGE_FILE="$PWD/.coverage"
export COVERAGE_PROCESS_START="$PWD/.coveragerc"
export _PYTEST_TOX_COVERAGE_RUN="coverage run -m"
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
fi
script: tox
after_success:
- |
if [[ "$PYTEST_COVERAGE" = 1 ]]; then
env CODECOV_NAME="$TOXENV-$TRAVIS_OS_NAME" scripts/report-coverage.sh -F Travis
fi
notifications:
irc:
channels:
- "chat.freenode.net#pytest"
on_success: change
on_failure: change
skip_join: true
email:
- pytest-commit@python.org
branches:
only:
- master
- /^\d+\.\d+\.x$/

88
AUTHORS
View File

@@ -5,14 +5,19 @@ Contributors include::
Aaron Coleman
Abdeali JK
Abdelrahman Elbehery
Abhijeet Kasurde
Adam Johnson
Adam Stewart
Adam Uhlir
Ahn Ki-Wook
Akiomi Kamakura
Alan Velasco
Alessio Izzo
Alexander Johnson
Alexander King
Alexei Kozlenok
Alice Purcell
Allan Feldman
Aly Sivji
Amir Elkess
@@ -21,7 +26,9 @@ Anders Hovmöller
Andras Mitzki
Andras Tim
Andrea Cimatoribus
Andreas Motl
Andreas Zeidler
Andrew Shapton
Andrey Paramonov
Andrzej Klajnert
Andrzej Ostrowski
@@ -29,15 +36,21 @@ Andy Freeland
Anthon van der Neut
Anthony Shaw
Anthony Sottile
Anton Grinevich
Anton Lodder
Antony Lee
Arel Cordero
Arias Emmanuel
Ariel Pillemer
Armin Rigo
Aron Coyle
Aron Curzon
Ashish Kurmi
Aviral Verma
Aviv Palivoda
Babak Keyvani
Barney Gale
Ben Gartner
Ben Webb
Benjamin Peterson
Bernard Pratz
@@ -47,6 +60,7 @@ Brian Maissy
Brian Okken
Brianna Laugher
Bruno Oliveira
Cal Jacobson
Cal Leeming
Carl Friedrich Bolz
Carlos Jenkins
@@ -54,24 +68,33 @@ Ceridwen
Charles Cloud
Charles Machalow
Charnjit SiNGH (CCSJ)
Cheuk Ting Ho
Chris Lamb
Chris NeJame
Chris Rose
Chris Wheeler
Christian Boelsen
Christian Fetzer
Christian Neumüller
Christian Theunert
Christian Tismer
Christine Mecklenborg
Christoph Buelter
Christopher Dignam
Christopher Gilling
Claire Cecil
Claudio Madotto
CrazyMerlyn
Cristian Vera
Cyrus Maden
Damian Skrzypczak
Daniel Grana
Daniel Hahler
Daniel Nuri
Daniel Sánchez Castelló
Daniel Valenzuela Zenteno
Daniel Wandschneider
Daniele Procida
Danielle Jenkins
Daniil Galiev
Dave Hunt
@@ -83,18 +106,23 @@ David Vierra
Daw-Ran Liou
Debi Mishra
Denis Kirisov
Denivy Braiam Rück
Dhiren Serai
Diego Russo
Dmitry Dygalo
Dmitry Pribysh
Dominic Mortlock
Duncan Betts
Edison Gustavo Muenz
Edoardo Batini
Edson Tadeu M. Manoel
Eduardo Schettino
Eli Boyarski
Elizaveta Shashkova
Éloi Rivard
Endre Galaczi
Eric Hunsberger
Eric Liu
Eric Siegerman
Erik Aronesty
Erik M. Bray
@@ -106,11 +134,15 @@ Feng Ma
Florian Bruhin
Florian Dahlitz
Floris Bruynooghe
Gabriel Landau
Gabriel Reis
Garvit Shubham
Gene Wood
George Kussumoto
Georgy Dyuldin
Gergely Kalmár
Gleb Nikonorov
Graeme Smecher
Graham Horler
Greg Price
Gregory Lee
@@ -119,6 +151,7 @@ Grigorii Eremeev (budulianin)
Guido Wesdorp
Guoqiang Zhang
Harald Armin Massa
Harshna
Henk-Jaap Wagenaar
Holger Kohr
Hugo van Kemenade
@@ -127,9 +160,13 @@ Ian Bicking
Ian Lesperance
Ilya Konstantinov
Ionuț Turturică
Itxaso Aizpurua
Iwan Briquemont
Jaap Broekhuizen
Jake VanderPlas
Jakob van Santen
Jakub Mitoraj
James Bourbeau
Jan Balster
Janne Vanhala
Jason R. Coombs
@@ -139,7 +176,9 @@ Jeff Rackauckas
Jeff Widman
Jenni Rinker
John Eddie Ayson
John Litborn
John Towler
Jon Parise
Jon Sonesen
Jonas Obrist
Jordan Guymon
@@ -149,16 +188,24 @@ Joseph Hunkeler
Josh Karpel
Joshua Bronson
Jurko Gospodnetić
Justice Ndou
Justyna Janczyszyn
Kale Kundert
Kamran Ahmad
Karl O. Pinc
Karthikeyan Singaravelan
Katarzyna Jachim
Katarzyna Król
Katerina Koukiou
Keri Volans
Kevin C
Kevin Cox
Kevin Hierro Carrasco
Kevin J. Foley
Kian Eliasi
Kian-Meng Ang
Kodi B. Arfer
Kojo Idrissa
Kostis Anagnostopoulos
Kristoffer Nordström
Kyle Altendorf
@@ -181,6 +228,7 @@ Marcin Bachry
Marco Gorelli
Mark Abramowitz
Mark Dickinson
Marko Pacak
Markus Unterwaditzer
Martijn Faassen
Martin Altmayer
@@ -201,6 +249,8 @@ Michael Goerz
Michael Krebs
Michael Seifert
Michal Wajszczuk
Michał Zięba
Mickey Pashov
Mihai Capotă
Mike Hoyle (hoylemd)
Mike Lundy
@@ -214,32 +264,43 @@ Nicholas Murphy
Niclas Olofsson
Nicolas Delaby
Nikolay Kondratyev
Nipunn Koorapati
Oleg Pidsadnyi
Oleg Sushchenko
Olga Matoula
Oliver Bestwalter
Omar Kohl
Omer Hadari
Ondřej Súkup
Oscar Benjamin
Parth Patel
Patrick Hayes
Paul Müller
Paul Reece
Pauli Virtanen
Pavel Karateev
Paweł Adamczak
Pedro Algarvio
Petter Strandmark
Philipp Loose
Pierre Sassoulas
Pieter Mulder
Piotr Banaszkiewicz
Piotr Helm
Prakhar Gurunani
Prashant Anand
Prashant Sharma
Pulkit Goyal
Punyashloka Biswal
Quentin Pradet
q0w
Ralf Schmitt
Ram Rachum
Ralph Giles
Ram Rachum
Ran Benita
Raphael Castaneda
Raphael Pierzina
Rafal Semik
Raquel Alegre
Ravi Chandra
Robert Holt
@@ -252,20 +313,28 @@ Ross Lawley
Ruaridh Williamson
Russel Winder
Ryan Wooden
Saiprasad Kale
Samuel Colvin
Samuel Dion-Girardeau
Samuel Searles-Bryant
Samuele Pedroni
Sanket Duthade
Sankt Petersbug
Saravanan Padmanaban
Segev Finer
Serhii Mozghovyi
Seth Junot
Shantanu Jain
Shubham Adep
Simon Gomizelj
Simon Holesch
Simon Kerr
Skylar Downes
Srinivas Reddy Thatiparthy
Stefan Farmbauer
Stefan Scherfke
Stefan Zimmermann
Stefanie Molin
Stefano Taschini
Steffen Allner
Stephan Obermann
@@ -273,27 +342,36 @@ Sven-Hendrik Haase
Sylvain Marié
Tadek Teleżyński
Takafumi Arakaki
Taneli Hukkinen
Tanvi Mehta
Tarcisio Fischer
Tareq Alayan
Tatiana Ovary
Ted Xiao
Terje Runde
Thomas Grainger
Thomas Hisch
Tim Hoffmann
Tim Strazny
TJ Bruno
Tobias Diez
Tom Dalton
Tom Viner
Tomáš Gavenčiak
Tomer Keren
Tony Narlock
Tor Colvin
Trevor Bekolay
Tyler Goodlet
Tzu-ping Chung
Vasily Kuznetsov
Victor Maryama
Victor Rodriguez
Victor Uriarte
Vidar T. Fauske
Virgil Dupras
Vitaly Lashmanov
Vivaan Verma
Vlad Dragos
Vlad Radziuk
Vladyslav Rachek
@@ -306,6 +384,14 @@ Wouter van Ackooy
Xixi Zhao
Xuan Luong
Xuecong Liao
Yannick Péroux
Yoav Caspi
Yuliang Shao
Yusuke Kadowaki
Yuval Shimon
Zac Hatfield-Dodds
Zachary Kneupper
Zachary OBrien
Zhouxin Qiu
Zoltán Máté
Zsolt Cserna

View File

@@ -4,4 +4,4 @@ Changelog
The pytest CHANGELOG is located `here <https://docs.pytest.org/en/stable/changelog.html>`__.
The source document can be found at: https://github.com/pytest-dev/pytest/blob/master/doc/en/changelog.rst
The source document can be found at: https://github.com/pytest-dev/pytest/blob/main/doc/en/changelog.rst

View File

@@ -50,6 +50,8 @@ Fix bugs
--------
Look through the `GitHub issues for bugs <https://github.com/pytest-dev/pytest/labels/type:%20bug>`_.
See also the `"status: easy" issues <https://github.com/pytest-dev/pytest/labels/status%3A%20easy>`_
that are friendly to new contributors.
:ref:`Talk <contact>` to developers to find out how you can fix specific bugs. To indicate that you are going
to work on a particular issue, add a comment to that effect on the specific issue.
@@ -89,6 +91,38 @@ without using a local copy. This can be convenient for small fixes.
The built documentation should be available in ``doc/en/_build/html``,
where 'en' refers to the documentation language.
Pytest has an API reference which in large part is
`generated automatically <https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html>`_
from the docstrings of the documented items. Pytest uses the
`Sphinx docstring format <https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html>`_.
For example:
.. code-block:: python
def my_function(arg: ArgType) -> Foo:
"""Do important stuff.
More detailed info here, in separate paragraphs from the subject line.
Use proper sentences -- start sentences with capital letters and end
with periods.
Can include annotated documentation:
:param short_arg: An argument which determines stuff.
:param long_arg:
A long explanation which spans multiple lines, overflows
like this.
:returns: The result.
:raises ValueError:
Detailed information when this can happen.
.. versionadded:: 6.0
Including types into the annotations above is not necessary when
type-hinting is being used (as in this example).
"""
.. _submitplugin:
Submitting Plugins to pytest-dev
@@ -99,8 +133,6 @@ in repositories living under the ``pytest-dev`` organisations:
- `pytest-dev on GitHub <https://github.com/pytest-dev>`_
- `pytest-dev on Bitbucket <https://bitbucket.org/pytest-dev>`_
All pytest-dev Contributors team members have write access to all contained
repositories. Pytest core and plugins are generally developed
using `pull requests`_ to respective repositories.
@@ -116,20 +148,21 @@ You can submit your plugin by subscribing to the `pytest-dev mail list
mail pointing to your existing pytest plugin repository which must have
the following:
- PyPI presence with a ``setup.py`` that contains a license, ``pytest-``
- PyPI presence with packaging metadata that contains a ``pytest-``
prefixed name, version number, authors, short and long description.
- a ``tox.ini`` for running tests using `tox <https://tox.readthedocs.io>`_.
- a `tox configuration <https://tox.readthedocs.io/en/latest/config.html#configuration-discovery>`_
for running tests using `tox <https://tox.readthedocs.io>`_.
- a ``README.txt`` describing how to use the plugin and on which
- a ``README`` describing how to use the plugin and on which
platforms it runs.
- a ``LICENSE.txt`` file or equivalent containing the licensing
information, with matching info in ``setup.py``.
- a ``LICENSE`` file containing the licensing information, with
matching info in its packaging metadata.
- an issue tracker for bug reports and enhancement requests.
- a `changelog <http://keepachangelog.com/>`_.
- a `changelog <https://keepachangelog.com/>`_.
If no contributor strongly objects and two agree, the repository can then be
transferred to the ``pytest-dev`` organisation.
@@ -190,7 +223,7 @@ changes you want to review and merge. Pull requests are stored on
Once you send a pull request, we can discuss its potential modifications and
even add more commits to it later on. There's an excellent tutorial on how Pull
Requests work in the
`GitHub Help Center <https://help.github.com/articles/using-pull-requests/>`_.
`GitHub Help Center <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests>`_.
Here is a simple overview, with pytest-specific bits:
@@ -203,14 +236,19 @@ Here is a simple overview, with pytest-specific bits:
$ git clone git@github.com:YOUR_GITHUB_USERNAME/pytest.git
$ cd pytest
# now, create your own branch off "master":
# now, create your own branch off "main":
$ git checkout -b your-bugfix-branch-name master
$ git checkout -b your-bugfix-branch-name main
Given we have "major.minor.micro" version numbers, bug fixes will usually
be released in micro releases whereas features will be released in
minor releases and incompatible changes in major releases.
You will need the tags to test locally, so be sure you have the tags from the main repository. If you suspect you don't, set the main repository as upstream and fetch the tags::
$ git remote add upstream https://github.com/pytest-dev/pytest
$ git fetch upstream --tags
If you need some help with Git, follow this quick start
guide: https://git.wiki.kernel.org/index.php/QuickStart
@@ -228,7 +266,7 @@ Here is a simple overview, with pytest-specific bits:
Tox is used to run all the tests and will automatically setup virtualenvs
to run the tests in.
(will implicitly use http://www.virtualenv.org/en/latest/)::
(will implicitly use https://virtualenv.pypa.io/en/latest/)::
$ pip install tox
@@ -268,12 +306,6 @@ Here is a simple overview, with pytest-specific bits:
$ pytest testing/test_config.py
#. Commit and push once your tests pass and you are happy with your change(s)::
$ git commit -a -m "<commit message>"
$ git push -u
#. Create a new changelog entry in ``changelog``. The file should be named ``<issueid>.<type>.rst``,
where *issueid* is the number of the issue related to the change and *type* is one of
``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, ``vendor``
@@ -282,32 +314,37 @@ Here is a simple overview, with pytest-specific bits:
#. Add yourself to ``AUTHORS`` file if not there yet, in alphabetical order.
#. Commit and push once your tests pass and you are happy with your change(s)::
$ git commit -a -m "<commit message>"
$ git push -u
#. Finally, submit a pull request through the GitHub website using this data::
head-fork: YOUR_GITHUB_USERNAME/pytest
compare: your-branch-name
base-fork: pytest-dev/pytest
base: master
base: main
Writing Tests
~~~~~~~~~~~~~
Writing tests for plugins or for pytest itself is often done using the `testdir fixture <https://docs.pytest.org/en/stable/reference.html#testdir>`_, as a "black-box" test.
Writing tests for plugins or for pytest itself is often done using the `pytester fixture <https://docs.pytest.org/en/stable/reference/reference.html#pytester>`_, as a "black-box" test.
For example, to ensure a simple test passes you can write:
.. code-block:: python
def test_true_assertion(testdir):
testdir.makepyfile(
def test_true_assertion(pytester):
pytester.makepyfile(
"""
def test_foo():
assert True
"""
)
result = testdir.runpytest()
result = pytester.runpytest()
result.assert_outcomes(failed=0, passed=1)
@@ -316,14 +353,14 @@ Alternatively, it is possible to make checks based on the actual output of the t
.. code-block:: python
def test_true_assertion(testdir):
testdir.makepyfile(
def test_true_assertion(pytester):
pytester.makepyfile(
"""
def test_foo():
assert False
"""
)
result = testdir.runpytest()
result = pytester.runpytest()
result.stdout.fnmatch_lines(["*assert False*", "*1 failed*"])
When choosing a file where to write a new test, take a look at the existing files and see if there's
@@ -348,7 +385,7 @@ them.
Backporting bug fixes for the next patch release
------------------------------------------------
Pytest makes feature release every few weeks or months. In between, patch releases
Pytest makes a feature release every few weeks or months. In between, patch releases
are made to the previous feature release, containing bug fixes only. The bug fixes
usually fix regressions, but may be any change that should reach users before the
next feature release.
@@ -357,15 +394,22 @@ Suppose for example that the latest release was 1.2.3, and you want to include
a bug fix in 1.2.4 (check https://github.com/pytest-dev/pytest/releases for the
actual latest release). The procedure for this is:
#. First, make sure the bug is fixed the ``master`` branch, with a regular pull
#. First, make sure the bug is fixed in the ``main`` branch, with a regular pull
request, as described above. An exception to this is if the bug fix is not
applicable to ``master`` anymore.
applicable to ``main`` anymore.
#. ``git checkout origin/1.2.x -b backport-XXXX`` # use the master PR number here
Automatic method:
Add a ``backport 1.2.x`` label to the PR you want to backport. This will create
a backport PR against the ``1.2.x`` branch.
Manual method:
#. ``git checkout origin/1.2.x -b backport-XXXX`` # use the main PR number here
#. Locate the merge commit on the PR, in the *merged* message, for example:
nicoddemus merged commit 0f8b462 into pytest-dev:master
nicoddemus merged commit 0f8b462 into pytest-dev:main
#. ``git cherry-pick -x -m1 REVISION`` # use the revision you found above (``0f8b462``).
@@ -375,6 +419,27 @@ actual latest release). The procedure for this is:
* Delete the PR body, it usually contains a duplicate commit message.
Who does the backporting
~~~~~~~~~~~~~~~~~~~~~~~~
As mentioned above, bugs should first be fixed on ``main`` (except in rare occasions
that a bug only happens in a previous release). So, who should do the backport procedure described
above?
1. If the bug was fixed by a core developer, it is the main responsibility of that core developer
to do the backport.
2. However, often the merge is done by another maintainer, in which case it is nice of them to
do the backport procedure if they have the time.
3. For bugs submitted by non-maintainers, it is expected that a core developer will to do
the backport, normally the one that merged the PR on ``main``.
4. If a non-maintainers notices a bug which is fixed on ``main`` but has not been backported
(due to maintainers forgetting to apply the *needs backport* label, or just plain missing it),
they are also welcome to open a PR with the backport. The procedure is simple and really
helps with the maintenance of the project.
All the above are not rules, but merely some guidelines/suggestions on what we should expect
about backports.
Handling stale issues/PRs
-------------------------
@@ -396,7 +461,7 @@ can always reopen the issue/pull request in their own time later if it makes sen
When to close
~~~~~~~~~~~~~
Here are a few general rules the maintainers use to decide when to close issues/PRs because
Here are a few general rules the maintainers use deciding when to close issues/PRs because
of lack of inactivity:
* Issues labeled ``question`` or ``needs information``: closed after 14 days inactive.
@@ -408,15 +473,15 @@ The above are **not hard rules**, but merely **guidelines**, and can be (and oft
Closing pull requests
~~~~~~~~~~~~~~~~~~~~~
When closing a Pull Request, it needs to be acknowledge the time, effort, and interest demonstrated by the person which submitted it. As mentioned previously, it is not the intent of the team to dismiss stalled pull request entirely but to merely to clear up our queue, so a message like the one below is warranted when closing a pull request that went stale:
When closing a Pull Request, it needs to be acknowledging the time, effort, and interest demonstrated by the person which submitted it. As mentioned previously, it is not the intent of the team to dismiss a stalled pull request entirely but to merely to clear up our queue, so a message like the one below is warranted when closing a pull request that went stale:
Hi <contributor>,
First of all we would like to thank you for your time and effort on working on this, the pytest team deeply appreciates it.
First of all, we would like to thank you for your time and effort on working on this, the pytest team deeply appreciates it.
We noticed it has been awhile since you have updated this PR, however. pytest is a high activity project, with many issues/PRs being opened daily, so it is hard for us maintainers to track which PRs are ready for merging, for review, or need more attention.
So for those reasons we think it is best to close the PR for now, but with the only intention to cleanup our queue, it is by no means a rejection of your changes. We still encourage you to re-open this PR (it is just a click of a button away) when you are ready to get back to it.
So for those reasons we, think it is best to close the PR for now, but with the only intention to clean up our queue, it is by no means a rejection of your changes. We still encourage you to re-open this PR (it is just a click of a button away) when you are ready to get back to it.
Again we appreciate your time for working on this, and hope you might get back to this at a later time!

View File

@@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2004-2020 Holger Krekel and others
Copyright (c) 2004 Holger Krekel and others
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in

View File

@@ -1,6 +1,7 @@
.. image:: https://docs.pytest.org/en/stable/_static/pytest1.png
.. image:: https://github.com/pytest-dev/pytest/raw/main/doc/en/img/pytest_logo_curves.svg
:target: https://docs.pytest.org/en/stable/
:align: center
:height: 200
:alt: pytest
@@ -15,15 +16,16 @@
.. image:: https://img.shields.io/pypi/pyversions/pytest.svg
:target: https://pypi.org/project/pytest/
.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/master/graph/badge.svg
.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pytest-dev/pytest
:alt: Code coverage Status
.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master
:target: https://travis-ci.org/pytest-dev/pytest
.. image:: https://github.com/pytest-dev/pytest/workflows/test/badge.svg
:target: https://github.com/pytest-dev/pytest/actions?query=workflow%3Atest
.. image:: https://dev.azure.com/pytest-dev/pytest/_apis/build/status/pytest-CI?branchName=master
:target: https://dev.azure.com/pytest-dev/pytest
.. image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest/main.svg
:target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest/main
:alt: pre-commit.ci status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
@@ -35,6 +37,15 @@
:target: https://pytest.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/badge/Discord-pytest--dev-blue
:target: https://discord.com/invite/pytest-dev
:alt: Discord
.. image:: https://img.shields.io/badge/Libera%20chat-%23pytest-orange
:target: https://web.libera.chat/#pytest
:alt: Libera chat
The ``pytest`` framework makes it easy to write small tests, yet
scales to support complex functional testing for applications and libraries.
@@ -77,21 +88,21 @@ Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` stat
Features
--------
- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/assert.html>`_ (no need to remember ``self.assert*`` names);
- Detailed info on failing `assert statements <https://docs.pytest.org/en/stable/how-to/assert.html>`_ (no need to remember ``self.assert*`` names)
- `Auto-discovery
<https://docs.pytest.org/en/stable/goodpractices.html#python-test-discovery>`_
of test modules and functions;
<https://docs.pytest.org/en/stable/explanation/goodpractices.html#python-test-discovery>`_
of test modules and functions
- `Modular fixtures <https://docs.pytest.org/en/stable/fixture.html>`_ for
managing small or parametrized long-lived test resources;
- `Modular fixtures <https://docs.pytest.org/en/stable/explanation/fixtures.html>`_ for
managing small or parametrized long-lived test resources
- Can run `unittest <https://docs.pytest.org/en/stable/unittest.html>`_ (or trial),
`nose <https://docs.pytest.org/en/stable/nose.html>`_ test suites out of the box;
- Can run `unittest <https://docs.pytest.org/en/stable/how-to/unittest.html>`_ (or trial),
`nose <https://docs.pytest.org/en/stable/how-to/nose.html>`_ test suites out of the box
- Python 3.5+ and PyPy3;
- Python 3.7+ or PyPy3
- Rich plugin architecture, with over 850+ `external plugins <http://plugincompat.herokuapp.com>`_ and thriving community;
- Rich plugin architecture, with over 850+ `external plugins <https://docs.pytest.org/en/latest/reference/plugin_list.html>`_ and thriving community
Documentation
@@ -149,8 +160,8 @@ Tidelift will coordinate the fix and disclosure.
License
-------
Copyright Holger Krekel and others, 2004-2020.
Copyright Holger Krekel and others, 2004.
Distributed under the terms of the `MIT`_ license, pytest is free and open source software.
.. _`MIT`: https://github.com/pytest-dev/pytest/blob/master/LICENSE
.. _`MIT`: https://github.com/pytest-dev/pytest/blob/main/LICENSE

View File

@@ -5,37 +5,115 @@ Our current policy for releasing is to aim for a bug-fix release every few weeks
is to get fixes and new features out instead of trying to cram a ton of features into a release and by consequence
taking a lot of time to make a new one.
The git commands assume the following remotes are setup:
* ``origin``: your own fork of the repository.
* ``upstream``: the ``pytest-dev/pytest`` official repository.
Preparing: Automatic Method
~~~~~~~~~~~~~~~~~~~~~~~~~~~
We have developed an automated workflow for releases, that uses GitHub workflows and is triggered
by opening an issue or issuing a comment one.
by `manually running <https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow>`__
the `prepare-release-pr workflow <https://github.com/pytest-dev/pytest/actions/workflows/prepare-release-pr.yml>`__
on GitHub Actions.
The comment must be in the form::
The automation will decide the new version number based on the following criteria:
@pytestbot please prepare release from BRANCH
- If the "major release" input is set to "yes", release a new major release
(e.g. 7.0.0 -> 8.0.0)
- If there are any ``.feature.rst`` or ``.breaking.rst`` files in the
``changelog`` directory, release a new minor release (e.g. 7.0.0 -> 7.1.0)
- Otherwise, release a bugfix release (e.g. 7.0.0 -> 7.0.1)
- If the "prerelease" input is set, append the string to the version number
(e.g. 7.0.0 -> 8.0.0rc1), if "major" is set, and "prerelease" is set to `rc1`)
Where ``BRANCH`` is ``master`` or one of the maintenance branches.
Bug-fix and minor releases
^^^^^^^^^^^^^^^^^^^^^^^^^^
For major releases the comment must be in the form::
Bug-fix and minor releases are always done from a maintenance branch. First,
consider double-checking the ``changelog`` directory to see if there are any
breaking changes or new features.
@pytestbot please prepare major release from master
For a new minor release, first create a new maintenance branch from ``main``::
After that, the workflow should publish a PR and notify that it has done so as a comment
in the original issue.
git fetch upstream
git branch 7.1.x upstream/main
git push upstream 7.1.x
Then, trigger the workflow with the following inputs:
- branch: **7.1.x**
- major release: **no**
- prerelease: empty
Or via the commandline using `GitHub's cli <https://github.com/cli/cli>`__::
gh workflow run prepare-release-pr.yml -f branch=7.1.x -f major=no -f prerelease=
Where ``7.1.x`` is the maintenance branch for the ``7.1`` series. The automated
workflow will publish a PR for a branch ``release-7.1.0``.
Similarly, for a bug-fix release, use the existing maintenance branch and
trigger the workflow with e.g. ``branch: 7.0.x`` to get a new ``release-7.0.1``
PR.
Major releases
^^^^^^^^^^^^^^
1. Create a new maintenance branch from ``main``::
git fetch upstream
git branch 8.0.x upstream/main
git push upstream 8.0.x
2. Trigger the workflow with the following inputs:
- branch: **8.0.x**
- major release: **yes**
- prerelease: empty
Or via the commandline::
gh workflow run prepare-release-pr.yml -f branch=8.0.x -f major=yes -f prerelease=
The automated workflow will publish a PR for a branch ``release-8.0.0``.
At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
into ``main`` and ported back to the maintenance branch, even for release candidates.
Release candidates
^^^^^^^^^^^^^^^^^^
To release a release candidate, set the "prerelease" input to the version number
suffix to use. To release a ``8.0.0rc1``, proceed like under "major releases", but set:
- branch: 8.0.x
- major release: yes
- prerelease: **rc1**
Or via the commandline::
gh workflow run prepare-release-pr.yml -f branch=8.0.x -f major=yes -f prerelease=rc1
The automated workflow will publish a PR for a branch ``release-8.0.0rc1``.
**A note about release candidates**
During release candidates we can merge small improvements into
the maintenance branch before releasing the final major version, however we must take care
to avoid introducing big changes at this stage.
Preparing: Manual Method
~~~~~~~~~~~~~~~~~~~~~~~~
.. important::
pytest releases must be prepared on **Linux** because the docs and examples expect
to be executed on that platform.
**Important**: pytest releases must be prepared on **Linux** because the docs and examples expect
to be executed on that platform.
To release a version ``MAJOR.MINOR.PATCH``, follow these steps:
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from the
latest ``master`` and push it to the ``pytest-dev/pytest`` repo.
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from
``upstream/main`` and push it to ``upstream``.
#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch.
@@ -56,22 +134,33 @@ Releasing
Both automatic and manual processes described above follow the same steps from this point onward.
#. After all tests pass and the PR has been approved, tag the release commit
in the ``MAJOR.MINOR.x`` branch and push it. This will publish to PyPI::
in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI::
git tag MAJOR.MINOR.PATCH
git push git@github.com:pytest-dev/pytest.git MAJOR.MINOR.PATCH
git fetch upstream
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
git push upstream MAJOR.MINOR.PATCH
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
#. Merge the PR.
#. Merge the PR. **Make sure it's not squash-merged**, so that the tagged commit ends up in the main branch.
#. Cherry-pick the CHANGELOG / announce files to the ``master`` branch::
#. Cherry-pick the CHANGELOG / announce files to the ``main`` branch::
git fetch --all --prune
git checkout origin/master -b cherry-pick-release
git cherry-pick --no-commit -m1 origin/MAJOR.MINOR.x
git checkout origin/master -- changelog
git commit # no arguments
git fetch upstream
git checkout upstream/main -b cherry-pick-release
git cherry-pick -x -m1 upstream/MAJOR.MINOR.x
#. Open a PR for ``cherry-pick-release`` and merge it once CI passes. No need to wait for approvals if there were no conflicts on the previous step.
#. For major and minor releases (or the first prerelease of it), tag the release cherry-pick merge commit in main with
a dev tag for the next feature release::
git checkout main
git pull
git tag MAJOR.{MINOR+1}.0.dev0
git push upstream MAJOR.{MINOR+1}.0.dev0
#. For major and minor releases, change the default version in the `Read the Docs Settings <https://readthedocs.org/dashboard/pytest/advanced/>`_ to the new branch.
#. Send an email announcement with the contents from::

View File

@@ -25,6 +25,7 @@ The current list of contributors receiving funding are:
* `@asottile`_
* `@nicoddemus`_
* `@The-Compiler`_
Contributors interested in receiving a part of the funds just need to submit a PR adding their
name to the list. Contributors that want to stop receiving the funds should also submit a PR
@@ -56,3 +57,4 @@ funds. Just drop a line to one of the `@pytest-dev/tidelift-admins`_ or use the
.. _`@asottile`: https://github.com/asottile
.. _`@nicoddemus`: https://github.com/nicoddemus
.. _`@The-Compiler`: https://github.com/The-Compiler

13
bench/unit_test.py Normal file
View File

@@ -0,0 +1,13 @@
from unittest import TestCase # noqa: F401
for i in range(15000):
exec(
f"""
class Test{i}(TestCase):
@classmethod
def setUpClass(cls): pass
def test_1(self): pass
def test_2(self): pass
def test_3(self): pass
"""
)

11
bench/xunit.py Normal file
View File

@@ -0,0 +1,11 @@
for i in range(5000):
exec(
f"""
class Test{i}:
@classmethod
def setup_class(cls): pass
def test_1(self): pass
def test_2(self): pass
def test_3(self): pass
"""
)

View File

@@ -1,2 +0,0 @@
Fix pylint ``not-callable`` lint on ``pytest.mark.parametrize()`` and the other builtin marks:
``skip``, ``skipif``, ``xfail``, ``usefixtures``, ``filterwarnings``.

View File

@@ -1 +0,0 @@
Fix regression in plugins using ``TestReport.longreprtext`` (such as ``pytest-html``) when ``TestReport.longrepr`` is not a string.

View File

@@ -34,6 +34,10 @@ REGENDOC_ARGS := \
regen: REGENDOC_FILES:=*.rst */*.rst
regen:
PYTHONDONTWRITEBYTECODE=1 PYTEST_ADDOPTS="-pno:hypothesis -Wignore::pytest.PytestUnknownMarkWarning" COLUMNS=76 regendoc --update ${REGENDOC_FILES} ${REGENDOC_ARGS}
# need to reset cachedir to the non-tox default
PYTHONDONTWRITEBYTECODE=1 \
PYTEST_ADDOPTS="-pno:hypothesis -p no:hypothesispytest -Wignore::pytest.PytestUnknownMarkWarning -o cache_dir=.pytest_cache" \
COLUMNS=76 \
regendoc --update ${REGENDOC_FILES} ${REGENDOC_ARGS}
.PHONY: regen

View File

@@ -1,16 +1,22 @@
<h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3>
<h3>Contents</h3>
<ul>
<li><a href="{{ pathto('index') }}">Home</a></li>
<li><a href="{{ pathto('getting-started') }}">Install</a></li>
<li><a href="{{ pathto('contents') }}">Contents</a></li>
<li><a href="{{ pathto('reference') }}">API Reference</a></li>
<li><a href="{{ pathto('example/index') }}">Examples</a></li>
<li><a href="{{ pathto('customize') }}">Customize</a></li>
<li><a href="{{ pathto('getting-started') }}">Get started</a></li>
<li><a href="{{ pathto('how-to/index') }}">How-to guides</a></li>
<li><a href="{{ pathto('reference/index') }}">Reference guides</a></li>
<li><a href="{{ pathto('explanation/index') }}">Explanation</a></li>
<li><a href="{{ pathto('contents') }}">Complete table of contents</a></li>
<li><a href="{{ pathto('example/index') }}">Library of examples</a></li>
</ul>
<h3>About the project</h3>
<ul>
<li><a href="{{ pathto('changelog') }}">Changelog</a></li>
<li><a href="{{ pathto('contributing') }}">Contributing</a></li>
<li><a href="{{ pathto('backwards-compatibility') }}">Backwards Compatibility</a></li>
<li><a href="{{ pathto('py27-py34-deprecation') }}">Python 2.7 and 3.4 Support</a></li>
<li><a href="{{ pathto('sponsor') }}">Sponsor</a></li>
<li><a href="{{ pathto('tidelift') }}">pytest for Enterprise</a></li>
<li><a href="{{ pathto('license') }}">License</a></li>
@@ -23,5 +29,3 @@
{%- endif %}
<hr>
<a href="{{ pathto('genindex') }}">Index</a>
<hr>

View File

@@ -2,7 +2,6 @@
<ul>
<li><a href="https://pypi.org/project/pytest/">pytest @ PyPI</a></li>
<li><a href="https://github.com/pytest-dev/pytest/">pytest @ GitHub</a></li>
<li><a href="http://plugincompat.herokuapp.com/">3rd party plugins</a></li>
<li><a href="https://github.com/pytest-dev/pytest/issues">Issue Tracker</a></li>
<li><a href="https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf">PDF Documentation</a>
</ul>

View File

@@ -10,10 +10,9 @@ Are you an enthusiastic pytest user, the local testing guru in your workplace? O
We will pair experienced pytest users with open source projects, for a month's effort of getting new development teams started with pytest.
In 2015 we are trying this for the first time. In February and March 2015 we will gather volunteers on both sides, in April we will do the work, and in May we will evaluate how it went. This effort is being coordinated by Brianna Laugher. If you have any questions or comments, you can raise them on the `@pytestdotorg twitter account <https://twitter.com/pytestdotorg>`_ the `issue tracker`_ or the `pytest-dev mailing list`_.
In 2015 we are trying this for the first time. In February and March 2015 we will gather volunteers on both sides, in April we will do the work, and in May we will evaluate how it went. This effort is being coordinated by Brianna Laugher. If you have any questions or comments, you can raise them on the `@pytestdotorg twitter account <https://twitter.com/pytestdotorg>`_\, the :issue:`issue tracker <676>` or the `pytest-dev mailing list`_.
.. _`issue tracker`: https://github.com/pytest-dev/pytest/issues/676
.. _`pytest-dev mailing list`: https://mail.python.org/mailman/listinfo/pytest-dev
@@ -45,7 +44,7 @@ Partner projects, sign up here! (by 22 March)
What does it mean to "adopt pytest"?
-----------------------------------------
There can be many different definitions of "success". Pytest can run many `nose and unittest`_ tests by default, so using pytest as your testrunner may be possible from day 1. Job done, right?
There can be many different definitions of "success". Pytest can run many nose_ and unittest_ tests by default, so using pytest as your testrunner may be possible from day 1. Job done, right?
Progressive success might look like:
@@ -63,7 +62,8 @@ Progressive success might look like:
It may be after the month is up, the partner project decides that pytest is not right for it. That's okay - hopefully the pytest team will also learn something about its weaknesses or deficiencies.
.. _`nose and unittest`: faq.html#how-does-pytest-relate-to-nose-and-unittest
.. _nose: nose.html
.. _unittest: unittest.html
.. _assert: assert.html
.. _pycmd: https://bitbucket.org/hpk42/pycmd/overview
.. _`setUp/tearDown methods`: xunit_setup.html

View File

@@ -6,6 +6,30 @@ Release announcements
:maxdepth: 2
release-7.3.2
release-7.3.1
release-7.3.0
release-7.2.2
release-7.2.1
release-7.2.0
release-7.1.3
release-7.1.2
release-7.1.1
release-7.1.0
release-7.0.1
release-7.0.0
release-7.0.0rc1
release-6.2.5
release-6.2.4
release-6.2.3
release-6.2.2
release-6.2.1
release-6.2.0
release-6.1.2
release-6.1.1
release-6.1.0
release-6.0.2
release-6.0.1
release-6.0.0
release-6.0.0rc1
release-5.4.3

View File

@@ -36,12 +36,12 @@ New Features
import pytest ; pytest.main(arglist, pluginlist)
see http://pytest.org/en/stable/usage.html for details.
see http://pytest.org/en/stable/how-to/usage.html for details.
- new and better reporting information in assert expressions
if comparing lists, sequences or strings.
see http://pytest.org/en/stable/assert.html#newreport
see http://pytest.org/en/stable/how-to/assert.html#newreport
- new configuration through ini-files (setup.cfg or tox.ini recognized),
for example::
@@ -50,7 +50,7 @@ New Features
norecursedirs = .hg data* # don't ever recurse in such dirs
addopts = -x --pyargs # add these command line options by default
see http://pytest.org/en/stable/customize.html
see http://pytest.org/en/stable/reference/customize.html
- improved standard unittest support. In general py.test should now
better be able to run custom unittest.TestCases like twisted trial

View File

@@ -57,7 +57,7 @@ Changes between 2.0.0 and 2.0.1
- refinements to "collecting" output on non-ttys
- refine internal plugin registration and --traceconfig output
- introduce a mechanism to prevent/unregister plugins from the
command line, see http://pytest.org/en/stable/plugins.html#cmdunregister
command line, see http://pytest.org/en/stable/how-to/plugins.html#cmdunregister
- activate resultlog plugin by default
- fix regression wrt yielded tests which due to the
collection-before-running semantics were not

View File

@@ -12,7 +12,7 @@ courtesy of Benjamin Peterson. You can now safely use ``assert``
statements in test modules without having to worry about side effects
or python optimization ("-OO") options. This is achieved by rewriting
assert statements in test modules upon import, using a PEP302 hook.
See https://docs.pytest.org/en/stable/assert.html for
See https://docs.pytest.org/en/stable/how-to/assert.html for
detailed information. The work has been partly sponsored by my company,
merlinux GmbH.
@@ -24,7 +24,7 @@ If you want to install or upgrade pytest, just type one of::
easy_install -U pytest
best,
holger krekel / http://merlinux.eu
holger krekel / https://merlinux.eu/
Changes between 2.0.3 and 2.1.0
----------------------------------------------

View File

@@ -20,7 +20,7 @@ If you want to install or upgrade pytest, just type one of::
easy_install -U pytest
best,
holger krekel / http://merlinux.eu
holger krekel / https://merlinux.eu/
Changes between 2.1.0 and 2.1.1
----------------------------------------------

View File

@@ -19,7 +19,7 @@ If you want to install or upgrade pytest, just type one of::
easy_install -U pytest
best,
holger krekel / http://merlinux.eu
holger krekel / https://merlinux.eu/
Changes between 2.1.1 and 2.1.2
----------------------------------------

View File

@@ -9,7 +9,7 @@ with these improvements:
- new @pytest.mark.parametrize decorator to run tests with different arguments
- new metafunc.parametrize() API for parametrizing arguments independently
- see examples at http://pytest.org/en/stable/example/parametrize.html
- see examples at http://pytest.org/en/stable/example/how-to/parametrize.html
- NOTE that parametrize() related APIs are still a bit experimental
and might change in future releases.
@@ -78,7 +78,7 @@ Changes between 2.1.3 and 2.2.0
or through plugin hooks. Also introduce a "--strict" option which
will treat unregistered markers as errors
allowing to avoid typos and maintain a well described set of markers
for your test suite. See examples at http://pytest.org/en/stable/mark.html
for your test suite. See examples at http://pytest.org/en/stable/how-to/mark.html
and its links.
- issue50: introduce "-m marker" option to select tests based on markers
(this is a stricter and more predictable version of "-k" in that "-m"

View File

@@ -13,12 +13,12 @@ re-usable fixture design.
For detailed info and tutorial-style examples, see:
http://pytest.org/en/stable/fixture.html
http://pytest.org/en/stable/explanation/fixtures.html
Moreover, there is now support for using pytest fixtures/funcargs with
unittest-style suites, see here for examples:
http://pytest.org/en/stable/unittest.html
http://pytest.org/en/stable/how-to/unittest.html
Besides, more unittest-test suites are now expected to "simply work"
with pytest.
@@ -94,7 +94,7 @@ Changes between 2.2.4 and 2.3.0
- pluginmanager.register(...) now raises ValueError if the
plugin has been already registered or the name is taken
- fix issue159: improve http://pytest.org/en/stable/faq.html
- fix issue159: improve https://docs.pytest.org/en/6.0.1/faq.html
especially with respect to the "magic" history, also mention
pytest-django, trial and unittest integration.

View File

@@ -16,7 +16,7 @@ comes with the following fixes and features:
- yielded test functions will now have autouse-fixtures active but
cannot accept fixtures as funcargs - it's anyway recommended to
rather use the post-2.0 parametrize features instead of yield, see:
http://pytest.org/en/stable/example/parametrize.html
http://pytest.org/en/stable/example/how-to/parametrize.html
- fix autouse-issue where autouse-fixtures would not be discovered
if defined in an a/conftest.py file and tests in a/tests/test_some.py
- fix issue226 - LIFO ordering for fixture teardowns

View File

@@ -23,14 +23,13 @@ a full list of details. A few feature highlights:
called if the corresponding setup method succeeded.
- integrate tab-completion on command line options if you
have `argcomplete <https://pypi.org/project/argcomplete/>`_
configured.
have :pypi:`argcomplete` configured.
- allow boolean expression directly with skipif/xfail
if a "reason" is also specified.
- a new hook ``pytest_load_initial_conftests`` allows plugins like
`pytest-django <https://pypi.org/project/pytest-django/>`_ to
:pypi:`pytest-django` to
influence the environment before conftest files import ``django``.
- reporting: color the last line red or green depending if

View File

@@ -11,7 +11,7 @@ clear information about the circumstances and a simple example which
reproduces the problem.
The issue tracker is of course not empty now. We have many remaining
"enhacement" issues which we'll hopefully can tackle in 2014 with your
"enhancement" issues which we'll hopefully can tackle in 2014 with your
help.
For those who use older Python versions, please note that pytest is not

View File

@@ -1,7 +1,7 @@
pytest-2.5.1: fixes and new home page styling
===========================================================================
pytest is a mature Python testing tool with more than a 1000 tests
pytest is a mature Python testing tool with more than 1000 tests
against itself, passing on many different interpreters and platforms.
The 2.5.1 release maintains the "zero-reported-bugs" promise by fixing

View File

@@ -1,7 +1,7 @@
pytest-2.5.2: fixes
===========================================================================
pytest is a mature Python testing tool with more than a 1000 tests
pytest is a mature Python testing tool with more than 1000 tests
against itself, passing on many different interpreters and platforms.
The 2.5.2 release fixes a few bugs with two maybe-bugs remaining and

View File

@@ -1,7 +1,7 @@
pytest-2.6.0: shorter tracebacks, new warning system, test runner compat
===========================================================================
pytest is a mature Python testing tool with more than a 1000 tests
pytest is a mature Python testing tool with more than 1000 tests
against itself, passing on many different interpreters and platforms.
The 2.6.0 release should be drop-in backward compatible to 2.5.2 and

View File

@@ -1,7 +1,7 @@
pytest-2.6.1: fixes and new xfail feature
===========================================================================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
The 2.6.1 release is drop-in compatible to 2.5.2 and actually fixes some
regressions introduced with 2.6.0. It also brings a little feature

View File

@@ -1,7 +1,7 @@
pytest-2.6.2: few fixes and cx_freeze support
===========================================================================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is drop-in compatible to 2.5.2 and 2.6.X. It also
brings support for including pytest with cx_freeze or similar

View File

@@ -1,7 +1,7 @@
pytest-2.6.3: fixes and little improvements
===========================================================================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is drop-in compatible to 2.5.2 and 2.6.X.
See below for the changes and see docs at:

View File

@@ -1,7 +1,7 @@
pytest-2.7.0: fixes, features, speed improvements
===========================================================================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.6.X.

View File

@@ -1,7 +1,7 @@
pytest-2.7.1: bug fixes
=======================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.7.0.

View File

@@ -1,7 +1,7 @@
pytest-2.7.2: bug fixes
=======================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.7.1.

View File

@@ -1,7 +1,7 @@
pytest-2.8.2: bug fixes
=======================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.8.1.

View File

@@ -1,7 +1,7 @@
pytest-2.8.3: bug fixes
=======================
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.8.2.

View File

@@ -1,7 +1,7 @@
pytest-2.8.4
============
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.8.2.

View File

@@ -1,7 +1,7 @@
pytest-2.8.5
============
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.8.4.

View File

@@ -1,7 +1,7 @@
pytest-2.8.6
============
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.8.5.

View File

@@ -4,7 +4,7 @@ pytest-2.8.7
This is a hotfix release to solve a regression
in the builtin monkeypatch plugin that got introduced in 2.8.6.
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
This release is supposed to be drop-in compatible to 2.8.5.

View File

@@ -1,7 +1,7 @@
pytest-2.9.0
============
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
See below for the changes and see docs at:
@@ -45,29 +45,29 @@ The py.test Development Team
**New Features**
* New ``pytest.mark.skip`` mark, which unconditionally skips marked tests.
Thanks `@MichaelAquilina`_ for the complete PR (`#1040`_).
Thanks :user:`MichaelAquilina` for the complete PR (:pull:`1040`).
* ``--doctest-glob`` may now be passed multiple times in the command-line.
Thanks `@jab`_ and `@nicoddemus`_ for the PR.
Thanks :user:`jab` and :user:`nicoddemus` for the PR.
* New ``-rp`` and ``-rP`` reporting options give the summary and full output
of passing tests, respectively. Thanks to `@codewarrior0`_ for the PR.
of passing tests, respectively. Thanks to :user:`codewarrior0` for the PR.
* ``pytest.mark.xfail`` now has a ``strict`` option which makes ``XPASS``
tests to fail the test suite, defaulting to ``False``. There's also a
``xfail_strict`` ini option that can be used to configure it project-wise.
Thanks `@rabbbit`_ for the request and `@nicoddemus`_ for the PR (`#1355`_).
Thanks :user:`rabbbit` for the request and :user:`nicoddemus` for the PR (:issue:`1355`).
* ``Parser.addini`` now supports options of type ``bool``. Thanks
`@nicoddemus`_ for the PR.
:user:`nicoddemus` for the PR.
* New ``ALLOW_BYTES`` doctest option strips ``b`` prefixes from byte strings
in doctest output (similar to ``ALLOW_UNICODE``).
Thanks `@jaraco`_ for the request and `@nicoddemus`_ for the PR (`#1287`_).
Thanks :user:`jaraco` for the request and :user:`nicoddemus` for the PR (:issue:`1287`).
* give a hint on KeyboardInterrupt to use the --fulltrace option to show the errors,
this fixes `#1366`_.
Thanks to `@hpk42`_ for the report and `@RonnyPfannschmidt`_ for the PR.
this fixes :issue:`1366`.
Thanks to :user:`hpk42` for the report and :user:`RonnyPfannschmidt` for the PR.
* catch IndexError exceptions when getting exception source location. This fixes
pytest internal error for dynamically generated code (fixtures and tests)
@@ -91,69 +91,44 @@ The py.test Development Team
`pylib <https://pylib.readthedocs.io/en/stable/>`_.
* ``pytest_enter_pdb`` now optionally receives the pytest config object.
Thanks `@nicoddemus`_ for the PR.
Thanks :user:`nicoddemus` for the PR.
* Removed code and documentation for Python 2.5 or lower versions,
including removal of the obsolete ``_pytest.assertion.oldinterpret`` module.
Thanks `@nicoddemus`_ for the PR (`#1226`_).
Thanks :user:`nicoddemus` for the PR (:issue:`1226`).
* Comparisons now always show up in full when ``CI`` or ``BUILD_NUMBER`` is
found in the environment, even when -vv isn't used.
Thanks `@The-Compiler`_ for the PR.
Thanks :user:`The-Compiler` for the PR.
* ``--lf`` and ``--ff`` now support long names: ``--last-failed`` and
``--failed-first`` respectively.
Thanks `@MichaelAquilina`_ for the PR.
Thanks :user:`MichaelAquilina` for the PR.
* Added expected exceptions to pytest.raises fail message
* Collection only displays progress ("collecting X items") when in a terminal.
This avoids cluttering the output when using ``--color=yes`` to obtain
colors in CI integrations systems (`#1397`_).
colors in CI integrations systems (:issue:`1397`).
**Bug Fixes**
* The ``-s`` and ``-c`` options should now work under ``xdist``;
``Config.fromdictargs`` now represents its input much more faithfully.
Thanks to `@bukzor`_ for the complete PR (`#680`_).
Thanks to :user:`bukzor` for the complete PR (:issue:`680`).
* Fix (`#1290`_): support Python 3.5's ``@`` operator in assertion rewriting.
Thanks `@Shinkenjoe`_ for report with test case and `@tomviner`_ for the PR.
* Fix (:issue:`1290`): support Python 3.5's ``@`` operator in assertion rewriting.
Thanks :user:`Shinkenjoe` for report with test case and :user:`tomviner` for the PR.
* Fix formatting utf-8 explanation messages (`#1379`_).
Thanks `@biern`_ for the PR.
* Fix formatting utf-8 explanation messages (:issue:`1379`).
Thanks :user:`biern` for the PR.
* Fix `traceback style docs`_ to describe all of the available options
(auto/long/short/line/native/no), with ``auto`` being the default since v2.6.
Thanks `@hackebrot`_ for the PR.
Thanks :user:`hackebrot` for the PR.
* Fix (`#1422`_): junit record_xml_property doesn't allow multiple records
* Fix (:issue:`1422`): junit record_xml_property doesn't allow multiple records
with same name.
.. _`traceback style docs`: https://pytest.org/en/stable/usage.html#modifying-python-traceback-printing
.. _#1422: https://github.com/pytest-dev/pytest/issues/1422
.. _#1379: https://github.com/pytest-dev/pytest/issues/1379
.. _#1366: https://github.com/pytest-dev/pytest/issues/1366
.. _#1040: https://github.com/pytest-dev/pytest/pull/1040
.. _#680: https://github.com/pytest-dev/pytest/issues/680
.. _#1287: https://github.com/pytest-dev/pytest/pull/1287
.. _#1226: https://github.com/pytest-dev/pytest/pull/1226
.. _#1290: https://github.com/pytest-dev/pytest/pull/1290
.. _#1355: https://github.com/pytest-dev/pytest/pull/1355
.. _#1397: https://github.com/pytest-dev/pytest/issues/1397
.. _@biern: https://github.com/biern
.. _@MichaelAquilina: https://github.com/MichaelAquilina
.. _@bukzor: https://github.com/bukzor
.. _@hpk42: https://github.com/hpk42
.. _@nicoddemus: https://github.com/nicoddemus
.. _@jab: https://github.com/jab
.. _@codewarrior0: https://github.com/codewarrior0
.. _@jaraco: https://github.com/jaraco
.. _@The-Compiler: https://github.com/The-Compiler
.. _@Shinkenjoe: https://github.com/Shinkenjoe
.. _@tomviner: https://github.com/tomviner
.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
.. _@rabbbit: https://github.com/rabbbit
.. _@hackebrot: https://github.com/hackebrot
.. _`traceback style docs`: https://pytest.org/en/stable/how-to/output.html#modifying-python-traceback-printing

View File

@@ -1,7 +1,7 @@
pytest-2.9.1
============
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
See below for the changes and see docs at:
@@ -37,31 +37,21 @@ The py.test Development Team
**Bug Fixes**
* Improve error message when a plugin fails to load.
Thanks `@nicoddemus`_ for the PR.
Thanks :user:`nicoddemus` for the PR.
* Fix (`#1178 <https://github.com/pytest-dev/pytest/issues/1178>`_):
* Fix (:issue:`1178`):
``pytest.fail`` with non-ascii characters raises an internal pytest error.
Thanks `@nicoddemus`_ for the PR.
Thanks :user:`nicoddemus` for the PR.
* Fix (`#469`_): junit parses report.nodeid incorrectly, when params IDs
contain ``::``. Thanks `@tomviner`_ for the PR (`#1431`_).
* Fix (:issue:`469`): junit parses report.nodeid incorrectly, when params IDs
contain ``::``. Thanks :user:`tomviner` for the PR (:pull:`1431`).
* Fix (`#578 <https://github.com/pytest-dev/pytest/issues/578>`_): SyntaxErrors
* Fix (:issue:`578`): SyntaxErrors
containing non-ascii lines at the point of failure generated an internal
py.test error.
Thanks `@asottile`_ for the report and `@nicoddemus`_ for the PR.
Thanks :user:`asottile` for the report and :user:`nicoddemus` for the PR.
* Fix (`#1437`_): When passing in a bytestring regex pattern to parameterize
* Fix (:issue:`1437`): When passing in a bytestring regex pattern to parameterize
attempt to decode it as utf-8 ignoring errors.
* Fix (`#649`_): parametrized test nodes cannot be specified to run on the command line.
.. _#1437: https://github.com/pytest-dev/pytest/issues/1437
.. _#469: https://github.com/pytest-dev/pytest/issues/469
.. _#1431: https://github.com/pytest-dev/pytest/pull/1431
.. _#649: https://github.com/pytest-dev/pytest/issues/649
.. _@asottile: https://github.com/asottile
.. _@nicoddemus: https://github.com/nicoddemus
.. _@tomviner: https://github.com/tomviner
* Fix (:issue:`649`): parametrized test nodes cannot be specified to run on the command line.

View File

@@ -1,7 +1,7 @@
pytest-2.9.2
============
pytest is a mature Python testing tool with more than a 1100 tests
pytest is a mature Python testing tool with more than 1100 tests
against itself, passing on many different interpreters and platforms.
See below for the changes and see docs at:
@@ -39,40 +39,27 @@ The py.test Development Team
**Bug Fixes**
* fix `#510`_: skip tests where one parameterize dimension was empty
thanks Alex Stapleton for the Report and `@RonnyPfannschmidt`_ for the PR
* fix :issue:`510`: skip tests where one parameterize dimension was empty
thanks Alex Stapleton for the Report and :user:`RonnyPfannschmidt` for the PR
* Fix Xfail does not work with condition keyword argument.
Thanks `@astraw38`_ for reporting the issue (`#1496`_) and `@tomviner`_
for PR the (`#1524`_).
Thanks :user:`astraw38` for reporting the issue (:issue:`1496`) and :user:`tomviner`
for PR the (:pull:`1524`).
* Fix win32 path issue when putting custom config file with absolute path
in ``pytest.main("-c your_absolute_path")``.
* Fix maximum recursion depth detection when raised error class is not aware
of unicode/encoded bytes.
Thanks `@prusse-martin`_ for the PR (`#1506`_).
Thanks :user:`prusse-martin` for the PR (:pull:`1506`).
* Fix ``pytest.mark.skip`` mark when used in strict mode.
Thanks `@pquentin`_ for the PR and `@RonnyPfannschmidt`_ for
Thanks :user:`pquentin` for the PR and :user:`RonnyPfannschmidt` for
showing how to fix the bug.
* Minor improvements and fixes to the documentation.
Thanks `@omarkohl`_ for the PR.
Thanks :user:`omarkohl` for the PR.
* Fix ``--fixtures`` to show all fixture definitions as opposed to just
one per fixture name.
Thanks to `@hackebrot`_ for the PR.
.. _#510: https://github.com/pytest-dev/pytest/issues/510
.. _#1506: https://github.com/pytest-dev/pytest/pull/1506
.. _#1496: https://github.com/pytest-dev/pytest/issues/1496
.. _#1524: https://github.com/pytest-dev/pytest/pull/1524
.. _@astraw38: https://github.com/astraw38
.. _@hackebrot: https://github.com/hackebrot
.. _@omarkohl: https://github.com/omarkohl
.. _@pquentin: https://github.com/pquentin
.. _@prusse-martin: https://github.com/prusse-martin
.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
.. _@tomviner: https://github.com/tomviner
Thanks to :user:`hackebrot` for the PR.

View File

@@ -3,7 +3,7 @@ pytest-3.0.0
The pytest team is proud to announce the 3.0.0 release!
pytest is a mature Python testing tool with more than a 1600 tests
pytest is a mature Python testing tool with more than 1600 tests
against itself, passing on many different interpreters and platforms.
This release contains a lot of bugs fixes and improvements, and much of

View File

@@ -3,7 +3,7 @@ pytest-3.1.0
The pytest team is proud to announce the 3.1.0 release!
pytest is a mature Python testing tool with more than a 1600 tests
pytest is a mature Python testing tool with more than 1600 tests
against itself, passing on many different interpreters and platforms.
This release contains a bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.10.0
The pytest team is proud to announce the 3.10.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.2.0
The pytest team is proud to announce the 3.2.0 release!
pytest is a mature Python testing tool with more than a 1600 tests
pytest is a mature Python testing tool with more than 1600 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.3.0
The pytest team is proud to announce the 3.3.0 release!
pytest is a mature Python testing tool with more than a 1600 tests
pytest is a mature Python testing tool with more than 1600 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.4.0
The pytest team is proud to announce the 3.4.0 release!
pytest is a mature Python testing tool with more than a 1600 tests
pytest is a mature Python testing tool with more than 1600 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.5.0
The pytest team is proud to announce the 3.5.0 release!
pytest is a mature Python testing tool with more than a 1600 tests
pytest is a mature Python testing tool with more than 1600 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.6.0
The pytest team is proud to announce the 3.6.0 release!
pytest is a mature Python testing tool with more than a 1600 tests
pytest is a mature Python testing tool with more than 1600 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.7.0
The pytest team is proud to announce the 3.7.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.8.0
The pytest team is proud to announce the 3.8.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-3.9.0
The pytest team is proud to announce the 3.9.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-4.0.0
The pytest team is proud to announce the 4.0.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-4.1.0
The pytest team is proud to announce the 4.1.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-4.2.0
The pytest team is proud to announce the 4.2.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-4.3.0
The pytest team is proud to announce the 4.3.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-4.4.0
The pytest team is proud to announce the 4.4.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-4.5.0
The pytest team is proud to announce the 4.5.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-4.6.0
The pytest team is proud to announce the 4.6.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-5.0.0
The pytest team is proud to announce the 5.0.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-5.1.0
The pytest team is proud to announce the 5.1.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-5.2.0
The pytest team is proud to announce the 5.2.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-5.3.0
The pytest team is proud to announce the 5.3.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bugs fixes and improvements, so users are encouraged

View File

@@ -3,7 +3,7 @@ pytest-5.4.0
The pytest team is proud to announce the 5.4.0 release!
pytest is a mature Python testing tool with more than a 2000 tests
pytest is a mature Python testing tool with more than 2000 tests
against itself, passing on many different interpreters and platforms.
This release contains a number of bug fixes and improvements, so users are encouraged

View File

@@ -0,0 +1,21 @@
pytest-6.0.1
=======================================
pytest 6.0.1 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:
* Bruno Oliveira
* Mattreex
* Ran Benita
* hp310780
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,19 @@
pytest-6.0.2
=======================================
pytest 6.0.2 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Bruno Oliveira
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,44 @@
pytest-6.1.0
=======================================
The pytest team is proud to announce the 6.1.0 release!
This release contains new features, improvements, bug fixes, and breaking changes, so users
are encouraged to take a look at the CHANGELOG carefully:
https://docs.pytest.org/en/stable/changelog.html
For complete documentation, please visit:
https://docs.pytest.org/en/stable/
As usual, you can upgrade from PyPI via:
pip install -U pytest
Thanks to all of the contributors to this release:
* Anthony Sottile
* Bruno Oliveira
* C. Titus Brown
* Drew Devereux
* Faris A Chugthai
* Florian Bruhin
* Hugo van Kemenade
* Hynek Schlawack
* Joseph Lucas
* Kamran Ahmad
* Mattreex
* Maximilian Cosmo Sitter
* Ran Benita
* Rüdiger Busche
* Sam Estep
* Sorin Sbarnea
* Thomas Grainger
* Vipul Kumar
* Yutaro Ikeda
* hp310780
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,18 @@
pytest-6.1.1
=======================================
pytest 6.1.1 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,22 @@
pytest-6.1.2
=======================================
pytest 6.1.2 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Bruno Oliveira
* Manuel Mariñez
* Ran Benita
* Vasilis Gerakaris
* William Jamir Silva
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,76 @@
pytest-6.2.0
=======================================
The pytest team is proud to announce the 6.2.0 release!
This release contains new features, improvements, bug fixes, and breaking changes, so users
are encouraged to take a look at the CHANGELOG carefully:
https://docs.pytest.org/en/stable/changelog.html
For complete documentation, please visit:
https://docs.pytest.org/en/stable/
As usual, you can upgrade from PyPI via:
pip install -U pytest
Thanks to all of the contributors to this release:
* Adam Johnson
* Albert Villanova del Moral
* Anthony Sottile
* Anton
* Ariel Pillemer
* Bruno Oliveira
* Charles Aracil
* Christine M
* Christine Mecklenborg
* Cserna Zsolt
* Dominic Mortlock
* Emiel van de Laar
* Florian Bruhin
* Garvit Shubham
* Gustavo Camargo
* Hugo Martins
* Hugo van Kemenade
* Jakob van Santen
* Josias Aurel
* Jürgen Gmach
* Karthikeyan Singaravelan
* Katarzyna
* Kyle Altendorf
* Manuel Mariñez
* Matthew Hughes
* Matthias Gabriel
* Max Voitko
* Maximilian Cosmo Sitter
* Mikhail Fesenko
* Nimesh Vashistha
* Pedro Algarvio
* Petter Strandmark
* Prakhar Gurunani
* Prashant Sharma
* Ran Benita
* Ronny Pfannschmidt
* Sanket Duthade
* Shubham Adep
* Simon K
* Tanvi Mehta
* Thomas Grainger
* Tim Hoffmann
* Vasilis Gerakaris
* William Jamir Silva
* Zac Hatfield-Dodds
* crricks
* dependabot[bot]
* duthades
* frankgerhardt
* kwgchi
* mickeypash
* symonk
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,20 @@
pytest-6.2.1
=======================================
pytest 6.2.1 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Bruno Oliveira
* Jakob van Santen
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,21 @@
pytest-6.2.2
=======================================
pytest 6.2.2 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Adam Johnson
* Bruno Oliveira
* Chris NeJame
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,19 @@
pytest-6.2.3
=======================================
pytest 6.2.3 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Bruno Oliveira
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,22 @@
pytest-6.2.4
=======================================
pytest 6.2.4 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Anthony Sottile
* Bruno Oliveira
* Christian Maurer
* Florian Bruhin
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,30 @@
pytest-6.2.5
=======================================
pytest 6.2.5 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Anthony Sottile
* Bruno Oliveira
* Brylie Christopher Oxley
* Daniel Asztalos
* Florian Bruhin
* Jason Haugen
* MapleCCC
* Michał Górny
* Miro Hrončok
* Ran Benita
* Ronny Pfannschmidt
* Sylvain Bellemare
* Thomas Güttler
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,74 @@
pytest-7.0.0
=======================================
The pytest team is proud to announce the 7.0.0 release!
This release contains new features, improvements, bug fixes, and breaking changes, so users
are encouraged to take a look at the CHANGELOG carefully:
https://docs.pytest.org/en/stable/changelog.html
For complete documentation, please visit:
https://docs.pytest.org/en/stable/
As usual, you can upgrade from PyPI via:
pip install -U pytest
Thanks to all of the contributors to this release:
* Adam J. Stewart
* Alexander King
* Amin Alaee
* Andrew Neitsch
* Anthony Sottile
* Ben Davies
* Bernát Gábor
* Brian Okken
* Bruno Oliveira
* Cristian Vera
* Dan Alvizu
* David Szotten
* Eddie
* Emmanuel Arias
* Emmanuel Meric de Bellefon
* Eric Liu
* Florian Bruhin
* GergelyKalmar
* Graeme Smecher
* Harshna
* Hugo van Kemenade
* Jakub Kulík
* James Myatt
* Jeff Rasley
* Kale Kundert
* Kian Meng, Ang
* Miro Hrončok
* Naveen-Pratap
* Oleg Höfling
* Olga Matoula
* Ran Benita
* Ronny Pfannschmidt
* Simon K
* Srip
* Sören Wegener
* Taneli Hukkinen
* Terje Runde
* Thomas Grainger
* Thomas Hisch
* William Jamir Silva
* Yuval Shimon
* Zac Hatfield-Dodds
* andrewdotn
* denivyruck
* ericluoliu
* oleg.hoefling
* symonk
* ziebam
* Éloi Rivard
* Éric
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,74 @@
pytest-7.0.0rc1
=======================================
The pytest team is proud to announce the 7.0.0rc1 prerelease!
This is a prerelease, not intended for production use, but to test the upcoming features and improvements
in order to catch any major problems before the final version is released to the major public.
We appreciate your help testing this out before the final release, making sure to report any
regressions to our issue tracker:
https://github.com/pytest-dev/pytest/issues
When doing so, please include the string ``[prerelease]`` in the title.
You can upgrade from PyPI via:
pip install pytest==7.0.0rc1
Users are encouraged to take a look at the CHANGELOG carefully:
https://docs.pytest.org/en/7.0.x/changelog.html
Thanks to all the contributors to this release:
* Adam J. Stewart
* Alexander King
* Amin Alaee
* Andrew Neitsch
* Anthony Sottile
* Ben Davies
* Bernát Gábor
* Brian Okken
* Bruno Oliveira
* Cristian Vera
* David Szotten
* Eddie
* Emmanuel Arias
* Emmanuel Meric de Bellefon
* Eric Liu
* Florian Bruhin
* GergelyKalmar
* Graeme Smecher
* Harshna
* Hugo van Kemenade
* Jakub Kulík
* James Myatt
* Jeff Rasley
* Kale Kundert
* Miro Hrončok
* Naveen-Pratap
* Oleg Höfling
* Ran Benita
* Ronny Pfannschmidt
* Simon K
* Srip
* Sören Wegener
* Taneli Hukkinen
* Terje Runde
* Thomas Grainger
* Thomas Hisch
* William Jamir Silva
* Zac Hatfield-Dodds
* andrewdotn
* denivyruck
* ericluoliu
* oleg.hoefling
* symonk
* ziebam
* Éloi Rivard
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,20 @@
pytest-7.0.1
=======================================
pytest 7.0.1 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Anthony Sottile
* Bruno Oliveira
* Ran Benita
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,48 @@
pytest-7.1.0
=======================================
The pytest team is proud to announce the 7.1.0 release!
This release contains new features, improvements, and bug fixes,
the full list of changes is available in the changelog:
https://docs.pytest.org/en/stable/changelog.html
For complete documentation, please visit:
https://docs.pytest.org/en/stable/
As usual, you can upgrade from PyPI via:
pip install -U pytest
Thanks to all of the contributors to this release:
* Akuli
* Andrew Svetlov
* Anthony Sottile
* Brett Holman
* Bruno Oliveira
* Chris NeJame
* Dan Alvizu
* Elijah DeLee
* Emmanuel Arias
* Fabian Egli
* Florian Bruhin
* Gabor Szabo
* Hasan Ramezani
* Hugo van Kemenade
* Kian Meng, Ang
* Kojo Idrissa
* Masaru Tsuchiyama
* Olga Matoula
* P. L. Lim
* Ran Benita
* Tobias Deiminger
* Yuval Shimon
* eduardo naufel schettino
* Éric
Happy testing,
The pytest Development Team

View File

@@ -0,0 +1,18 @@
pytest-7.1.1
=======================================
pytest 7.1.1 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at https://docs.pytest.org/en/stable/changelog.html.
Thanks to all of the contributors to this release:
* Ran Benita
Happy testing,
The pytest Development Team

Some files were not shown because too many files have changed in this diff Show More