Commit Graph

12146 Commits

Author SHA1 Message Date
Andreas Maier b2582b0314 Squash: Applied review comments 2020-04-12 12:12:00 +02:00
Andreas Maier 869c089887 Fixes #7077: Added & improved docs for repr_failure() in Node & Collector 2020-04-12 09:28:40 +02:00
Bruno Oliveira f214a4be97
Merge pull request #7072 from pytest-dev/asottile-patch-1
Remove asottile from TIDELIFT.rst
2020-04-10 19:45:59 -03:00
Anthony Sottile c8fc4c5edc
Remove asottile from TIDELIFT.rst 2020-04-10 15:38:45 -07:00
Bruno Oliveira 6daf3614f0
Merge pull request #7070 from nicoddemus/remove-bruno
Remove myself from tidelift
2020-04-10 18:37:30 -03:00
Bruno Oliveira 4b634ac758 Remove myself from tidelift 2020-04-10 10:47:25 -03:00
Ronny Pfannschmidt 244c8e4a13
Merge pull request #6680 from RonnyPfannschmidt/fix-6294-more-docs-for-fromparent
doc: more docs for from_parent
2020-04-10 13:10:40 +02:00
Ran Benita df66a953a1
Merge pull request #7048 from bluetech/fix-test_assertrewrite-reprcompare
Remove broken _reprcompare disabling fixture in test_assertrewrite.py
2020-04-10 12:51:11 +03:00
Ran Benita 9ffccf5acc
Merge pull request #7055 from bluetech/rm-test_juintxml-unichr
Remove Python 2 compat code in test_juintxml.py
2020-04-10 11:52:45 +03:00
Ran Benita f0d1ccd32f
Merge pull request #7056 from bluetech/rm-test_monkeypatch-oldstyleclass
Remove Python 2 compat check in test_monkeypatch.py
2020-04-10 11:52:01 +03:00
Ran Benita 41d1ecf521
Merge pull request #7057 from bluetech/skip-faulthandler-test_timeout
Skip flaky test test_faulthandler.py::test_timeout[True]
2020-04-10 11:51:31 +03:00
Ronny Pfannschmidt 19c243f0fa
Merge pull request #6285 from earonesty/patch-1
Add _pytest.fixtures.FixtureLookupError to top level import
2020-04-10 07:58:58 +02:00
Ronny Pfannschmidt c5d636a1b2
Merge pull request #6992 from pytest-dev/revert-6767-tmpdir-cleanup-upstream
Revert "tmpdir: clean up indirection via config for factories"
2020-04-10 07:49:52 +02:00
Ronny Pfannschmidt 1eb2b45db5 Revert "tmpdir: clean up indirection via config for factories (#6767)"
This reverts commit 8a1633c3b4.

