Florian Bruhin
f573b56bb6
Improve cache test and fix it in Docker ( #8785 )
...
* cache: Move repetitive code to fixture
* cache: Explicitly test for chmod result
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix lint
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-06-23 20:28:09 +02:00
Florian Bruhin
ac10fe0679
tests: Use less conflicting name for directory
...
Otherwise, if e.g. /outside is used for a Docker container, the test will fail
2021-06-22 13:25:52 +02:00
dependabot[bot]
d2886b8d23
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/agronholm/anyio/releases )
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst )
- [Commits](https://github.com/agronholm/anyio/compare/3.1.0...3.2.0 )
---
updated-dependencies:
- dependency-name: anyio[curio,trio]
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 03:01:37 +00:00
Bruno Oliveira
7eb0792cba
Add pytest.version_tuple
...
This adds `pytest.version_tuple`, which makes it simpler for users to do something depending on the pytest version, such as declaring hooks which are introduced in later versions.
This feature was added originally in https://github.com/pypa/setuptools_scm/pull/475 .
Followup to https://github.com/pytest-dev/pytest/pull/7605 .
2021-06-14 09:04:14 -03:00
Bruno Oliveira
c85b21eaa0
Remove outdated docs about pytest.warns and DeprecatedWarning
...
Since #2908 , the user doesn't need to set warning filters to capture
`DeprecationWarning` with `pytest.warns`.
Fix #8666
2021-06-12 12:09:26 -03:00
dependabot[bot]
85faaf8a1d
Bump pytest-django from 4.3.0 to 4.4.0 in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.3.0...v4.4.0 )
---
updated-dependencies:
- dependency-name: pytest-django
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-11 00:18:17 +00:00
dependabot[bot]
b04aa015b9
Bump pytest-cov from 2.12.0 to 2.12.1 in /testing/plugins_integration
...
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov ) from 2.12.0 to 2.12.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases )
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.12.0...v2.12.1 )
---
updated-dependencies:
- dependency-name: pytest-cov
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-10 23:10:22 +00:00
dependabot[bot]
bce0ceafe4
Bump django from 3.2.3 to 3.2.4 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.3 to 3.2.4.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.3...3.2.4 )
---
updated-dependencies:
- dependency-name: django
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-06-07 03:01:43 +00:00
dependabot[bot]
20f00997ff
Bump pytest-rerunfailures in /testing/plugins_integration
...
Bumps [pytest-rerunfailures](https://github.com/pytest-dev/pytest-rerunfailures ) from 9.1.1 to 10.0.
- [Release notes](https://github.com/pytest-dev/pytest-rerunfailures/releases )
- [Changelog](https://github.com/pytest-dev/pytest-rerunfailures/blob/master/CHANGES.rst )
- [Commits](https://github.com/pytest-dev/pytest-rerunfailures/compare/9.1.1...10.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-31 03:01:08 +00:00
Ran Benita
1b5f5326d7
Merge pull request #8695 from bluetech/export-parser
...
argparsing: export Parser and OptionGroup for typing purposes
2021-05-26 11:20:03 +03:00
pre-commit-ci[bot]
c5bf5f6fb0
[pre-commit.ci] pre-commit autoupdate ( #8699 )
...
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/asottile/pyupgrade: v2.16.0 → v2.18.2](https://github.com/asottile/pyupgrade/compare/v2.16.0...v2.18.2 )
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-05-26 11:19:45 +03:00
dependabot[bot]
4a472952f7
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.0.1 to 3.1.0.
- [Release notes](https://github.com/agronholm/anyio/releases )
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst )
- [Commits](https://github.com/agronholm/anyio/compare/3.0.1...3.1.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 03:01:18 +00:00
Ran Benita
538b5c2499
argparsing: export Parser and OptionGroup for typing purposes
...
`Parser` is used by many plugins and custom hooks. `OptionGroup` is
exposed by the `parser.addgroup` API.
The constructors of both are marked private, they are not meant to be
constructed directly.
2021-05-24 00:52:03 +03:00
Zac Hatfield-Dodds
c198a7a67e
Merge pull request #8677 from olgarithms/warns-no-arg-catches-any
2021-05-19 17:47:39 +10:00
dependabot[bot]
53a74feea7
Bump pytest-mock from 3.6.0 to 3.6.1 in /testing/plugins_integration
...
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock ) from 3.6.0 to 3.6.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases )
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.6.0...v3.6.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 10:53:38 +00:00
dependabot[bot]
8872e8e7c7
Bump pytest-django from 4.2.0 to 4.3.0 in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.2.0...v4.3.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 10:51:47 +00:00
Bruno Oliveira
eb7acba9e9
Merge pull request #8683 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2.3
...
Bump django from 3.2.2 to 3.2.3 in /testing/plugins_integration
2021-05-17 07:51:36 -03:00
Olga Matoula
3f414d7bbe
Ignore depredcated warns(None) overload errors from mypy
2021-05-17 09:50:59 +01:00
Olga Matoula
dd8ad3fa9c
Split warns matching string in multiple lines
2021-05-17 09:23:08 +01:00
dependabot[bot]
06718da5d6
Bump django from 3.2.2 to 3.2.3 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.2.2 to 3.2.3.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2.2...3.2.3 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 03:01:19 +00:00
dependabot[bot]
c73e354019
Bump pytest-cov from 2.11.1 to 2.12.0 in /testing/plugins_integration
...
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov ) from 2.11.1 to 2.12.0.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases )
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.11.1...v2.12.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 03:01:15 +00:00
Olga Matoula
dbe66d97b4
Add better warning msg for deprecated warns(None)
2021-05-16 12:07:39 +01:00
Olga Matoula
8b2f83772d
Catch any warning on warns with no arg passed
2021-05-15 18:50:39 +01:00
Rahul Kumaresan
c516dba69a
add feature to view fixture source location in invocations with --fixtures-per-test option ( #8626 )
...
* add feature to view fixture source location in invocations with --fixtures-per-test option
* remove unrelated changes to show_fixtures_per_test::test_doctest_items
* eshew the extraneous else in _show_fixtures_per_test.write_fixture
* enable the accommodation of multi-line docstring with --fixtures-per-test option
* add feature to view fixture source location in invocations with --fixtures
* add colour encoding to fixture location paths
* add changelog for #8606 fixing
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-05-14 14:38:55 +02:00
Miro Hrončok
51293de324
Ignore DeprecationWarnings in test_trial_error
...
Fixes https://github.com/pytest-dev/pytest/issues/8663
2021-05-12 13:38:19 +02:00
dependabot[bot]
0a07b71046
Bump django from 3.2 to 3.2.2 in /testing/plugins_integration ( #8652 )
...
Bumps [django](https://github.com/django/django ) from 3.2 to 3.2.2.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.2...3.2.2 )
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 10:44:32 +02:00
Zac Hatfield-Dodds
3ae0103975
Merge pull request #8641 from rahul-kumi/fix/8548
...
add support for precision bit in LEVEL_NAME_FMT regex
2021-05-08 01:17:55 +10:00
Rahul Kumaresan
9e11d645b1
cleanup tests by removal of unused code elements
2021-05-07 17:56:35 +05:30
Rahul Kumaresan
80acc0ed6f
fix test_coloredlogformatter_with_width_precision test
2021-05-07 16:25:19 +05:30
Rahul Kumaresan
1e3fcece6d
enhance support for precision bit in LEVELNAME_FMT_REGEX regex
2021-05-07 16:16:40 +05:30
Ran Benita
113a860a1f
argparsing: support parser.addini(type="paths") which returns pathlib.Paths
2021-05-07 09:58:51 +03:00
Florian Bruhin
382599287f
Fix test_errors_in_xfail_skip_expressions on Python 3.10
2021-05-04 17:26:53 +02:00
Florian Bruhin
61be48b485
Fix test_collect_symlink_dir on Windows
2021-05-04 17:25:08 +02:00
Florian Bruhin
e354c5c919
Fix warning filters used in tests
2021-05-04 17:25:02 +02:00
Florian Bruhin
710446420c
Adjust enum reprs for Python 3.10
...
Potential fix for #8546
2021-05-04 17:24:50 +02:00
dependabot[bot]
f1a97512da
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/agronholm/anyio/releases )
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst )
- [Commits](https://github.com/agronholm/anyio/compare/3.0.0...3.0.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 03:01:15 +00:00
Tarcísio Fischer
9d9b84d175
Improve pytest.approx error messages readability (Pull request) ( #8429 )
...
Improve pytest.approx error messages readability (Pull request)
2021-04-30 07:36:56 -03:00
Parth Patel
992c403fc8
Improve `iterparentnodeids` to consume `/` parts until the first `::` ( #8577 )
...
* Fix issue where TestCase.setUpClass is not called for test methods with a / in its name by checking if there is :: before the selected / or any :: after. Also added a test case for this.
* removed print statement that was added
* Change iterparentnodeids to consume / parts until the first ::. Then consider ::. Tests were changed to reflect this.
* Update changelog/8509.improvement.rst
Co-authored-by: Ran Benita <ran@unusedvar.com>
2021-04-29 17:02:43 +03:00
Ran Benita
134d8f78d8
Merge pull request #8595 from nschloe/url-fixes
...
"fix" a couple of http -> https redirects
2021-04-26 20:05:32 +03:00
Nico Schlömer
9ef608ef76
"fix" a couple of http -> https redirects
...
Found with
urli-fix . -a http: -i pytest
2021-04-26 17:44:27 +02:00
Bruno Oliveira
1e2c2d972d
Merge pull request #8588 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.15.1
...
Bump pytest-asyncio from 0.15.0 to 0.15.1 in /testing/plugins_integration
2021-04-26 10:44:01 -03:00
Bruno Oliveira
0d0e5ed74a
Merge pull request #8589 from pytest-dev/dependabot/pip/testing/plugins_integration/anyio-curiotrio--3.0.0
...
Bump anyio[curio,trio] from 2.2.0 to 3.0.0 in /testing/plugins_integration
2021-04-26 10:43:55 -03:00
dependabot[bot]
8d93f6ff0b
Bump pytest-mock from 3.5.1 to 3.6.0 in /testing/plugins_integration
...
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock ) from 3.5.1 to 3.6.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases )
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.5.1...v3.6.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 03:01:18 +00:00
dependabot[bot]
11f6dc9de6
Bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/agronholm/anyio/releases )
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst )
- [Commits](https://github.com/agronholm/anyio/compare/2.2.0...3.0.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 03:01:15 +00:00
dependabot[bot]
5a7be03285
Bump pytest-asyncio in /testing/plugins_integration
...
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio ) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases )
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.15.0...v0.15.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-26 03:01:13 +00:00
Anthony Sottile
67af623d9e
Merge pull request #8227 from encukou/defensive-get_source
...
Make code.FormattedExcinfo.get_source more defensive
2021-04-24 19:42:53 -07:00
Miro Hrončok
0a75c8e57b
Add a regression test for a more defensive code.FormattedExcinfo.get_source
2021-04-22 19:17:54 +02:00
Ran Benita
513247863a
Merge pull request #8562 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-asyncio-0.15.0
...
Bump pytest-asyncio from 0.14.0 to 0.15.0 in /testing/plugins_integration
2021-04-20 16:25:57 +03:00
Miroslav Šedivý
fbe66244b8
Fix some typos, remove redundant words and escapes ( #8564 )
...
* doc: Fix typos, remove double words
* Remove redundant escapes in regex
2021-04-19 20:39:08 +00:00
dependabot[bot]
fb35851440
Bump pytest-asyncio in /testing/plugins_integration
...
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio ) from 0.14.0 to 0.15.0.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases )
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.14.0...v0.15.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-19 03:01:33 +00:00
Abdelrahman Elbehery
9078c3ce23
fix #8464 wrong root dir when -c is passed ( #8537 )
...
fix #8464 wrong root dir when -c is passed
2021-04-16 14:38:35 -03:00
Ran Benita
3c451751af
Merge pull request #8542 from pytest-dev/dependabot/pip/testing/plugins_integration/pytest-django-4.2.0
...
Bump pytest-django from 4.1.0 to 4.2.0 in /testing/plugins_integration
2021-04-14 12:50:28 +03:00
Ran Benita
6152135c29
Merge pull request #8541 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.2
...
Bump django from 3.1.8 to 3.2 in /testing/plugins_integration
2021-04-14 12:50:01 +03:00
pre-commit-ci[bot]
d200598de9
[pre-commit.ci] pre-commit autoupdate ( #8547 )
...
* [pre-commit.ci] pre-commit autoupdate
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ran Benita <ran@unusedvar.com>
2021-04-14 12:49:09 +03:00
dependabot[bot]
22a17dba4e
Bump pytest-django from 4.1.0 to 4.2.0 in /testing/plugins_integration
...
Bumps [pytest-django](https://github.com/pytest-dev/pytest-django ) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/pytest-dev/pytest-django/releases )
- [Changelog](https://github.com/pytest-dev/pytest-django/blob/master/docs/changelog.rst )
- [Commits](https://github.com/pytest-dev/pytest-django/compare/v4.1.0...v4.2.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 03:01:33 +00:00
dependabot[bot]
e14bd4a480
Bump django from 3.1.8 to 3.2 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.8 to 3.2.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.8...3.2 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 03:01:30 +00:00
dependabot[bot]
207c07285f
Bump django from 3.1.7 to 3.1.8 in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.7 to 3.1.8.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.7...3.1.8 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-04-08 20:05:44 +00:00
Ronny Pfannschmidt
41a90cd9fe
Merge pull request #8463 from RonnyPfannschmidt/workaround-8361
...
address #8361 - introduce hook caller wrappers that enable backward compat
2021-04-05 22:50:31 +02:00
Tadeu Manoel
b706a2c048
Fix error with --import-mode=importlib and modules containing dataclasses or pickle ( #7870 )
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Fixes #7856 , fixes #7859
2021-04-05 17:10:03 -03:00
Ran Benita
c49100cef8
tmpdir: prevent using a non-private root temp directory
...
pytest uses a root temp directory named `/tmp/pytest-of-<username>`. The
name is predictable, and the directory might already exists from a
previous run, so that's allowed.
This makes it possible for my_user to pre-create
`/tmp/pytest-of-another_user`, thus giving my_user control of
another_user's tempdir.
Prevent this scenario by adding a couple of safety checks. I believe
they are sufficient.
Testing the first check requires changing the owner, which requires
root permissions, so can't be unit-tested easily, but I checked it
manually.
2021-04-03 23:42:53 +03:00
Ran Benita
1278f8b97e
tmpdir: fix temporary directories created with world-readable permissions
...
(Written for a Unix system, but might be applicable to Windows as well).
pytest creates a root temporary directory under /tmp, named
`pytest-of-<username>`, and creates tmp_path's and other under it.
/tmp is shared between all users of the system.
This root temporary directory was created with 0o777&~umask permissions,
which usually becomes 0o755, meaning any user in the system could list
and read the files, which is undesirable.
Use 0o700 permissions instead. Also for subdirectories, because the root
dir is adjustable.
2021-04-03 23:42:53 +03:00
Ronny Pfannschmidt
aa10bff750
fix deprecation test for path/fspath hook args
2021-04-03 14:51:36 +02:00
Ronny Pfannschmidt
deb5b5bd96
fix #8371 : fix stack-level
2021-04-02 00:58:05 +02:00
Bruno Oliveira
c1bdff9e69
Merge pull request #8494 from nicoddemus/python-3.10
2021-03-27 11:32:31 -03:00
Bruno Oliveira
b2954e85d6
Adjust message for Python 3.10
...
Now the message includes the class name ("Skip.__init__() got multiple...").
2021-03-27 11:13:16 -03:00
Bruno Oliveira
d9f4cedf17
Merge pull request #8472 from bluetech/rm-unnecessary-py-path-4
...
testing: stop relying on comparing to py.path in fnmatcher tests
2021-03-26 07:43:37 -03:00
Bruno Oliveira
be8d63e33b
Increase truncation threshold with -v, disable with -vv
...
Fix #6682
Fix #8403
2021-03-26 07:05:30 -03:00
Florian Bruhin
bc055e8e69
Fix required_plugins with prereleases ( #8469 )
...
* Fix required_plugins with prereleases
Fixes #8456
* Fix existing tests
* Update changelog/8456.bugfix.rst
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-03-21 22:51:12 +01:00
Ronny Pfannschmidt
7ac7610089
add tresting for implication
2021-03-20 23:44:36 +01:00
Ronny Pfannschmidt
4ddf6c647c
test warnings and fix invocation bugs
2021-03-20 23:39:38 +01:00
Ran Benita
945cc0b5a1
testing: stop relying on comparing to py.path in fnmatcher tests
2021-03-20 21:58:45 +02:00
Ran Benita
4690e4c510
reports: support any PathLike instead of only Path, py.path
...
The goal is to avoid referring to the legacy py.path.
2021-03-18 10:23:48 +02:00
Ran Benita
e515264eb1
Remove yet more unnecessary py.path uses
2021-03-18 10:23:48 +02:00
Ran Benita
fe215bda6b
Merge pull request #8446 from bluetech/unnecessary-py-path-2
...
More py.path removal work
2021-03-18 10:20:59 +02:00
Kale Kundert
dd3709718d
Merge pull request #8453 from encukou/rel-error-message
...
Fix value in error message about negative relative tolerance
2021-03-16 16:43:31 -04:00
pre-commit-ci[bot]
da4abd1c82
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2021-03-16 19:10:55 +00:00
Petr Viktorin
43b451e95e
Add tests for the error message
2021-03-16 20:09:17 +01:00
Ran Benita
f0c7043138
Remove/replace some more unnecessary uses of py.path
2021-03-15 10:39:44 +02:00
Ran Benita
a03ee02817
config: make `collect_ignore` accept any PathLike
...
The main reason is to remove a reference to `py.path`.
2021-03-15 10:39:32 +02:00
Ran Benita
b26d1bb18f
cacheprovider: add cache.mkdir() as a Path-returning replacement to makedir()
...
It is not possible to change a return type in a compatible way, so a new
method is added.
2021-03-15 10:39:31 +02:00
Ran Benita
59251e8a2a
Remove/replace some unneeded usages of py.path
2021-03-14 14:12:28 +02:00
Ran Benita
db539ed2b0
Merge pull request #8437 from bluetech/rm-typevar-prefix
...
Remove `_` prefix from TypeVars, expose ExceptionInfo
2021-03-13 19:01:29 +02:00
Pierre Mourlanne
af9f27a874
Approx decimal sequence mapping ( #8422 )
2021-03-13 16:01:23 +02:00
Ran Benita
f2d65c85f4
code: export ExceptionInfo for typing purposes
...
This type is most prominent in `pytest.raises` and we should allow to
refer to it by a public name.
The type is not in a perfectly "exposable" state. In particular:
- The `traceback` property with type `Traceback` which is derived from
the `py.code` API and exposes a bunch more types transitively. This
stuff is *not* exported and probably won't be.
- The `getrepr` method which probably should be private.
But they're already used in the wild so no point in just hiding them
now.
The __init__ API is hidden -- the public API for this are the `from_*`
classmethods.
2021-03-13 15:59:44 +02:00
Ran Benita
c9867bcc9d
Merge pull request #8416 from pytest-dev/pre-commit-ci-update-config
...
[pre-commit.ci] pre-commit autoupdate
2021-03-11 09:17:40 +02:00
Ronny Pfannschmidt
dbed1ff68f
adopt main terminology in the configs
...
ref pytest-dev/meta#8
2021-03-09 22:35:34 +01:00
Anthony Sottile
7a6ec5616d
clean up mkdtemp usage
...
Committed via https://github.com/asottile/all-repos
2021-03-08 19:12:08 -08:00
pre-commit-ci[bot]
ddde3266c6
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2021-03-08 16:55:59 +00:00
Anthony Sottile
79b03ce8db
Merge pull request #8411 from RonnyPfannschmidt/example-outcomes-check
...
fix bug in test for issue 519
2021-03-07 08:17:34 -08:00
Ronny Pfannschmidt
412fc001a0
fix bug in test for issue 519
...
assert the actual outcome and fix the filename
2021-03-07 15:01:39 +01:00
Ronny Pfannschmidt
77cb110258
drop usage of py.path.local calls
...
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-03-06 21:32:03 +01:00
Ronny Pfannschmidt
22dad53a24
implement Node.path as pathlib.Path
...
* reorganize lastfailed node sort
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2021-03-06 21:32:03 +01:00
Alexandros Tzannes
19a2f7425d
Merge pull request #8399 from atzannes/master
...
closes #8394
Generated fixture names for unittest/xunit/nose should start with underscore
2021-03-04 22:45:57 +02:00
Ran Benita
6e7dc8bac8
Merge pull request #8357 from matthewhughes934/remove-tmpdir-from-tests
...
Remove tmpdir from tests
2021-03-04 18:34:19 +02:00
Florian Bruhin
c14a9adba3
Fix skip signature ( #8392 )
...
* Fix test_strict_and_skip
The `--strict` argument was removed in #2552 , but the removal wasn't
actually correct - see #1472 .
* Fix argument handling in pytest.mark.skip
See #8384
* Raise from None
* Fix test name
2021-03-04 11:56:21 +01:00
Bruno Oliveira
bc0af99e5e
Merge pull request #8383 from pytest-dev/dependabot/pip/testing/plugins_integration/twisted-21.2.0
...
build(deps): bump twisted from 20.3.0 to 21.2.0 in /testing/plugins_integration
2021-03-02 17:33:35 -03:00
dependabot[bot]
897b5a3bd6
build(deps): bump twisted in /testing/plugins_integration
...
Bumps [twisted](https://github.com/twisted/twisted ) from 20.3.0 to 21.2.0.
- [Release notes](https://github.com/twisted/twisted/releases )
- [Changelog](https://github.com/twisted/twisted/blob/twisted-21.2.0/NEWS.rst )
- [Commits](https://github.com/twisted/twisted/compare/twisted-20.3.0...twisted-21.2.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 03:02:50 +00:00
dependabot[bot]
62ef875796
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/agronholm/anyio/releases )
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst )
- [Commits](https://github.com/agronholm/anyio/compare/2.1.0...2.2.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 03:02:48 +00:00
Simon K
b7f2d7ca61
Fixed an issue where `getpass.getuser()` contained illegal characters for file directories ( #8365 )
...
* retry writing pytest-of dir when invalid chars are in directory name
* add unit tests for getbasetemp() and changelog
* patch _basetemp & _given_basetemp for testing basetemp()
* Tweak changelog for #8317 , tidy up comments
2021-02-25 08:28:57 +00:00
Matthew Hughes
514f8e0680
fixup! Rename variables 'tmpdir'->'tmp_path'
2021-02-24 20:55:35 +00:00
pre-commit-ci[bot]
3b7fc2c9c8
[pre-commit.ci] auto fixes from pre-commit.com hooks
...
for more information, see https://pre-commit.ci
2021-02-23 17:02:50 +00:00
Florian Bruhin
54a154c86f
Allow Class.from_parent to forward custom parameters to the constructor
...
Similarly to #7143 , at work we have a project with a custom pytest.Class
subclass, adding an additional argument to the constructor.
All from_parent implementations in pytest accept and forward *kw, except
Class (before this change) and DoctestItem - since I'm not familiar with
doctest support, I've left the latter as-is.
2021-02-23 18:00:56 +01:00
dependabot[bot]
060cbef260
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.6 to 3.1.7.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.6...3.1.7 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 03:01:27 +00:00
Matthew Hughes
c9bb4c418f
fixup! Rename variables 'tmpdir'->'tmp_path'
...
* Add some more of these
* Also reintroduce+rename instances of fixture usages that were
'tmpdir'->'tmp_path'
2021-02-21 13:10:07 +00:00
Matthew Hughes
09d4c5e30a
Rename variables 'tmpdir'->'tmp_path'
...
Rename this variables reflecting the migrations made with 3bcd316f0
and
ed658d682
2021-02-20 18:24:58 +00:00
Matthew Hughes
0e5e4e03e6
Remove some unused 'tmpdir's
2021-02-20 18:01:42 +00:00
Ran Benita
1003beaffa
Merge pull request #8323 from bluetech/setupstate-refactor-3
...
runner: a few more tweaks to SetupState
2021-02-08 13:56:04 +02:00
Bruno Oliveira
7b91302b33
Merge branch 'master' into dependabot/pip/testing/plugins_integration/django-3.1.6
2021-02-08 08:03:23 -03:00
dependabot[bot]
ef14f286a3
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.5...3.1.6 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 03:02:01 +00:00
dependabot[bot]
e8d7a7b843
build(deps): bump anyio[curio,trio] in /testing/plugins_integration
...
Bumps [anyio[curio,trio]](https://github.com/agronholm/anyio ) from 2.0.2 to 2.1.0.
- [Release notes](https://github.com/agronholm/anyio/releases )
- [Changelog](https://github.com/agronholm/anyio/blob/master/docs/versionhistory.rst )
- [Commits](https://github.com/agronholm/anyio/compare/2.0.2...2.1.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 03:01:58 +00:00
Ran Benita
f42b68ccaa
runner: rename SetupState.prepare -> setup
...
This is the usual terminology we use, and matches better with
`teardown_exact()` and `pytest_runtest_setup()`.
2021-02-06 20:46:08 +02:00
Ran Benita
afea190797
Remove some no longer needed type-ignores
2021-01-29 20:40:43 +02:00
Bruno Oliveira
6a5d47a243
Merge pull request #8260 from nicoddemus/faulthandler-mode-X-8258
2021-01-28 13:03:24 -03:00
Bruno Oliveira
33861098d9
Only re-enable fauthandler during unconfigure if it was enabled before
2021-01-25 12:28:00 -03:00
dependabot[bot]
83ee1a1f3b
build(deps): bump pytest-cov in /testing/plugins_integration
...
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov ) from 2.10.1 to 2.11.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases )
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.10.1...v2.11.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-01-25 03:16:50 +00:00
Ran Benita
c30feeef8b
runner: add docstring to SetupState and improve variable naming a bit
2021-01-24 14:29:54 +02:00
Ran Benita
637300d13d
testing: fix some tests to be more realistic
...
Perform the operations in the order and context in which they can
legally occur.
2021-01-24 14:08:39 +02:00
Ran Benita
c83d030028
testing/test_runner: make SetupState tests use a proper SetupState
...
Previously the tests (probably unintentionally) mixed a fresh SetupState
and the generated item Session's SetupState, which led to some serious
head scratching when prodding it a bit.
2021-01-24 14:08:39 +02:00
Ran Benita
d1fcd425a3
runner: inline SetupState._pop_and_teardown()
...
This will enable a simplification in the next commit.
2021-01-24 14:08:39 +02:00
Ran Benita
2b14edb108
runner: express SetupState.teardown_all() in terms of teardown_exact() and remove it
...
Makes it easier to understand with fewer methods.
2021-01-24 14:08:39 +02:00
Ran Benita
ceb4d6f6d5
runner: inline a couple of SetupState methods
...
Code is clearer this way.
2021-01-24 14:08:39 +02:00
Bruno Oliveira
adc0f29b8f
Always handle faulthandler stderr even if already enabled
...
It seems the code that would not install pytest's faulthandler support
if it was already enabled is not really needed at all, and even detrimental
when using `python -X dev -m pytest` to run Python in "dev" mode.
Also simplified the plugin by removing the hook class, now the hooks
will always be active so there's no need to delay the hook definitions anymore.
Fix #8258
2021-01-20 10:29:05 -03:00
Bruno Oliveira
bda9ce4e0f
Merge pull request #8250 from daq-tools/fix-twisted-capture
2021-01-20 09:45:58 -03:00
Andreas Motl
9ba1821e91
Fix faulthandler for Twisted Logger when used with "--capture=no"
...
The Twisted Logger will return an invalid file descriptor since it is
not backed by an FD. So, let's also forward this to the same code path
as with `pytest-xdist`.
2021-01-18 17:51:08 +01:00
Ran Benita
25e657bfc1
Deprecate raising unittest.SkipTest to skip tests during collection
...
It is not very clear why this code exists -- we are not running any
unittest or nose code during collection, and really these frameworks
don't have the concept of collection at all, and just raising these
exceptions at e.g. the module level would cause an error. So unless I'm
missing something, I don't think anyone is using this.
Deprecate it so we can eventually clear up this code and keep unittest
more tightly restricted to its plugin.
2021-01-15 00:05:33 +02:00
Anton
42d5545f42
unittest: cleanup unexpected success handling ( #8231 )
...
* unittest: cleanup unexpected success handling
* update comment
2021-01-13 17:02:26 -08:00
Bruno Oliveira
7a5a6cb51c
Merge pull request #8235 from pytest-dev/dependabot/pip/testing/plugins_integration/django-3.1.5
...
build(deps): bump django from 3.1.4 to 3.1.5 in /testing/plugins_integration
2021-01-11 08:24:47 -03:00
dependabot[bot]
cfa0c3b0d9
build(deps): bump django in /testing/plugins_integration
...
Bumps [django](https://github.com/django/django ) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/django/django/releases )
- [Commits](https://github.com/django/django/compare/3.1.4...3.1.5 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 03:16:03 +00:00
dependabot[bot]
af78efc7fa
build(deps): bump pytest-mock in /testing/plugins_integration
...
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock ) from 3.4.0 to 3.5.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases )
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.4.0...v3.5.1 )
Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 03:15:59 +00:00
Ran Benita
5336ba28cc
Merge pull request #8218 from bluetech/reports2
...
Misc small code improvements
2021-01-04 22:47:32 +02:00
bengartner
8e00df4c4b
Add dot prefix if file makefile extension is invalid for pathlib ( #8222 )
2021-01-04 15:58:11 +02:00
Ran Benita
8ee6d0a866
Always use getfixturemarker() to access _pytestfixturefunction
...
Keep knowledge of how the marker is stored encapsulated in one place.
2021-01-01 23:22:10 +02:00
Ran Benita
bbd22e1769
Merge pull request #8214 from sousajf1/sousajo_patch_8204_1
...
pytest-dev#8204 migrate tests on testing/code/test_source to tmp_path
2021-01-01 20:44:40 +02:00
sousajo
ac428f67eb
pytest-dev#8204 migrate tests on testing/code/test_source to tmp_path
2021-01-01 16:55:03 +00:00
sousajf1
20c59e3aa4
pytest-dev#8204 migrate some tests to tmp_path fixture ( #8209 )
...
migrating some tests from tmpdir to tmp_path fixture
2021-01-01 17:25:11 +02:00
Ran Benita
7d306e9e86
reports: BaseReport.{passed,failed,skipped} more friendly to mypy
...
Not smart enough to understand the previous code.
2021-01-01 15:22:05 +02:00
Anton
48c9a96a03
Fix failing staticmethod tests if they are inherited ( #8205 )
...
* Fix failing staticmethod tests if they are inherited
* add comments, set default=None
2020-12-30 19:00:37 -08:00
Ran Benita
7585221d55
Merge pull request #8195 from christophebedard/add-missing-space-version-option-help-message
...
Add missing space in '--version' help message
2020-12-30 11:57:02 +02:00
pre-commit-ci[bot]
ee03e31831
[pre-commit.ci] pre-commit autoupdate ( #8201 )
...
* [pre-commit.ci] pre-commit autoupdate
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* manual fixes after configuration update
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-12-30 11:56:09 +02:00
Christophe Bedard
bf9b59b3c8
Add missing space in '--version' help message
2020-12-28 10:50:06 -05:00
Ran Benita
bd76042344
python: export pytest.Metafunc for typing purposes
...
The type cannot be constructed directly, but is exported for use in type
annotations, since it is reachable through existing public API.
2020-12-26 21:05:02 +02:00
Ran Benita
d8d2df7e6f
Merge pull request #8174 from bluetech/py-to-pathlib-5
...
More py.path -> pathlib conversions
2020-12-26 15:01:07 +02:00
Ran Benita
ca4effc822
Convert most of the collection code from py.path to pathlib
2020-12-22 21:09:36 +02:00
Ran Benita
4faed28261
testing: convert some tmpdir to tmp_path
...
The tmpdir fixture (and its factory variant) is soft-deprecated in favor
of the tmp_path fixture.
2020-12-22 21:08:25 +02:00
Ran Benita
170a2c5040
testing/test_config: check inipath instead of inifile
...
inifile is soft-deprecated in favor of inipath.
2020-12-22 21:08:25 +02:00
Ran Benita
8b220fad4d
testing/test_helpconfig: remove unclear comment
2020-12-22 21:08:25 +02:00
Ran Benita
92ba96b061
code: convert from py.path to pathlib
2020-12-22 21:08:25 +02:00
Ran Benita
813ce45985
Merge pull request #8179 from bluetech/typing-public-mark
...
mark: expose Mark, MarkDecorator, MarkGenerator under pytest for typing purposes
2020-12-22 16:32:02 +02:00
dependabot[bot]
1839713b71
build(deps): bump pytest-mock in /testing/plugins_integration
...
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock ) from 3.3.1 to 3.4.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases )
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst )
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.3.1...v3.4.0 )
Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 03:07:23 +00:00
Ran Benita
6aa4d1c7ab
mark: export pytest.MarkGenerator for typing purposes
...
The type cannot be constructed directly, but is exported for use in type
annotations, since it is reachable through existing public API.
2020-12-20 15:59:20 +02:00