Commit Graph

11105 Commits

Author SHA1 Message Date
Ran Benita 1787bffda0 Fix check_untyped_defs errors in capture 2019-10-23 14:20:15 +03:00
Ran Benita 0267b25c66 Fix some check_untyped_defs mypy errors in terminal 2019-10-23 14:20:15 +03:00
Ran Benita 5dca7a2f4f Fix check_untyped_defs errors in cacheprovider 2019-10-23 14:20:15 +03:00
Ran Benita 93c8822f26 Fix check_untyped_defs errors in warnings 2019-10-23 14:20:15 +03:00
Ran Benita 583c2a2f9b Fix check_untyped_defs errors in logging 2019-10-23 14:20:15 +03:00
Ran Benita 1984c10427 Fix check_untyped_defs errors in doctest
In order to make the LiteralOutputChecker lazy initialization more
amenable to type checking, I changed it to match the scheme already used
in this file to lazy-initialize PytestDoctestRunner.
2019-10-23 14:20:14 +03:00
Ran Benita 3246d8a6e9
Merge pull request #6048 from bluetech/mypy-0.740
Update mypy 0.720 -> 0.740
2019-10-23 12:47:21 +03:00
Daniel Hahler b30e7bd1de
Merge pull request #6045 from blueyed/minor
minor: typing for ReprFailDoctest
2019-10-23 11:44:37 +02:00
Daniel Hahler db9e248b2e
Merge pull request #6039 from blueyed/test_doctest_id
doctest: unset RUNNER_CLASS in pytest_unconfigure
2019-10-23 11:38:59 +02:00
Daniel Hahler 1371b01f78 typing for ReprFailDoctest 2019-10-23 10:52:42 +02:00
Ran Benita 52b85f6f1a Update mypy 0.720 -> 0.740
Changelogs:
http://mypy-lang.blogspot.com/2019/09/mypy-730-released.html
http://mypy-lang.blogspot.com/2019/10/mypy-0740-released.html

New errors:
src/_pytest/recwarn.py:77: error: Missing return statement
src/_pytest/recwarn.py:185: error: "bool" is invalid as return type for "__exit__" that always returns False
src/_pytest/recwarn.py:185: note: Use "typing_extensions.Literal[False]" as the return type or change it to "None"
src/_pytest/recwarn.py:185: note: If return type of "__exit__" implies that it may return True, the context manager may swallow exceptions
src/_pytest/recwarn.py:185: error: Return type "bool" of "__exit__" incompatible with return type "None" in supertype "catch_warnings"
src/_pytest/recwarn.py:230: error: "bool" is invalid as return type for "__exit__" that always returns False
src/_pytest/recwarn.py:230: note: Use "typing_extensions.Literal[False]" as the return type or change it to "None"
src/_pytest/recwarn.py:230: note: If return type of "__exit__" implies that it may return True, the context manager may swallow exceptions
src/_pytest/recwarn.py:230: error: Return type "bool" of "__exit__" incompatible with return type "None" in supertype "catch_warnings"

The errors are due to this new error:
https://mypy.readthedocs.io/en/latest/error_code_list.html#check-the-return-type-of-exit-exit-return
2019-10-23 10:34:14 +03:00
Daniel Hahler c71a2c9f80
Merge pull request #6023 from blueyed/main-exitcode
pytest.main: return ExitCode
2019-10-23 07:48:17 +02:00
Daniel Hahler 046aa0b6e9 pytest.main: return ExitCode 2019-10-23 04:33:05 +02:00
Daniel Hahler f0c2b070c5
Merge pull request #6046 from blueyed/fix-features
Fix test_doctest_set_trace_quit on features
2019-10-23 04:32:10 +02:00
Daniel Hahler b079dc2dbe Fix test_doctest_set_trace_quit on features 2019-10-23 04:13:37 +02:00
Daniel Hahler 4af89bba9d
Merge pull request #5061 from blueyed/summary_stats-multi-color
Multiple colors with terminal summary_stats
2019-10-23 03:21:39 +02:00
Daniel Hahler 5e7b2ae704 doctest: pytest_unconfigure: reset RUNNER_CLASS
This is important when used with ``pytester``'s ``runpytest_inprocess``.

Since 07f20ccab `pytest testing/acceptance_test.py -k test_doctest_id`
would fail, since the second run would not consider the exception to be
an instance of `doctest.DocTestFailure` anymore, since the module was
re-imported, and use another failure message then in the short test
summary info (and in the report itself):

> FAILED test_doctest_id.txt::test_doctest_id.txt - doctest.DocTestFailure: <Do...

while it should be:

