Commit Graph

12368 Commits

Author SHA1 Message Date
Andreas Maier c9386ada29 Squash: Resolved 2nd round of review comments 2020-04-12 13:19:45 +02:00
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
gaurav dhameeja 5703fdbbdc Fix-6911(pytest-bot): Added error from commands that are run
Earlier pytest-bot would only print out the exception in cases of
failure but did not provide context on failing command and error from
command. This patch adds the errors from the command to the exception
message.
`Command` provides abstraction over the command to run and helps
in collecting errors from the first failing command only.
With this, we don't need to check `returncode` from each command that
we run, we can run all the commands and will have access to the error
from the first command that failed. This pattern was taken from Go.
Please refer: https://blog.golang.org/errors-are-values
2020-04-12 02:31:51 +05:30
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
Ran Benita b553ce54c8 Remove note saying faulthandler_timeout is not available on Windows
I think it is available in all Python versions we support, but at least
since Python 3.7 the docs[0] say:

    Changed in version 3.7: This function is now always available.

so let's just remove the note.

[0] https://docs.python.org/3/library/faulthandler.html#faulthandler.dump_traceback_later
2020-04-10 14:46:15 +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 0b5d2ff526 Fix/improve printing of docs for collected items 2020-04-09 21:49:30 +02:00
Daniel Hahler accea46fa1 doc: minor fixes for Store 2020-04-09 17:08:47 +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
Daniel Hahler a98a62723e revisit 2020-04-09 01:57:46 +02:00
Daniel Hahler ad4c1071d9 doc: internal: remove references to old "newinterpret" module
This has been merged into the (only) assertrewrite mode.
2020-04-09 01:40:23 +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 33ff863430 rebuild 2020-04-08 19:24:20 +02:00
Daniel Hahler e6da086101
Update testing/test_pytester.py
Co-Authored-By: Ran Benita <ran@unusedvar.com>
2020-04-08 18:16:03 +02: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
Daniel Hahler fc645412aa Fix `test_popen_default_stdin_stderr_and_stdin_None` when run with `-s` 2020-04-06 08:32:41 +02:00
Daniel Hahler 51c1ae89cd doc: remove deprecations from pytest 3
This is in line with 9c5da9c0d, which versionadded instructions.
2020-04-06 07:02:15 +02: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