Commit Graph

11616 Commits

Author SHA1 Message Date
Tomáš Gavenčiak 5e15c86cc6 Fix EncodedFile.write return value
Make EncodedFile, used for captured output streams, method .write return
the number of characters written. Add test for captured stderr write.
Fixes #6557.

Co-Authored-By: Bruno Oliveira <nicoddemus@gmail.com>
2020-01-25 10:36:23 +01:00
Daniel Hahler 0d4f479aa8
Merge pull request #6552 from blueyed/ci-linting
ci: GHA: separate jobs for linting, docs, doctesting
2020-01-24 13:36:59 +01:00
Daniel Hahler 79d00ab35a
Merge pull request #6549 from blueyed/fix-release-minor
doc: minor fixes for the release process
2020-01-24 13:36:48 +01:00
Daniel Hahler c051a9e7b9 ci: GHA: separate jobs for linting, docs, doctesting
It helps to know upfront that e.g. linting failed, and makes finding the
error easier.
2020-01-24 12:29:35 +01:00
Daniel Hahler cdd6f86e43 bug-fix fixes 2020-01-23 20:34:21 +01:00
Daniel Hahler 38538c6c6d
Merge pull request #6548 from blueyed/ci-codecov-flag-gha
ci: codecov: add flag for GHA
2020-01-23 18:39:50 +01:00
Daniel Hahler 55ebd9f803 doc: minor fixes for the release process 2020-01-23 18:31:48 +01:00
Daniel Hahler 8ca8d25202
Merge pull request #6545 from blueyed/terminalwriter
config: typing for create_terminal_writer, re-export TerminalWriter
2020-01-23 15:42:18 +01:00
Daniel Hahler a8d67f5e7b ci: codecov: add flags for GHA/Travis
This would help with debugging missing coverage when removing Travis
jobs.
2020-01-23 15:41:41 +01:00
Daniel Hahler 03bc8aba4e config: typing for create_terminal_writer, re-export TerminalWriter
This also imports `TerminalWriter` explicitly via `_pytest._io`,
allowing for easier extending / replacing it.
2020-01-23 14:09:37 +01:00
Daniel Hahler 6b13379f37
Merge pull request #6521 from blueyed/harden-nose-raises
tests: improve test for `nose.raises`
2020-01-23 13:42:14 +01:00
Ran Benita 9dcdea5de7 Rewrite Item.location to be clearer with regard to types 2020-01-23 13:25:15 +01:00
Daniel Hahler 863bab5326
Merge pull request #6544 from blueyed/doc-rm-costlysetup
doc: remove costlysetup example
2020-01-23 13:21:32 +01:00
Daniel Hahler 8521503246
Merge pull request #6527 from blueyed/typing-getfslineno
typing: fix/adjust _code.source.getfslineno
2020-01-23 13:17:47 +01:00
Ran Benita 0b6258ab5b PyCollector.collect: use explicit cast to `str`
Ref: https://github.com/pytest-dev/pytest/pull/6521#pullrequestreview-347234792
2020-01-23 12:54:52 +01:00
Daniel Hahler b63cb18776 doc: remove costlysetup example
It is not included with docs, and
`example/costlysetup/sub_a/test_quick.py::test_quick` sleeps for 5s,
slowing down `doctesting` unnecessarily.
2020-01-23 12:23:30 +01:00
Daniel Hahler 10e243d206
Merge pull request #6543 from blueyed/rm-rw
tests: remove unnecessary `-rw` option
2020-01-23 11:56:07 +01:00
Daniel Hahler e7444bbd5e tests: remove unnecessary `-rw` option
Warnings are enabled by default, which is tested by `test_getreportopt`.
2020-01-23 11:37:19 +01:00
Daniel Hahler eb7a57f965
Merge pull request #6542 from blueyed/fix-test_record_property
tests: fix/harden test_record_property
2020-01-23 11:14:37 +01:00
Daniel Hahler 252eae5bc8 tests: fix/harden test_record_property
`-rv` is not a recognized reportchar.  Probably `-v` was meant, but is
not necessary to check that there are no warnings.