> FAILED test_doctest_id.txt::test_doctest_id.txt
2019-10-23 03:09:41 +02:00
Daniel Hahler bae22e1fdd
Merge pull request #6016 from blueyed/pytest-_ensure_unconfigure-twice
pytester: parseconfigure: remove duplicate config._ensure_unconfigure
2019-10-23 01:39:23 +02:00
Bruno Oliveira 215be88fed
Minor: help / direct usage of config (#6011)
Minor: help / direct usage of config
2019-10-22 20:24:08 -03:00
Daniel Hahler 98fc9377d9
Merge pull request #5630 from blueyed/pdb-doctest-bdbquit
doctest: handle BdbQuit
2019-10-23 01:10:19 +02:00
Daniel Hahler 8683293031
Merge pull request #6017 from blueyed/DontReadFromInput-remove-comment
Remove (rejected) comment from DontReadFromInput
2019-10-23 01:07:12 +02:00
Daniel Hahler bdadf12af1
Merge pull request #6030 from blueyed/tox-vv
ci: use tox -vv
2019-10-23 01:05:21 +02:00
Bruno Oliveira a51bb3eedb Add CHANGELOG for #5630 2019-10-22 19:43:42 -03:00
Bruno Oliveira f4734213e5 Merge remote-tracking branch 'upstream/features' into blueyed/pdb-doctest-bdbquit 2019-10-22 19:43:35 -03:00
Daniel Hahler 56cec5fa79 ci: use tox -vv
This will display durations, and is useful in logs in general.
2019-10-22 05:46:52 +02:00
Daniel Hahler 978c7ae1b7
Merge pull request #6015 from blueyed/merge-master-into-features
Merge master into features
2019-10-21 21:59:09 +02:00
Daniel Hahler 554dba391c Multiple colors with terminal summary_stats
Ref: https://github.com/pytest-dev/pytest/issues/5060
2019-10-21 04:35:45 +02:00
Daniel Hahler 995990c61b Remove (rejected) comment from DontReadFromInput
Ref: https://github.com/pytest-dev/pytest/pull/4996#issuecomment-479686487
2019-10-21 02:26:29 +02:00
Daniel Hahler b47f57a08a pytester: parseconfigure: remove duplicate config._ensure_unconfigure
This gets done in `parseconfig` already.
2019-10-21 01:15:27 +02:00
Daniel Hahler 803cc1f294 Merge master into features 2019-10-21 00:08:03 +02:00
Bruno Oliveira 14142b9113
tests: remove unnecessary test, clarify (#6013)
tests: remove unnecessary test, clarify
2019-10-20 18:36:27 -03:00
Daniel Hahler 0123b29ed7 tests: remove unnecessary test, clarify
Follow-up to https://github.com/pytest-dev/pytest/pull/6009.
2019-10-20 20:40:13 +02:00
Bruno Oliveira 16efa1bfef
Merge pull request #6009 from yoavcaspi/fix_keyboardInterrupt_on_setup_show
setuponly: remove printing out/err from capman
2019-10-20 14:00:06 -03:00
Daniel Hahler a6152db84a setuponly: pytest_fixture_setup: use option directly 2019-10-20 17:57:25 +02:00
Daniel Hahler 83351a3368 doc: improve help for filterwarnings 2019-10-20 17:56:59 +02:00
Daniel Hahler fbb7f663be
Merge pull request #6005 from blueyed/harden-trial
tests: harden/fix test_trial_error
2019-10-20 17:35:15 +02:00
Yoav Caspi 5624e366c1 add more indications to the result of the tests 2019-10-20 09:54:23 +03:00
Anthony Sottile b88f5df4ce
Merge pull request #6010 from pytest-dev/asottile-patch-2
Ensure .pytest_cache file has a newline at the end
2019-10-19 16:21:21 -07:00
Anthony Sottile 3a402811de Ensure .pytest_cache file has a newline at the end 2019-10-19 14:42:06 -07:00
Bruno Oliveira b5579d2cf2
Make InvocationParams.args a tuple (#6008)
Make InvocationParams.args a tuple
2019-10-19 17:36:42 -03:00
Daniel Hahler 9b673bcc44
Improve/revisit CallInfo.__repr__ (#6007) 2019-10-19 21:45:27 +02:00
Bruno Oliveira d12cdd3127 Make InvocationParams.args a tuple
This avoids mutating the original list to reflect on InvocationParams,
which is supposed to be an immutable snapshot of the state of pytest.main()
at the moment of invocation (see pytest-dev/pytest-xdist#478).
2019-10-19 16:42:58 -03:00
Yoav Caspi e05b33ed16 setuponly: remove printing out/err from capman 2019-10-19 22:33:19 +03:00
Daniel Hahler 119bf66d7a
ExceptionInfo.from_current: pass through exprinfo (#6002) 2019-10-19 19:20:55 +02:00
Daniel Hahler 15f9568694 Improve/revisit CallInfo.__repr__ 2019-10-19 19:07:11 +02:00
Florian Bruhin 2e11ea6108
Merge pull request #6006 from atugushev/update-doc-contextlib2
Update doc to use contextlib2.nullcontext
2019-10-19 14:29:16 +02:00
Albert Tugushev 18786992bb Update doc to use contextlib2.nullcontext
nullcontext has been backported in contextlib2==0.6.0
2019-10-19 15:09:37 +07:00
Daniel Hahler 5b88612e5b tests: harden/fix test_trial_error 2019-10-19 09:03:26 +02:00
Daniel Hahler cd753aa4ab ExceptionInfo.from_current: pass through exprinfo
This was lost in 11f1f79222.
2019-10-19 03:02:47 +02:00
Daniel Hahler 5e7b8d813b
Remove unreachable code from config._prepareconfig (#6001) 2019-10-18 23:47:09 +02:00