+ add changelog
2020-04-10 07:18:54 +02:00
Daniel Hahler f136b79f1a
Fix test_no_warnings to handle e.g. `_pytest.async` (#7044)
Before this patch it would result in a SyntaxError with e.g. `import _pytest.async`.
2020-04-09 16:56:01 +02:00
Ran Benita 2aa5436ee7 Remove Python 2 compat code in test_juintxml.py 2020-04-09 17:33:55 +03:00
Ran Benita 5a5fd01ebe Skip flaky test test_faulthandler.py::test_timeout[True]
It occasionally crashes on CI, the reason seems out of our control, or
at least we can't figure it out.
2020-04-09 17:23:54 +03:00
Ran Benita 08b3d37177 Remove Python 2 compat check in test_monkeypatch.py
Presumably it used to test old-style vs. new-style classes, but in
the Python 3 conversion SampleNew and SampleOld became the same.
2020-04-09 17:11:18 +03:00
Ran Benita 8fab3dd42f Remove broken _reprcompare disabling fixture in test_assertrewrite.py
The `_pytest._code._reprcompare` that was referred to previously doesn't
exist -- it was moved to other places but wasn't updated. This regressed
in f423ce9c01. Now we don't want it
anymore, so keep the status quo by explicitly removing them.
2020-04-09 10:47:45 +03:00
Daniel Hahler 413ca8a4d0
faulthandler: trylast=True (#7025)
It should happen as late as possible before the test runs.

Ref: https://github.com/pytest-dev/pytest/issues/7022
2020-04-09 08:53:35 +02:00
Ran Benita eb00182061
Merge pull request #7047 from bluetech/rm-test_assertion-abc
Remove some no-longer-needed compat code in test_assertion
2020-04-08 22:33:19 +03:00
Ran Benita 20956b2f4e Remove some no-longer-needed compat code in test_assertion 2020-04-08 21:35:42 +03:00
Ran Benita 272be7ef74
Merge pull request #7039 from bluetech/markdecorator-doc
Slightly improve Mark and MarkDecorator documentation
2020-04-08 20:36:42 +03:00
Daniel Hahler 7048d5be9c
Fix FD leak in test__get_multicapture (#7037)
Instantiating `FDCapture` creates a file descriptor already.  Use "no"
to not leak a fd here.
2020-04-08 18:11:31 +02:00
Daniel Hahler 4fd2623c12
tests: fix TypeErrors (#7038)
* tests: fix TypeError with test_mark_closest

It fails when trying to run it actually:

> TypeError: test_has_inherited() takes 0 positional arguments but 1 was given

* Fix testing/test_collection.py::TestCollector::test_getparent
2020-04-08 18:11:04 +02:00
Ran Benita 4344c61731 Slightly improve Mark and MarkDecorator documentation
Mostly I wanted to get rid of mentions of "MarkItem" which is something
that no longer exists, but I improved a little beyond that and annotated
some simple types.
2020-04-07 22:14:47 +03:00
Ran Benita 6356583eab
Merge pull request #7036 from pytest-dev/revert-7030-increase-test_timeout-timeout
Revert "Increase test_faulthandler.py::test_timeout sleep duration on CI"
2020-04-07 13:42:51 +03:00
Ran Benita eab0a6e34d Revert "Increase test_faulthandler.py::test_timeout sleep duration on CI" 2020-04-07 13:20:35 +03:00
Daniel Hahler ce806001b0
Fix doc for `numbered` arg with `TempPathFactory.mktemp` (#7014) 2020-04-07 11:44:54 +02:00
Ran Benita 259e5d0610
Merge pull request #7034 from bluetech/fix-testdurations-flaky
Fix flaky TestDurations test
2020-04-07 09:39:02 +03:00
Daniel Hahler 1fd14685c5
doc: document inversed lines with terminal report hooks (#7016)
It was surprising that `tryfirst=True` would not result in lines being
added to the beginning with `pytest_report_header`.
This is due to lines being reversed, and therefore the same applies to
`pytest_report_collectionfinish`.
2020-04-07 08:08:28 +02:00
Daniel Hahler bf3e64d473
Remove TestExecutionForked - xdist.boxed has gone since long (#7021)
Tried to write a test using `--boxed`, but it fails due to
https://github.com/pytest-dev/pytest-forked/issues/30.
2020-04-07 08:07:20 +02:00
Daniel Hahler 3a4435fb59
doc: fix/remove leftovers from removing `versionadded` (#7028)
Ref: 9c5da9c (https://github.com/pytest-dev/pytest/pull/5184)
2020-04-07 08:01:50 +02:00
Ran Benita c659a6b917
Merge pull request #7030 from bluetech/increase-test_timeout-timeout
Increase test_faulthandler.py::test_timeout sleep duration on CI
2020-04-07 00:06:16 +03:00
Ran Benita c3e6e2e8c8 Fix flaky TestDurations test
TestDurations tests the `--durations=N` functionality which reports N
slowest tests, with durations <= 0.005s not shown by default.

The test relies on real time.sleep() (in addition to the code which uses
time.perf_counter()) which makes it flaky and inconsistent between
platforms.

Instead of trying to tweak it more, make it use fake time instead. The
way it is done is a little hacky but seems to work.
2020-04-06 23:49:46 +03:00
Ran Benita 7da3e3aaad Increase test_faulthandler.py::test_timeout sleep duration on CI
This might help fix some flakiness.
2020-04-06 11:55:03 +03:00
Ran Benita cb06bc7d6e
Merge pull request #7017 from bluetech/doc-pytest_report_teststatus
Document the pytest_report_teststatus hook better and test uncovered functionality
2020-04-04 18:45:50 +03:00
Ran Benita 1ce30fd38f Document the pytest_report_teststatus hook better and test uncovered functionality
This hook has some functionality to provide explicit markup for the test
status. It seemed unused and wasn't tested, so I was tempted to remove
it, but I found that the pytest-rerunfailures plugin uses it, so
document it and add a test instead.
2020-04-04 17:27:59 +03:00
Daniel Hahler e01dcbf323
Cleanup/move imports with tmpdir tests (#7015) 2020-04-04 14:25:34 +02:00
Ran Benita e6563b7ca3
Merge pull request #7010 from bluetech/rm-defaultfuncargprefixmarker
Remove unused defaultfuncargprefixmarker
2020-04-04 14:53:08 +03:00
Ran Benita 4a324ce920 Remove unused defaultfuncargprefixmarker
Unused since 1e80a9cb34.
2020-04-04 14:34:40 +03:00
Daniel Hahler 48c9f556ef
Fix tests: use explicit syspathinsert where tests might hang (#7008)
Use `testdir.syspathinsert()` with multiprocessing tests:

- test_chained_exceptions_no_reprcrash
- test_exception_handling_no_traceback

This only works currently because `_importtestmodule` changes `sys.path`
as a side-effect.

It appears to be only required on Windows though - likely due to the
multiprocessing method used there.
2020-04-04 12:33:15 +02:00
Ran Benita 5d539afd6c
Merge pull request #6998 from alfredodeza/fix-cache-doc
docs: Do not use automatic title in fixture reference
2020-04-03 11:52:31 +03:00
Daniel Hahler 20f6331afd
Fix TerminalRepr instances to be hashable (#6988)
pytest-xdist assumes `ExceptionChainRepr` is hashable.

Fixes https://github.com/pytest-dev/pytest/issues/6925.
Fixes https://github.com/pytest-dev/pytest-xdist/issues/515.
2020-04-03 00:56:53 +02:00
Alfredo Deza 7d75762de6 Do not use automatic title in fixture reference
It creates odd wording otherwise. Keep the reference, update the title
using Sphinx notation.
2020-04-01 09:55:30 -04:00
Ronny Pfannschmidt 2d9dac95ec
Merge pull request #6927 from RonnyPfannschmidt/fix-6924-run-async-stdlib-unittests
running stdlib asyncio unittests again
2020-03-30 22:34:17 +02:00
Ronny Pfannschmidt 93b3fee783
Merge pull request #6981 from RonnyPfannschmidt/deprecate-pytest.collect
deprecate the pytest.collect module
2020-03-30 22:32:47 +02:00
Ronny Pfannschmidt 451aef65ac prepare tests and disable warnings for asyncio unittest cases
shoehorn unittest async results into python test result interpretation

changelog
2020-03-30 21:55:12 +02:00
Ronny Pfannschmidt f1d51ba1f5 deprecate the pytest.collect module
changelog

minimal unittest for collect module deprecations

\!fixup - changelog typo
2020-03-30 21:53:07 +02:00
Ronny Pfannschmidt ce429381a7
Merge pull request #6986 from RonnyPfannschmidt/fix-6951-tw.writer-writable
fix #6951: allow to write TerminalReporter.writer
2020-03-30 21:51:06 +02:00