Commit Graph

13324 Commits

Author SHA1 Message Date
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 1ed903e8fcbe60f8ce25b8911641059cd89d892b)
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