Commit Graph

15461 Commits

Author SHA1 Message Date
Benjamin Schubert 19934b2b0c Merge the AlwaysDispathPrettyPrinter into the now vendored PrettyPrinter
We don't need to keep the separation anymore, and this will make it
easier to extend
2023-11-20 13:00:00 +00:00
Benjamin Schubert 2953120003 Fix typing information for the pprint module
There is more type information that could be added. We can add those
later to make it easier, this is jsut the minimum to allow linting to
pass
2023-11-20 13:00:00 +00:00
Benjamin Schubert 5fae5ef73e Apply project-wide formatting standard to the pprint module (black) 2023-11-20 13:00:00 +00:00
Benjamin Schubert 66f2f20eff Run pyupgrade on the pprint module 2023-11-20 13:00:00 +00:00
Benjamin Schubert 2322668344 Remove unneeded pprint interfaces
There are parts of the original pprint module that we won't need, let's
limit the surface and remove the unnecessary code
2023-11-20 13:00:00 +00:00
Benjamin Schubert eb6ad08e5d Vendor in the pprint module to allow further modifications
We already have the AlwaysDispatchingPrettyPrinter override of the
default pretty printer. In order to make more in depth changes, we
need to copy the upstream version in, as it doesn't lend itself well to
being extended.