Followup to 2018cf12b (https://github.com/pytest-dev/pytest/pull/3360).
2020-01-23 10:49:59 +01:00
Daniel Hahler 9c7b3c57d7 typing: PyobjMixin.reportinfo, getfslineno 2020-01-23 10:45:31 +01:00
Daniel Hahler 1350c601dc Node.location: handle str with _node_location_to_relpath 2020-01-23 10:45:31 +01:00
Daniel Hahler ef112fd7dd Revert "Revert "Fix type errors after adding types to the `py` dependency""
Without changes to test_itemreport_reportinfo.

This reverts commit fb99b5c66e.

Conflicts:
	testing/test_nose.py
2020-01-23 10:45:27 +01:00
Daniel Hahler 8fa57c8384 tests: improve test for `nose.raises`
This should probably get transferred into a `pytest.fail` really, but
tests/documents the current behavior.
2020-01-23 10:45:26 +01:00
Daniel Hahler ad02f6f879
Merge pull request #6525 from blueyed/typing-session
typing: Session.__init__
2020-01-23 00:16:08 +01:00
Daniel Hahler bd6ba3f3e1 typing: Session.__init__
Pulled out of https://github.com/pytest-dev/pytest/pull/6491.
2020-01-23 00:07:59 +01:00
Daniel Hahler 85df6bbe26
Merge pull request #6536 from blueyed/fix-test_cwd_snapshot
tests: fix test_cwd_snapshot
2020-01-22 16:46:04 +01:00
Daniel Hahler ba49581510
Merge pull request #6538 from blueyed/test-coverage
tests: use NotImplementedError with uncovered code
2020-01-22 16:45:20 +01:00
Daniel Hahler d878d9d4d5 tests: use NotImplementedError with uncovered code 2020-01-22 15:38:12 +01:00
Daniel Hahler 8c4dfca0c1
Merge pull request #6535 from blueyed/tox-doctesting
tox: move doctesting into main testenv
2020-01-22 14:38:34 +01:00
Daniel Hahler b8787b8732 tests: fix test_cwd_snapshot
Without restoring the cwd, successive tests might fail to parse the
config (via `_pytest.config._prepareconfig()`, for when `--lsof` is
used).

And it is good practice to restore the cwd in any case anyway.
2020-01-22 14:34:11 +01:00
Daniel Hahler ef294fc727 tox: move doctesting into main testenv
This allows for `tox -e doctesting-coverage`, which would otherwise not
use the "doctesting" testenv.
2020-01-22 13:32:30 +01:00
Daniel Hahler 0f78ef8e02
Merge pull request #6532 from blueyed/harden-test
--cache-clear: add test for keeping non-supporting files
2020-01-22 12:20:24 +01:00
Daniel Hahler 1cd4bafda7
Merge pull request #6531 from blueyed/ci-gha-success
ci: GHA: remove unnecessary check for `success()`
2020-01-21 22:38:50 +01:00
Daniel Hahler 8f5fd537d8 --cache-clear: add test for keeping non-supporting files
Ref: https://github.com/pytest-dev/pytest/pull/6296
2020-01-21 22:16:56 +01:00
Daniel Hahler 9869a3d9e1 ci: GHA: remove unnecessary check for `success()`
Following jobs get aborted on failure.

Ref: https://github.com/pytest-dev/pytest/pull/6530
2020-01-21 21:44:49 +01:00
Daniel Hahler 2f00b041e4
Merge pull request #6526 from blueyed/typing-code-path
doc: fix Code.path: might return str
2020-01-21 21:06:26 +01:00
Daniel Hahler 62db3f7abc typing: fix/adjust _code.source.getfslineno 2020-01-21 19:48:17 +01:00
Daniel Hahler 7ee27fedee doc: fix Code.path: might return str 2020-01-21 19:46:43 +01:00
Ran Benita a52f791461
Merge pull request #6518 from bluetech/fix-py-typed-fixes-regression
Fix internal assert failure regression in 5.3.4
2020-01-21 00:01:07 +02:00
Ran Benita fb99b5c66e Revert "Fix type errors after adding types to the `py` dependency"
This reverts commit 930a158a6a.

Regression test from Bruno Oliveira.
2020-01-20 23:44:56 +02:00
Bruno Oliveira ddfa41b5a7
Preparing release version 5.3.4 (#6516)
Preparing release version 5.3.4
2020-01-20 14:26:52 -03:00
Bruno Oliveira 6a26ac4125 Preparing release version 5.3.4 2020-01-20 13:53:31 -03:00
Bruno Oliveira cdaa9c06e1
Revert "fixtures register finalizers with all fixtures before t… (#6496)
Revert "fixtures register finalizers with all fixtures before them in the stack"
2020-01-20 13:49:00 -03:00
Bruno Oliveira 0dc82e8501 Add CHANGELOG entry for #6496 2020-01-20 13:32:27 -03:00
Daniel Hahler f9bed82c4d
Merge pull request #6515 from blueyed/tox-mypy-diff
tox: add mypy-diff testenv
2020-01-20 14:29:15 +01:00
Daniel Hahler 2406076611 tox: add mypy-diff testenv 2020-01-20 13:42:07 +01:00
Ran Benita 44eb1f580c
Merge pull request #6311 from bluetech/type-annotations-10
Some type annotation & check_untyped_defs fixes
2020-01-19 20:17:32 +02:00
Ran Benita 3392be37e1 Fix check_untyped_defs in test_runner 2020-01-19 20:01:07 +02:00
Ran Benita 3d2680b31b Fix type of pytest.warns, and fix check_untyped_defs in test_recwarn
The expected_warning is optional.
2020-01-19 19:39:14 +02:00