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
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
Ran Benita
03451c397f
Simplify positional arguments compatibility code in pytest.fixture()
...
The dynamic scope feature added in 10bf6aac76
necessitated some wrangling of arguments in pytest.fixture(). In
particular, it deprecated positional arguments in favor of keyword-only
arguments, while keeping backward compatibility.
The way it did this avoided some code duplication but ended up being
quite hard to follow and to annotate with types.
Replace it with some straightforward code, which is not very DRY but is
simple and easy to remove when the time comes.
2020-04-02 14:52:58 +03:00
Daniel Hahler
354602abe6
Update src/_pytest/hookspec.py
...
Co-Authored-By: Bruno Oliveira <nicoddemus@gmail.com>
2020-04-02 12:01:43 +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
Daniel Hahler
607f7603af
doc: pytest_collection: has to set `session.items`
...
Would make sense to use its return value etc, but this helps for now.
2020-03-31 09:39:50 +02:00
Daniel Hahler
ff0a091165
Fix/improve test_terminal_reporter_writer_attr
...
It did not actually test that the attribute gets set.
This also checks the stacklevel etc.
2020-03-31 09:31:38 +02: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
Ronny Pfannschmidt
eab2831671
fix #6951 : allow to write TerminalReporter.writer
2020-03-30 21:31:53 +02:00
Ran Benita
211adfc945
Merge pull request #6983 from kondratyev-nv/master
...
Fix documentation typo
2020-03-30 11:32:38 +03:00
Nikolay Kondratyev
285beddf28
Fix documentation typo
2020-03-29 16:55:56 +03:00
smarie
95fadd5740
Improved time counter used to compute test durations. ( #6939 )
...
Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
Co-authored-by: Ran Benita <ran@unusedvar.com>
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2020-03-29 15:20:09 +03:00
Bruno Oliveira
f84742d46c
Merge pull request #6980 from nicoddemus/quick-doc-fix
...
Quick doc fix on xfail reason parameter
2020-03-28 16:11:18 -03:00
Bruno Oliveira
c6517e2c3a
Merge pull request #6977 from bluetech/oserror-aliases
...
Change EnvironmentError, IOError to OSError - they are aliases
2020-03-28 11:32:34 -03:00
Bruno Oliveira
70cbce7ccc
Quick doc fix on xfail reason parameter
...
As per https://github.com/pytest-dev/pytest/pull/6957/files#r399564043
2020-03-28 11:30:15 -03:00
Tim Hoffmann
0e4a44db3b
Better document xfail(condition) ( #6957 )
2020-03-27 22:46:42 +03:00
Ran Benita
a785754523
Change EnvironmentError, IOError to OSError - they are aliases
...
Since Python 3.3, these are aliases for OSError:
https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy
2020-03-27 18:40:23 +03:00
Ran Benita
83e18776f6
Merge pull request #6818 from blueyed/fix-assert-exc-upstream
...
assertion: rewrite: only catch EnvironmentError
2020-03-27 18:33:17 +03:00
Bruno Oliveira
36d0a71be8
Merge pull request #6976 from nicoddemus/fix-linting
...
Fix linting
2020-03-27 10:30:09 -03:00
Bruno Oliveira
a016a75ca7
Fix linting
2020-03-27 09:54:20 -03:00
Bruno Oliveira
429a28eca0
Merge pull request #6782 from nicoddemus/code-highlight-followup
...
Assorted improvements following up #6658
2020-03-27 08:58:50 -03:00
Daniel Hahler
aae0579bcd
doc: use `envvar` directive for environment variables ( #6874 )
...
This changes the link anchors in "reference.html", from e.g.
`reference.html#pytest-current-test` to
`reference.html#envvar-PYTEST_CURRENT_TEST`, but I think that is OK, and
not worth adding labels for the old anchors.
2020-03-27 02:40:25 +01:00
Daniel Hahler
e651562271
test_warnings: clean up usage of pyfile_with_warnings ( #6799 )
...
Remove it where not used / overwritten, and use its reference otherwise,
which makes it clear that it is used actually.
2020-03-27 02:24:00 +01:00
Daniel Hahler
327ec54248
Doc fixes ( #6861 )
2020-03-27 02:22:03 +01:00