This does a verbatime copy, adding provenance information at the top.
2023-11-20 13:00:00 +00:00
Anthony Sottile 0916191827
use name-independent github actions badge (#11628)
if we were ever to change the `name:` field in `test.yml` this would suddenly break -- this references the workflow file directly (and is what github generates now for badges)
2023-11-19 13:19:30 -03:00
github-actions[bot] 476bab84f7
[automated] Update plugin list (#11627)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-11-19 11:57:25 -03:00
Patrick Lannigan 9dc1fc4523
Add verbosity_assertions and config.get_verbosity
Fixes #11387
2023-11-19 11:56:29 -03:00
Avasam 80442ae2f2
Use `False`, instead of `None` as default for `_XfailMarkDecorator`'s `condition` param and update doc (#11600) 2023-11-17 10:42:05 +02:00
Miro Hrončok 223e030604
XFAIL TestLocalPath.test_make_numbered_dir_multiprocess_safe (#11611)
The tested py.path.local.make_numbered_dir function is *not*
multiprocess safe, because is uses os.listdir which itself is not.

The os.listdir documentation explicitly states that:

> If a file is removed from or added to the directory during the call
> of this function, whether a name for that file be included is unspecified.

This can lead to a race when:

 1. process A attempts to create directory N
 2. the creation fails, as another process already created it in the meantime
 3. process A calls listdir to determine a more recent maxnum
 4. processes B+ repeatedly create newer directories and they delete directory N
 5. process A doesn't have directory N or any newer directory in listdir result
 6. process A attempts to create directory N again and raises

For details, see https://github.com/pytest-dev/pytest/issues/11603#issuecomment-1805708144
and bellow.

Additionally, the test itself has a race in batch_make_numbered_dirs.
When this functions attempts to write to repro-N/foo,
repro-N may have already been removed by another process.

For details, see https://github.com/pytest-dev/pytest/issues/11603#issuecomment-1804714313
and bellow.

---

The tested py.path.local.make_numbered_dir function is not used in pytest.
There is a different implementation in _pytest.pathlib.

Closes #11603
2023-11-14 11:41:35 -03:00
Bruno Oliveira 1eca302c4d
Merge pull request #11613 from pytest-dev/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2023-11-14 07:50:59 -03:00
Bruno Oliveira 970d11cf34 Explicitly export error and path from py
Required by mypy 1.7.0
2023-11-14 07:29:40 -03:00
pre-commit-ci[bot] d4c56c72d8
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0)
- [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0)
2023-11-13 21:00:52 +00:00
dependabot[bot] 442b09ed9f
build(deps): Bump pytest-django in /testing/plugins_integration (#11609)
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django) from 4.6.0 to 4.7.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.6.0...v4.7.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-13 09:29:21 +01:00
dependabot[bot] 9417aeb2d8
build(deps): Bump pytest-html in /testing/plugins_integration (#11608)
Bumps [pytest-html](https://github.com/pytest-dev/pytest-html) from 4.1.0 to 4.1.1.
- [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/4.1.0...4.1.1)

---
updated-dependencies:
- dependency-name: pytest-html
  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-11-13 09:28:54 +01:00
github-actions[bot] 99f7738810
[automated] Update plugin list (#11607)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-11-12 10:41:08 -03:00
Sharad Nair 7c7bdf4574
Sanitize ini-options default handling #11282 (#11594)
Fixes #11282
2023-11-11 13:08:18 -03:00
Ran Benita 6fe43912be
Merge pull request #11591 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-23.10.0
build(deps): Bump twisted from 23.8.0 to 23.10.0 in /testing/plugins_integration
2023-11-08 09:29:18 +02:00
github-actions[bot] e701df5eb6
[automated] Update plugin list (#11587)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-11-06 18:40:44 -03:00
dependabot[bot] 92cd7950e6
build(deps): Bump pytest-django in /testing/plugins_integration (#11592)
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django) from 4.5.2 to 4.6.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.5.2...v4.6.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 09:26:10 +01:00
dependabot[bot] ef2216c21b
build(deps): Bump hynek/build-and-inspect-python-package (#11589)
Bumps [hynek/build-and-inspect-python-package](https://github.com/hynek/build-and-inspect-python-package) from 1.5.3 to 1.5.4.
- [Release notes](https://github.com/hynek/build-and-inspect-python-package/releases)
- [Changelog](https://github.com/hynek/build-and-inspect-python-package/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hynek/build-and-inspect-python-package/compare/v1.5.3...v1.5.4)

---
updated-dependencies:
- dependency-name: hynek/build-and-inspect-python-package
  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-11-06 07:50:49 +01:00
dependabot[bot] 01a248d2a9
build(deps): Bump pytest-html in /testing/plugins_integration (#11590)
Bumps [pytest-html](https://github.com/pytest-dev/pytest-html) from 4.0.2 to 4.1.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/4.0.2...4.1.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 07:49:53 +01:00
dependabot[bot] 1a7641cf88
build(deps): Bump twisted in /testing/plugins_integration
Bumps [twisted](https://github.com/twisted/twisted) from 23.8.0 to 23.10.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-23.8.0...twisted-23.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-06 03:58:57 +00:00
Bruno Oliveira 70f03dbc3e
Adjustments to assert raises docs (#11586)
Followup from #11578.
2023-11-04 12:37:47 -03:00
Bruno Oliveira 1e02797d15
Improve pytest.raises docs (#11578) 2023-11-04 10:24:57 +00:00
neilmartin2000 13e5ef0102
Created link to PEP-8 in documentation (#11582) 2023-11-03 15:05:05 -03:00
dependabot[bot] 1ea10c20df
build(deps): Bump django in /testing/plugins_integration (#11579)
Bumps [django](https://github.com/django/django) from 4.2.6 to 4.2.7.
- [Commits](https://github.com/django/django/compare/4.2.6...4.2.7)

---
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-11-03 08:27:47 -03:00
Ran Benita 8fb7e8b31e
Merge pull request #11567 from bluetech/fix-ref-tocdepth
doc/reference: fix sidebar TOC depth
2023-10-30 09:01:54 +02:00
Ran Benita 0d74a1c8a0
doc: allow Sphinx 6.x and 7.x (#11568)
They seem to work fine, let's allow them.
2023-10-29 23:00:27 +01:00
Ran Benita 730c7ca0b1
Merge pull request #11566 from pytest-dev/update-plugin-list/patch-738ae2da9
[automated] Update plugin list
2023-10-29 22:48:26 +02:00
Ran Benita 4ecf313604 doc/reference: fix sidebar TOC depth
Previously, the sidebar TOC had unlimited depth, making it useless and
interfering with the content. This seems to have regressed in pytest
7.2.x going by the RTD version selector.
2023-10-29 21:55:17 +02:00
pytest bot d0a09d8627 [automated] Update plugin list 2023-10-29 00:19:06 +00:00
Zac Hatfield-Dodds 738ae2da9d
Merge pull request #11564 from nicoddemus/empty-string-parametrize-11563
Fix crash using empty string for parametrized value more than once
2023-10-27 16:51:31 -04:00
Bruno Oliveira 7156a97f9a Fix crash using empty string for parametrized value more than once
Fixes #11563.
2023-10-27 17:26:12 -03:00
Ziad Kermadi ed8701a57f
Mention -q and -s in the docs (#11558)
Fixes #11507.
2023-10-27 14:35:45 -03:00
Bruno Oliveira 247436819a
Update build-and-inspect-python-package action (#11561)
This should fix the action for Python 3.12.

Ref: hynek/build-and-inspect-python-package#72
2023-10-27 08:32:02 -03:00
Bruno Oliveira c1728948ac
Fix tag name generated by deploy workflow (#11550)
Traditionally pytest publishes tags in the form `X.Y.Z`, however the deploy workflow (copied from somewhere else) published tags in the form `vX.Y.Z`.

This is the root cause of #11548, because it tried to publish the release notes for tag `X.Y.Z` (which did not exist).

Fix #11548
2023-10-25 13:19:47 -03:00
Bruno Oliveira dcd8b145d9
Add deploy instructions using the command-line (#11547)
Tested this to trigger the deploy of #11546.
2023-10-25 10:04:06 -03:00
Bruno Oliveira c7e9b22f37
Merge pull request #11546 from pytest-dev/release-7.4.3 (#11549)
Prepare release 7.4.3

(cherry picked from commit 53df6164b44269f85334eace9c473c3f3a04aae7)
2023-10-24 16:50:13 -03:00
Benjamin Schubert fbe3e29a55
Color the full diff that pytest shows as a diff (#11530)
Related to #11520
2023-10-24 08:42:21 -03:00
pre-commit-ci[bot] 667b9fd7fd
[pre-commit.ci] pre-commit autoupdate (#11543)
updates:
- [github.com/psf/black: 23.9.1 → 23.10.1](https://github.com/psf/black/compare/23.9.1...23.10.1)
- [github.com/pre-commit/mirrors-mypy: v1.6.0 → v1.6.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.0...v1.6.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-24 03:42:43 +02:00
Carsten Grohmann 38f7c1e346
Use pytestconfig instead of request.config in cache example (#11542)
to be consistent with the API documentation.
2023-10-23 15:45:16 -03:00
Bruno Oliveira bcd9664370
Merge pull request #11531 from nicoddemus/ensure-logging-cleanup
Ensure logging tests always cleanup after themselves
2023-10-23 10:55:18 -03:00
Bruno Oliveira 7e69ce7449 Add full type annotations to logging/test_fixture.py 2023-10-23 10:46:55 -03:00
Bruno Oliveira 395bbae8a2 Ensure logging tests always cleanup after themselves
Logging has many global states, and we did foresee this by creating a ``cleanup_disabled_logging`` fixture,
however one might still forget to use it and failures leak later -- sometimes not even in the same PR, because the order
of the tests might change in the future, specially when running under xdist.

This problem surfaced during pytest-dev/pytest#11530, where tests unrelated to the change started to fail.
2023-10-23 10:46:55 -03:00
Bruno Oliveira ee53433542
Configure ReadTheDocs to fail on warnings (#11535)
* Configure ReadTheDocs to fail on warnings

Important to catch broken links and references.

* Remove dead link to distutils configuration docs
2023-10-23 09:56:33 -03:00
dependabot[bot] 304ab8495e
build(deps): Bump pytest-mock in /testing/plugins_integration (#11539)
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.11.1 to 3.12.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.11.1...v3.12.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-23 09:01:08 -03:00
pre-commit-ci[bot] 40e9abd66b
[pre-commit.ci] pre-commit autoupdate (#11510)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-mypy: v1.5.1 → v1.6.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.5.1...v1.6.0)

* Ignore two typing errors after updating to mypy 1.6.0

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
2023-10-23 08:05:40 -03:00
github-actions[bot] cac1eed0ea
[automated] Update plugin list (#11534)
Co-authored-by: pytest bot <pytestbot@users.noreply.github.com>
2023-10-21 23:43:14 -03:00