Bruno Oliveira
4d49ba6529
Drop Python 2.7 and 3.4 support
...
* Update setup.py requires and classifiers
* Drop Python 2.7 and 3.4 from CI
* Update docs dropping 2.7 and 3.4 support
* Fix mock imports and remove tests related to pypi's mock module
* Add py27 and 34 support docs to the sidebar
* Remove usage of six from tmpdir
* Remove six.PY* code blocks
* Remove sys.version_info related code
* Cleanup compat
* Remove obsolete safe_str
* Remove obsolete __unicode__ methods
* Remove compat.PY35 and compat.PY36: not really needed anymore
* Remove unused UNICODE_TYPES
* Remove Jython specific code
* Remove some Python 2 references from docs
Related to #5275
2019-06-02 14:39:11 -03:00
Bruno Oliveira
acdf30a523
Fix all() unroll for non-generators/non-list comprehensions
...
Fix #5358
2019-06-02 12:12:14 -03:00
Anthony Sottile
cafb13c95f
Fix `pytest.mark.parametrize` when the argvalue is an iterator
2019-06-01 15:09:17 -07:00
Anthony Sottile
fb3ae5eaa9
Merge remote-tracking branch 'origin/master' into mm
2019-05-30 20:23:38 -07:00
Bruno Oliveira
c8d23c206b
logging: Improve formatting of multiline message ( #5312 )
...
logging: Improve formatting of multiline message
2019-05-30 21:42:41 -03:00
Victor Maryama
65bd1b8a93
Avoiding looking upwards for parameter argnames when generating fixtureinfo.
2019-05-30 23:42:04 +02:00
Daniel Hahler
ace3a02cd4
pytester: factor out testdir._env_run_update
2019-05-30 17:39:44 +02:00
Daniel Hahler
f013a5e8c1
pytester: use temporary HOME with spawn
...
Followup to https://github.com/pytest-dev/pytest/issues/4956 .
2019-05-30 17:39:44 +02:00
Bruno Oliveira
fbd8ff9502
Merge master into features ( #5339 )
...
Merge master into features
2019-05-30 12:21:51 -03:00
Bruno Oliveira
5cbc06a453
Show test module in the PytestCollectionWarning message
...
Related to #5330
2019-05-30 08:18:28 -03:00
Daniel Hahler
da23aa3419
pytester: remove unused winpymap
...
Follow-up to c86d2daf8
.
2019-05-30 08:09:49 +02:00
Daniel Hahler
6765aca0d1
Merge master into features
2019-05-30 06:33:04 +02:00
Daniel Hahler
61dfd0a94f
pdb: move/refactor initialization of PytestPdbWrapper
2019-05-30 03:00:07 +02:00
Bruno Oliveira
b10f28949d
Add the junit_log_passing_tests ini flag to skip logging output for passing tests. ( #5052 )
...
Add the junit_log_passing_tests ini flag to skip logging output for passing tests.
2019-05-29 20:56:13 -03:00
Daniel Hahler
ff80464b47
last-failed: display skipped-files msg always
2019-05-29 23:32:52 +02:00
Daniel Hahler
480dd9e6d6
last_failed_paths: improve caching
2019-05-29 23:28:58 +02:00
Daniel Hahler
ceb4f3f701
fixup! Fix regression with --lf and non-selected failures
2019-05-29 23:24:52 +02:00
Thomas Hisch
ea3ebec117
logging: Improve formatting of multiline message
2019-05-29 23:21:14 +02:00
Daniel Hahler
bf3b26b3f7
Fix regression with --lf and non-selected failures
2019-05-29 22:44:43 +02:00
Thomas Hisch
84569ca4da
Merge pull request #5311 from thisch/coloredcaplog
...
Use same code for setting up cli/non-cli formatter
2019-05-29 22:18:43 +02:00
Bruno Oliveira
5bc3ad8e27
minor: getbasetemp: dedent, improve assert ( #5327 )
...
minor: getbasetemp: dedent, improve assert
2019-05-28 19:59:43 -03:00
Thomas Hisch
d4b85da8c7
Use same code for setting up cli/non-cli formatter
...
A method _create_formatter was introduced that is used for both the
log_cli_formatter and the log_formatter.
Consequences of this commit are:
* Captured logs that are output for each failing test are formatted
using the ColoredLevelFromatter.
* The formatter used for writing to a file still uses the non-colored
logging.Formatter class.
2019-05-28 21:30:34 +02:00
Daniel Hahler
97d8e9fbec
minor: getbasetemp: dedent, improve assert
2019-05-28 18:26:10 +02:00
Daniel Hahler
220a2a1bc9
Remove _pytest.compat.NoneType
2019-05-28 18:16:18 +02:00
Daniel Hahler
e032904413
Merge master into features
2019-05-28 01:46:16 +02:00
Bruno Oliveira
2b9ca34280
Unroll calls to any #5062 ( #5103 )
...
Unroll calls to any #5062
2019-05-27 20:17:44 -03:00
Anthony Sottile
13f02af97d
Switch to importlib-metadata
2019-05-27 13:24:08 -07:00
Daniel Hahler
f2ed796c41
pdb: import pdbcls lazily
...
Fixes https://github.com/pytest-dev/pytest/issues/2064 .
2019-05-26 15:56:38 +02:00
Anthony Sottile
b3f8fabac8
Merge pull request #5308 from blueyed/minor
...
Minor fixes
2019-05-25 21:58:39 -07:00
Tomer Keren
22d91a3c3a
Unroll calls to all on python 2
2019-05-25 19:34:08 +03:00
Tomer Keren
322a0f0a33
Fix mention of issue #5062 in docstrings
2019-05-25 19:34:08 +03:00
Tomer Keren
58149459a5
Mark visit_all as a private method
2019-05-25 19:34:08 +03:00
Tomer Keren
437d6452c1
Expand list comprehensions as well
2019-05-25 19:34:08 +03:00
Tomer Keren
e37ff3042e
Check calls to all only if it's a name and not an attribute
2019-05-25 19:34:08 +03:00
Tomer Keren
ecd2de25a1
Revert "Displaying pip list command's packages and versions #5062"
...
This reverts commit 043fdb7c4065e5eb54f3fb5776077bb8fd651ce6.
These tests were part of the PR #5155 but weren't relevant to #5602
2019-05-25 19:34:08 +03:00
danielx123
0996f3dbc5
Displaying pip list command's packages and versions #5062
2019-05-25 19:34:08 +03:00
Tomer Keren
470e686a70
Rewrite unrolled assertion with a new rewriter,correctly append the unrolled for loop
2019-05-25 19:34:08 +03:00
Tomer Keren
765f75a8f1
Replace asserts of `any` with an assert in a for
2019-05-25 19:34:08 +03:00
Daniel Hahler
10ca84ffc5
Merge pull request #5119 from blueyed/reportopts-A-order
...
reportopts: A: put "Pp" in front
2019-05-24 18:28:43 +02:00
Thomas Hisch
bed3918cbc
Revert "logging: Simple impl of multline pretty printing"
...
This reverts commit 31dfbb4668
.
2019-05-24 09:11:03 +02:00
Thomas Hisch
31dfbb4668
logging: Simple impl of multline pretty printing
2019-05-24 09:09:09 +02:00
Bruno Oliveira
b4d75ad31d
Merge pull request #5091 from blueyed/showhelp-ini-options
...
Improve output of ini options in --help
2019-05-23 21:10:43 -03:00
Daniel Hahler
fa8a658458
Merge pull request #4908 from blueyed/pdb-pm-enter-hook
...
pdb: trigger pytest_enter_pdb hook with post-mortem
2019-05-24 01:50:24 +02:00
Bruno Oliveira
66f20b6f5e
Fix invalid Python file encoding "utf8" ( #5252 )
...
Fix invalid Python file encoding "utf8"
2019-05-23 20:24:23 -03:00
Daniel Hahler
6c56070df1
Merge pull request #5278 from blueyed/disable-python-plugin
...
Allow disabling of python plugin
2019-05-23 15:52:19 +02:00
Daniel Hahler
f9f41e69a8
reportopts: A: put "Pp" in front
2019-05-23 09:40:16 +02:00
Daniel Hahler
b2ce6f3200
Improve output of ini options in --help
...
Do not cut long help texts, but wrap them the same way as argparse wraps
the other help items.
2019-05-23 09:33:07 +02:00
Daniel Hahler
e0b584d048
CaptureFixture: do not crash in _suspend when not started
...
This happened in test_pdb_with_caplog_on_pdb_invocation.
2019-05-23 09:09:53 +02:00
Daniel Hahler
a0ff5deabf
pdb: trigger pytest_enter_pdb hook with post-mortem
...
This is required for pytest-pdb to be called with `--pdb`.
TODO:
- [ ] test
- [ ] pass mode to hook, e.g. "post_mortem" in this case?
2019-05-23 09:09:53 +02:00
Akiomi Kamakura
a304dbb519
Fix `disable_test_id_escaping_and_forfeit_all_rights_to_community_support` option when using a list of test IDs
2019-05-21 09:48:22 +09:00
Daniel Hahler
d19df5efa2
importorskip: display/include ImportError
...
This can provide useful information, e.g.
> could not import 'pyrepl.readline': curses library not found
2019-05-20 14:13:33 +02:00
Tim Hoffmann
b27e40cbf1
Fix documentation of pytest.raises(match=...)
2019-05-19 16:01:48 +02:00
Daniel Hahler
93fd9debe3
Allow disabling of python plugin
...
Fixes https://github.com/pytest-dev/pytest/issues/5277 .
2019-05-17 18:17:14 +02:00
Bruno Oliveira
e253029ad0
Handle lone surrogate unicode character not being representable in Jython
...
No tests for this because we don't test with Jython currently.
Fix #5256
2019-05-16 17:59:31 -03:00
Anthony Sottile
dc75b6af47
Use fix-encoding-pragma pre-commit hook
2019-05-14 15:56:31 -07:00
Bruno Oliveira
7573747cda
Normalize all source encoding declarations
2019-05-14 19:42:44 -03:00
Anthony Sottile
4318698bae
Remove 'b' from sys.stdout.mode
2019-05-14 15:00:59 -07:00
Bruno Oliveira
465b2d998a
Further "unknown marks warning" improvements ( #5178 )
...
Further "unknown marks warning" improvements
2019-05-11 13:28:10 -03:00
Bruno Oliveira
73bbff2b74
Introduce record_testsuite_property fixture
...
This exposes the functionality introduced in fa6acdc
as a session-scoped fixture.
Plugins that want to remain compatible with the `xunit2`
standard should use this fixture instead of `record_property`.
Fix #5202
2019-05-10 19:44:27 -03:00
Bruno Oliveira
685ca96c71
Change ``--strict`` to ``--strict-markers``, preserving the old one
...
Fix #5023
2019-05-09 19:36:38 -03:00
Bruno Oliveira
ccf6c3cb46
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
2019-05-09 19:22:40 -03:00
Daniel Hahler
0b8b006db4
minor: improve formatting
2019-05-09 15:36:49 +02:00
Daniel Hahler
73b74c74c9
pdb: only use outcomes.exit via do_quit
...
Fixes https://github.com/pytest-dev/pytest/issues/5235 .
2019-05-09 14:55:55 +02:00
Daniel Hahler
5eeb5ee960
Merge pull request #5013 from blueyed/short-summary-message
...
Display message from reprcrash in short test summary
2019-05-08 22:01:04 +02:00
Pulkit Goyal
7e08e09473
logging: improve default logging format (issue5214)
...
We improve the following things in the logging format:
* Show module name instead of just the filename
* show level of logging as the first thing
* show lineno attached to module:file details
Thanks to @blueyed who suggested this on the github issue.
It's my first contribution and I have added myself to AUTHORS.
I also added to a changelog file.
2019-05-08 21:37:59 +03:00
Bruno Oliveira
c04767f946
Use msg.rstrip() as suggested in review
2019-05-07 15:20:00 -03:00
Bruno Oliveira
6d040370ed
Show fixture scopes with ``--fixtures``, except for "function" scope
...
Fix #5220
2019-05-07 14:32:20 -03:00
Anthony Sottile
d1a48ad68f
Use exec directly
2019-05-06 23:07:39 -07:00
Bruno Oliveira
d3686361ba
Fix linting
2019-05-07 00:52:40 +00:00
Peter Schutt
8605ed2a15
Update python_api.py
2019-05-07 10:10:25 +10:00
Peter Schutt
8b34d981fc
Clarify docs for pytest.raises `match`.
...
For #5208 .
Document explicit behavior of `match` and brief note on how to handle matching a string that may contain special re chars.
2019-05-07 09:56:13 +10:00
Bruno Oliveira
784e1e3b7e
Add links to pytest.raises `message` workaround
...
Related to #3974
2019-05-06 12:35:27 -03:00
Bruno Oliveira
4a2fdce62b
Emit a warning for record_property when used with xunit2 ( #5204 )
...
Emit a warning for record_property when used with xunit2
2019-05-05 21:33:31 -03:00
Bruno Oliveira
32a5e80a6d
Add encoding: header and fix rep mock in test_line_with_reprcrash on py27
2019-05-05 09:33:37 -03:00
Bruno Oliveira
8f23e19bcb
Emit a warning for record_property when used with xunit2
...
"property" elements cannot be children of "testsuite" according to the schema, so it is incompatible with xunit2
Related to #5202
2019-05-05 09:01:13 -03:00
Bruno Oliveira
9f66102869
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
2019-05-04 10:47:57 -03:00
Daniel Hahler
865e84d206
Merge pull request #5109 from blueyed/summary_passes-green
...
summary_passes: use bold green for report headers
2019-05-04 00:46:23 +02:00
DamianSkrzypczak
1bd7d287a7
doc: fix hooks 'path' parameter doc type
...
by changing it from str to py.path.local
(#5171 )
2019-05-02 20:51:11 +02:00
Allan Lewis
f050203f5d
Improve help for --runxfail flag
...
The help for the '--runxfail' flag is somewhat misleading. The default
behaviour is to run tests marked as 'xfail' but to ignore the results. This
flag alters that behaviour by running these tests as if they weren't marked
'xfail', i.e. their results are not ignored.
2019-05-01 10:04:32 +01:00
Bruno Oliveira
3f5622c577
Use config_invocation_dir for startdirs ( #5151 )
...
Use config_invocation_dir for startdirs
2019-04-29 18:14:51 -03:00
Bruno Oliveira
1fb3f63f35
debugging: rename internal wrapper for pdb.Pdb ( #5186 )
...
debugging: rename internal wrapper for pdb.Pdb
2019-04-29 18:03:32 -03:00
Bruno Oliveira
fc2ad1dbed
Warning subclasses ( #5179 )
...
Warning subclasses
2019-04-29 17:57:49 -03:00
Bruno Oliveira
fb6dad60a0
terminal: use pytest_collection_finish for reporting ( #5113 )
...
terminal: use pytest_collection_finish for reporting
2019-04-29 08:00:48 -03:00
Daniel Hahler
02053bf556
debugging: rename internal wrapper for pdb.Pdb
...
This is useful/clearer in case of errors / tracebacks - i.e. you see
clearly that it is coming from pytest.
2019-04-29 05:46:21 +02:00
Daniel Hahler
ff5317a7f3
terminal: use pytest_collection_finish for reporting
2019-04-29 05:20:04 +02:00
Bruno Oliveira
08734bdd18
--lf now skips colletion of files without failed tests
...
Fix #5172
2019-04-28 20:23:46 -03:00
Bruno Oliveira
9742f11d37
Removed unused warning message
2019-04-28 11:06:47 -03:00
Bruno Oliveira
53cd7fd2ea
Introduce new warning subclasses
...
Fix #5177
2019-04-28 10:38:25 -03:00
Bruno Oliveira
8532e991a5
Publish UnknownMarkWarning as part of the public API and docs
2019-04-28 10:16:07 -03:00
Daniel Hahler
65133018f3
Terminal plugin is not semi-essential anymore
...
Thanks to https://github.com/pytest-dev/pytest/pull/5138 .
2019-04-27 03:39:00 +02:00
Daniel Hahler
308b733b9d
Revert "Merge pull request #4854 from blueyed/pdb-skip"
...
This reverts commit e88aa957ae
, reversing
changes made to 1410d3dc9a
.
I do not think it warrants an option anymore, and there is a way to
achieve this via `--pdbcls` if needed.
2019-04-27 02:25:38 +02:00
Daniel Hahler
7f519f8ab7
Merge master into features
2019-04-27 00:43:00 +02:00
Daniel Hahler
0bf363472e
Use config_invocation_dir for startdirs
...
`Session.startdir` and `TerminalReporter.startdir` appear to be
redundant given `Config.invocation_dir`.
Keep them for backward compatibility reasons, but use
`config.invocation_dir` for them.
2019-04-22 02:05:59 +02:00
Nikolay Kondratyev
bc00d0f7db
Fix handle repr error with showlocals and verbose output
2019-04-19 18:54:21 +03:00
Daniel Hahler
e3e57a755b
Merge pull request #5083 from blueyed/capture-_suspended
...
capture: store _state
2019-04-19 17:32:54 +02:00
Daniel Hahler
698c4e75fd
capture: track current state in _state attributes
...
This is meant for debugging, and making assertions later.
2019-04-19 00:35:15 +02:00
Daniel Hahler
649d23c8a8
pytest_sessionfinish: preset exitstatus with UsageErrors
...
Previously it would be 0. Setting it to the expected outcome
(EXIT_USAGEERROR) here already helps `pytest_sessionfinish` hooks.
2019-04-18 23:18:59 +02:00
Daniel Hahler
1460ad6027
Merge pull request #5111 from blueyed/deselect_by_keyword-skip
...
deselect_by_keyword: skip without expression
2019-04-17 23:20:02 +02:00
Daniel Hahler
78cd1a07d0
Merge pull request #5140 from blueyed/rewrite-name
...
assertion rewriting: use actual helper name
2019-04-17 23:19:38 +02:00
Ilya Konstantinov
d67d68f6d3
Eliminate core dependency on 'terminal' plugin
2019-04-17 11:19:19 -07:00
Daniel Hahler
df1d1105b0
Merge remote-tracking branch 'origin/features' into short-summary-message
...
Conflicts:
src/_pytest/skipping.py
2019-04-17 15:30:19 +02:00
Daniel Hahler
2b11b2c093
Merge pull request #5126 from blueyed/report-get_verbose_word
...
terminal/reports: use get_verbose_word method
2019-04-17 14:43:54 +02:00
Daniel Hahler
adb8edbae1
assertion rewriting: use actual helper name
...
This makes it easier / possible to grep.
2019-04-17 14:41:34 +02:00
Anthony Sottile
3cff5e252d
Merge pull request #5117 from blueyed/cov-terminal
...
Minor coverage improvements for terminal plugin
2019-04-15 14:30:18 -07:00
Daniel Hahler
7412df0920
fixup! terminal: summary_errors: replace if with assert
2019-04-15 22:53:31 +02:00
Bruno Oliveira
df68808d29
Merge pull request #5116 from blueyed/cov-pytester
...
Minor coverage improvements for pytester
2019-04-15 14:49:28 -03:00
Bruno Oliveira
b64d9402ca
Merge pull request #5108 from blueyed/summary
...
terminal summary: display passes after warnings
2019-04-15 14:49:01 -03:00
Bruno Oliveira
24bd51bda0
Merge pull request #5131 from blueyed/_getfailureheadline
...
_getfailureheadline: get head_line property only once
2019-04-15 12:23:41 -03:00
Daniel Hahler
9374114370
terminal/reports: add/use _get_verbose_word method
2019-04-15 17:06:18 +02:00
Daniel Hahler
eb13530560
_getfailureheadline: get head_line property only once
2019-04-15 17:04:51 +02:00
Daniel Hahler
5530d3e15d
Merge pull request #5120 from blueyed/minor
...
A collection of minor code tweaks
2019-04-15 16:32:20 +02:00
Daniel Hahler
ea79eb5c3f
terminal summary: display passes after warnings
...
This displays passes (with output, `-rP`) before the short summary, and
before any other output from other plugins also.
2019-04-15 16:31:42 +02:00
Bruno Oliveira
c8b904a406
Merge pull request #5124 from blueyed/terminal-summary_failures
...
terminal: revisit summary_failures
2019-04-15 11:26:52 -03:00
Bruno Oliveira
d45fa7b212
Merge pull request #5123 from blueyed/clsname
...
TestReport: use class name in repr
2019-04-15 11:25:42 -03:00
Daniel Hahler
45ba736c81
Merge pull request #5128 from blueyed/mark-is
...
Fix error message with unregistered markers
2019-04-15 16:23:54 +02:00
Daniel Hahler
cc005af47e
Fix error message with unregistered markers
2019-04-15 10:15:37 +02:00
Daniel Hahler
20c624efcf
terminal: revisit summary_failures
...
- get the list of reports for teardown sections only once
- do not check option in loop
2019-04-15 06:47:51 +02:00
Daniel Hahler
b2be6c1a30
TestReport: use class name in repr
2019-04-15 05:47:45 +02:00
Daniel Hahler
c43a9c83ee
doc: pytest_deselected: not only via keywords
2019-04-14 23:53:06 +02:00
Daniel Hahler
e804e419bc
remove unnecessary newline
2019-04-14 23:53:06 +02:00
Daniel Hahler
992e7f7771
rename variable
2019-04-14 23:53:06 +02:00
Daniel Hahler
bd1a2e6435
fix typo
2019-04-14 23:53:06 +02:00
Daniel Hahler
1d137fd2fe
minor: LFPlugin: de-indent code by returning if not active
2019-04-14 23:53:06 +02:00
Daniel Hahler
6f0a5789fb
Merge master into features
2019-04-14 23:22:21 +02:00
Daniel Hahler
cc78a533ae
terminal: summary_errors: replace if with assert
2019-04-14 23:17:27 +02:00
Daniel Hahler
fd0b3e2e8b
getreportopt: remove needless if
2019-04-14 23:17:27 +02:00
Daniel Hahler
f3dbe5a308
pytester: listoutcomes: assert instead of implicit if
2019-04-14 23:00:38 +02:00
Daniel Hahler
1da8ce65a6
pytester: raise_on_kwargs: ignore branch coverage
2019-04-14 23:00:38 +02:00
Daniel Hahler
6a73714b00
deselect_by_keyword: skip without expression
...
There is no need to iterate over all items always, if `-k` is not
specified.
2019-04-14 19:01:33 +02:00
Daniel Hahler
6371243c10
summary_passes: use bold green for report headers
2019-04-14 15:21:11 +02:00
Daniel Hahler
8fd5a658eb
monkeypatch.syspath_prepend: invalidate import cache
...
This was done with testdir only, and uses the fixed monkeypatch method
there now.
2019-04-13 16:15:44 +02:00
Anthony Sottile
43e7401c91
Produce a warning when unknown arguments are passed to pytest.param()
2019-04-12 13:00:39 -07:00
Anthony Sottile
da2e092163
pre-commit autoupdate
2019-04-12 04:52:47 -07:00
Bruno Oliveira
19035f4b55
Merge pull request #5068 from blueyed/reportchars
...
Add support for reportchars=A (`-rA`)
2019-04-12 08:13:22 -03:00
Bruno Oliveira
14d3d9187f
Remove partial unicode characters from summary messages in Python 2
2019-04-11 19:01:21 -03:00
Samuel Searles-Bryant
a37d1df089
Show XFail reason as part of JUnitXML message field
...
Fixes #4907
2019-04-11 22:26:05 +01:00
Daniel Hahler
8b2fcf517c
Merge master
2019-04-11 13:28:36 +02:00
Daniel Hahler
b3759372ad
Merge pull request #5082 from blueyed/pytester-raise_on_kwargs
...
pytester: improve/fix kwargs validation
2019-04-11 00:46:18 +02:00
Bruno Oliveira
f5d2b199e2
Merge pull request #5069 from blueyed/cleanup-summary-to-terminal
...
cleanup: move terminal summary code to terminal plugin
2019-04-10 19:32:01 -03:00
Daniel Hahler
5d9d12a6be
pytester: improve/fix kwargs validation
2019-04-10 21:57:45 +02:00
Daniel Hahler
10fa66e5b5
Merge pull request #5059 from blueyed/pytester-popen-run-stdin
...
pytester: allow passing in stdin to run/popen
2019-04-10 20:32:22 +02:00
Bruno Oliveira
5e26304d81
Merge pull request #5075 from blueyed/console_output_style
...
terminal: console_output_style: document "count" with help
2019-04-09 20:54:12 -03:00
Bruno Oliveira
d0860a339b
Merge pull request #5076 from blueyed/_show_progress_info
...
terminal: store console_output_style in _show_progress_info
2019-04-09 20:37:50 -03:00
Daniel Hahler
ec46864922
run: pass through stdin, just close then
2019-04-10 00:02:38 +02:00
Daniel Hahler
c36a90531a
Move CLOSE_STDIN to class
2019-04-10 00:01:15 +02:00
Daniel Hahler
a70e5f119e
terminal: store console_output_style in _show_progress_info
...
Avoids ini lookups.
2019-04-08 04:34:26 +02:00
Daniel Hahler
b6b7185b7b
terminal: console_output_style: document "count" with help
2019-04-08 04:32:53 +02:00
Daniel Hahler
ff5e98c654
Change noqa comment to pragma
2019-04-08 03:48:42 +02:00
Daniel Hahler
2662c400ba
dedent
2019-04-07 20:04:31 +02:00
Daniel Hahler
d8d835c1f5
minor: use functools.partial
2019-04-07 19:49:18 +02:00
Daniel Hahler
06029d11d3
Refactor into TerminalReporter.short_test_summary
2019-04-07 19:49:18 +02:00
Daniel Hahler
c70ecd49ca
cleanup: move terminal summary code to terminal plugin
...
Fixes https://github.com/pytest-dev/pytest/issues/5067 .
2019-04-07 18:22:04 +02:00
Daniel Hahler
b4b9f788af
Support reportchars=A (really all, including passed)
2019-04-07 18:05:33 +02:00
Daniel Hahler
a7e49e6c07
reportchars: fix/improve help message
2019-04-07 18:05:33 +02:00
Daniel Hahler
4fca86e2af
testdir.popen: use kwargs with defaults for stdout/stderr
2019-04-06 12:13:48 +02:00
Daniel Hahler
9ad00714ba
pytester: allow passing in stdin to run/popen
2019-04-06 12:13:28 +02:00
Daniel Hahler
377888140f
Merge master into features
...
Conflicts:
testing/test_pdb.py
2019-04-05 17:50:32 +02:00
Daniel Hahler
df377b589f
use wcwidth
2019-04-05 17:43:11 +02:00
Bruno Oliveira
87ce586d29
Merge pull request #5055 from blueyed/showhelp-lazy-fullwidth
...
showhelp: move tw.fullwidth out of the loop
2019-04-05 12:11:47 -03:00
Daniel Hahler
e20b39d928
showhelp: move tw.fullwidth out of the loop
2019-04-05 15:14:02 +02:00
Bruno Oliveira
4f33f46a02
Merge pull request #5026 from blueyed/compare-len-diff
...
Display number of different items with sequence/dict comparisons
2019-04-05 08:53:48 -03:00
Daniel Hahler
159704421e
change separator to hyphen
2019-04-05 12:21:24 +02:00
Daniel Hahler
0f965e57a2
changelog, fix branch coverage
2019-04-05 12:12:29 +02:00
Daniel Hahler
8011ff5bda
Add _sys_snapshot fixture and use it with more tests
2019-04-05 11:55:23 +02:00
Jeffrey Rackauckas
da3f836ee3
Added the junit_log_passing_tests ini flag.
2019-04-04 20:26:48 -07:00
Daniel Hahler
37ecca3ba9
factor out _get_line_with_reprcrash_message
2019-04-04 22:13:28 +02:00
Daniel Hahler
3d0ecd03ed
Display message from reprcrash in short test summary
...
This is useful to see common patterns easily, but also for single
failures already.
2019-04-04 18:49:13 +02:00
Daniel Hahler
eb5b2e0db5
Support glob argument with ``--cache-show``
2019-04-04 18:10:39 +02:00
Daniel Hahler
47d92a0d96
Add tests and improve messages
2019-04-04 17:53:39 +02:00
Daniel Hahler
7f1bf44aa8
_compare_eq_dict: display number of different items
2019-04-04 17:16:21 +02:00
Daniel Hahler
5fec793bc7
_compare_eq_sequence: display number of extra items
2019-04-04 17:16:21 +02:00
Bruno Oliveira
e04936fc29
Merge pull request #5042 from blueyed/merge-regen-master-into-features
...
Merge master into features (with regen)
2019-04-04 10:44:30 -03:00
Daniel Hahler
0d4636b056
Merge pull request #5034 from blueyed/run-last-failure-report
...
run-last-failure: improve reporting
2019-04-04 00:40:40 +02:00
Daniel Hahler
a65edf6711
Merge pull request #5028 from blueyed/fix-wrap_session-exit-code
...
wrap_session: restore old behavior for initstate=1
2019-04-04 00:39:38 +02:00
Daniel Hahler
757ada2fd2
pdb: try to import --pdbcls in pytest_configure only
...
Fixes https://github.com/pytest-dev/pytest/issues/5039 .
2019-04-03 22:35:18 +02:00
Daniel Hahler
e88aa957ae
Merge pull request #4854 from blueyed/pdb-skip
...
pdb: add option to skip `pdb.set_trace()`
2019-04-03 22:25:38 +02:00
Daniel Hahler
8907fedc79
Merge master into features (with regen branch)
2019-04-03 22:11:00 +02:00
Daniel Hahler
1f5a61e4ef
run-last-failure: improve reporting
2019-04-03 16:27:12 +02:00
Daniel Hahler
d91527599a
pytester: use monkeypatch with Testdir
2019-04-03 15:02:53 +02:00
Daniel Hahler
7538aa7bb9
minor: check_interactive_exception: use Skipped
2019-04-03 11:45:45 +02:00
Daniel Hahler
9434541090
doc: mention that pytest.fixture's param is in request.param
2019-04-03 11:45:45 +02:00
Daniel Hahler
cc90bcce4c
wrap_session: restore old behavior for initstate=1
2019-04-03 05:09:21 +02:00
Bruno Oliveira
15ea5cef46
Merge pull request #4943 from blueyed/remove-silence_logging_at_shutdown
...
capture: do not set logging.raiseExceptions = False
2019-04-02 22:46:15 -03:00
Daniel Hahler
32a8d503a2
Merge pull request #5005 from blueyed/essential_plugins
...
Split out list of essential plugins
2019-04-03 02:45:19 +02:00
Daniel Hahler
8c734dfc2f
Split out list of essential plugins
...
Fixes https://github.com/pytest-dev/pytest/issues/4976 .
2019-04-02 14:39:56 +02:00
Daniel Hahler
08ded2927a
capture: do not set logging.raiseExceptions = False
...
Ref: https://github.com/pytest-dev/pytest/issues/4942
2019-04-02 13:20:39 +02:00
Zac Hatfield-Dodds
cab4069f42
Clarify mark.__getattr__
2019-04-02 12:31:42 +11:00
Zac Hatfield-Dodds
4f6c67658c
Use mark-specific warning type
...
So that we can ignore it in self-tests.
2019-04-01 12:38:33 +11:00
Zac Hatfield-Dodds
9121138a1b
Emit warning for unknown marks
2019-04-01 10:40:18 +11:00
Zac-HD
ba1fc02a9b
Register mark used by pytester
2019-03-31 14:22:30 +11:00
Zac-HD
38d687f7c7
Fix typos in comments
2019-03-31 14:22:30 +11:00
Bruno Oliveira
278b289f37
Merge pull request #4968 from blueyed/pdb-do_debug-quit
...
pdb: do not raise outcomes.Exit with quit in debug
2019-03-29 16:22:02 -03:00
Daniel Hahler
e7ade066b6
Merge pull request #5011 from blueyed/merge-master-into-features
...
Merge master into features
2019-03-29 18:35:13 +01:00
Daniel Hahler
adebfd0a84
pdb: add option to skip `pdb.set_trace()`
2019-03-29 11:13:38 +01:00
Daniel Hahler
4e931b258d
Merge master into features
2019-03-29 11:05:46 +01:00
Daniel Hahler
4011021823
pdb: do not raise outcomes.Exit with quit in debug
2019-03-29 11:02:34 +01:00
Daniel Hahler
bfda2a0050
setup.cfg: use existing [tool:pytest] (ignoring [pytest])
2019-03-29 10:59:27 +01:00
Bruno Oliveira
6b5cddc48a
Merge pull request #4951 from blueyed/fix-pdb-capfix
...
pdb: handle capturing with fixtures only
2019-03-28 20:34:28 -03:00
Gary Tyler
403f556928
Update docs for 'pytest_cmdline_parse' hook to note availability liminations
2019-03-28 19:25:55 -04:00
Bruno Oliveira
d8ef86aadf
Merge pull request #4993 from blueyed/stepwise-report
...
stepwise: report status via pytest_report_collectionfinish
2019-03-28 20:24:18 -03:00
Bruno Oliveira
a9fe1e159a
Merge pull request #4965 from nicoddemus/serialization-hooks
...
Serialization hooks
2019-03-28 20:22:19 -03:00
Bruno Oliveira
65c8e8a09e
Rename hooks: to/from_serializable
2019-03-28 13:41:56 -03:00
Daniel Hahler
63a01bdb33
Factor out pytestPDB._is_capturing
2019-03-28 11:49:01 +01:00
Daniel Hahler
951213ee09
Use new suspend/resume in global_and_fixture_disabled
2019-03-28 11:49:01 +01:00
Daniel Hahler
40718efacc
Fix/revisit do_continue with regard to conditions
2019-03-28 11:49:01 +01:00
Daniel Hahler
d406786a8d
pdb: handle capturing with fixtures only
2019-03-28 11:49:01 +01:00
Daniel Hahler
d17ea7a9c0
tests: ensure cleanup with configs via get_config()
...
Also done in test_pluginmanager, although no resource warnings are
there at least.
Fixes https://github.com/pytest-dev/pytest/issues/4355 .
2019-03-28 00:14:13 +01:00
Daniel Hahler
c92021fc4f
Merge pull request #5003 from blueyed/off
...
Fix off-by-one error with lineno in mark collection error
2019-03-28 00:09:53 +01:00
Daniel Hahler
50a5cebba8
Merge pull request #5002 from blueyed/report
...
skipping: factor out _get_pos, pass only config to _get_report_str
2019-03-27 23:07:11 +01:00
Daniel Hahler
76c70cbf4c
Fix off-by-one error with lineno in mark collection error
2019-03-27 17:44:52 +01:00
Jeong YunWon
8b0b7156d9
Fix glitches of original patch of disable-test-id-escaping
2019-03-28 00:07:28 +09:00
ApaDoctor
cf6e2ceafd
add ini option to disable string escape for parametrization
2019-03-28 00:07:28 +09:00
Bruno Oliveira
241b7433cd
Merge pull request #4978 from blueyed/exit-from-from_assertrepr_compare
...
Do not swallow outcomes.Exit in assertrepr_compare
2019-03-26 18:39:13 -03:00
Bruno Oliveira
057c97812b
Merge pull request #4975 from blueyed/verbose-fixes
...
Fix usages of "verbose" option
2019-03-26 18:38:39 -03:00
Bruno Oliveira
02188e399d
Merge pull request #4987 from blueyed/collect-tbstyle-repr_failure
...
CollectError.repr_failure: honor explicit tbstyle option
2019-03-26 18:37:49 -03:00
Daniel Hahler
538efef1ba
logging: close log_file_handler
...
While it should be closed in logging's shutdown [1], the following would
still issue a ResourceWarning:
```
import logging
log_file_handler = logging.FileHandler("temp.log", mode="w", encoding="UTF-8")
root_logger = logging.getLogger()
root_logger.addHandler(log_file_handler)
root_logger.removeHandler(log_file_handler)
root_logger.error("error")
del log_file_handler
```
It looks like the weakref might get lost for some reason.
See https://github.com/pytest-dev/pytest/pull/4981/commits/92ffe42b45 / #4981
for more information.
1: c1419578a1/Lib/logging/__init__.py (L2107-L2139)
2019-03-26 18:24:19 +01:00
Bruno Oliveira
9311d822c7
Fix assertion in pytest_report_unserialize
2019-03-26 12:47:31 -03:00
Daniel Hahler
351529cb50
skipping: factor out _get_pos, pass only config to _get_report_str
2019-03-26 16:29:16 +01:00
Daniel Hahler
94a2e3dddc
stepwise: report status via pytest_report_collectionfinish
2019-03-26 13:20:33 +01:00
Daniel Hahler
e1ae469504
Merge master into features
2019-03-26 10:23:21 +01:00
Daniel Hahler
0d00be4f4f
Do not swallow outcomes.Exit in assertrepr_compare
2019-03-26 10:20:00 +01:00
Daniel Hahler
23146e7527
Fix usages of "verbose" option
...
With `-qq` `bool(config.getoption("verbose"))` is True; it needs to be
checked for `> 0`.
2019-03-26 10:11:25 +01:00
Daniel Hahler
4148663706
Merge pull request #4979 from blueyed/minor
...
Minor: whitespace, typo, docs
2019-03-26 10:01:13 +01:00
Bruno Oliveira
2d77018d1b
Improve coverage for _report_unserialization_failure
2019-03-25 20:16:59 -03:00
Bruno Oliveira
ceef0af1ae
Improve coverage for to_json() with paths in reports
2019-03-25 20:16:59 -03:00
Bruno Oliveira
f2e0c740d3
Code review suggestions
2019-03-25 20:16:59 -03:00
Bruno Oliveira
d856f4e51f
Make sure TestReports are not collected as test classes
2019-03-25 20:16:59 -03:00
Bruno Oliveira
7b9a414524
Add pytest_report_serialize and pytest_report_unserialize hooks
...
These hooks will be used by pytest-xdist and pytest-subtests to
serialize and customize reports.
2019-03-25 20:16:59 -03:00
Bruno Oliveira
0c63f99016
Add experimental _to_json and _from_json to TestReport and CollectReport
...
This methods were moved from xdist (ca03269).
Our intention is to keep this code closer to the core, given that it
might break easily due to refactorings.
Having it in the core might also allow to improve the code by moving
some responsibility to the "code" objects (ReprEntry, etc) which
are often found in the reports.
Finally pytest-xdist and pytest-subtests can use those functions
instead of coding it themselves.
2019-03-25 20:16:59 -03:00
Daniel Hahler
b53bf44139
Merge pull request #4985 from blueyed/assert-from_current
...
ExceptionInfo.from_current: assert current exception
2019-03-25 23:28:58 +01:00
Daniel Hahler
51f64c2920
Merge pull request #4980 from blueyed/fixup_namespace_packages
...
monkeypatch.syspath_prepend: call fixup_namespace_packages
2019-03-25 23:10:00 +01:00
Bruno Oliveira
cea42ff9e4
Docs: modules implementing pytest_cmdline_parse can be early-loaded
...
Related to #4974
2019-03-25 18:43:06 -03:00
Daniel Hahler
de44293d59
CollectError.repr_failure: honor explicit tbstyle option
2019-03-24 11:24:19 +01:00
Daniel Hahler
d44e42ec15
doc: improve warning_record_to_str
2019-03-24 11:20:01 +01:00
Daniel Hahler
aa0b657e58
Add Session.__repr__
2019-03-24 11:02:58 +01:00
Daniel Hahler
2d690b83bf
ExceptionInfo.from_current: assert current exception
2019-03-23 00:29:36 +01:00
Daniel Hahler
56dc01ffe0
minor: revisit _possibly_invalidate_import_caches
2019-03-22 17:02:26 +01:00
Daniel Hahler
5df45f5b27
Use fixup_namespace_packages also with pytester.syspathinsert
2019-03-22 17:02:26 +01:00
Daniel Hahler
475119988c
monkeypatch.syspath_prepend: call fixup_namespace_packages
...
Without the patch the test fails as follows:
# Prepending should call fixup_namespace_packages.
monkeypatch.syspath_prepend("world")
> import ns_pkg.world
E ModuleNotFoundError: No module named 'ns_pkg.world'
2019-03-22 15:29:08 +01:00
Daniel Hahler
5c26ba9cb1
minor: wrap_session: s/Spurious/unexpected/
2019-03-22 13:23:44 +01:00
Bruno Oliveira
b3319a6074
Merge pull request #4944 from henrykironde/k-EXPRESSION
...
Add example for k flag
2019-03-21 19:33:53 -03:00
Daniel Hahler
15d608867d
Merge pull request #4966 from blueyed/fix-preparse
...
config: fix consider_preparse with missing argument to -p
2019-03-21 19:12:57 +01:00
Daniel Hahler
ea2c6b8a88
config: fix consider_preparse with missing argument to -p
...
This is only required after/with 415899d4
- otherwise argparse ensures
there is an argument already.
2019-03-21 17:05:22 +01:00
Daniel Hahler
553951c443
Fix some issues related to "-p no:X" with default_plugins
2019-03-21 17:01:50 +01:00
Daniel Hahler
cc6e5ec345
tests: add test_report_collect_after_half_a_second
...
This is meant for stable coverage with "collecting X item(s)".
2019-03-20 22:13:11 +01:00
Daniel Hahler
bcdbb6b677
Revisit mkdir/_ensure_supporting_files in cacheprovider
...
- cacheprovider: move call to _ensure_supporting_files
This makes it less likely to have a race here (which is not critical),
but happened previously probably with xdist, causing flaky coverage with
`if not readme_path.is_file():` etc checks in
`_ensure_supporting_files`, which has been removed in the `features`
branch already.
2019-03-20 19:00:11 +01:00
Daniel Hahler
7939e5327c
Merge pull request #4957 from blueyed/config-handle-pno-with-default-plugins
...
config: handle `-p no:plugin` with default plugins
2019-03-20 03:32:03 +01:00
Daniel Hahler
f7171034f9
terminal: remove unnecessary check in _get_progress_information_message
...
All calls to _get_progress_information_message are only done for
`_show_progress_info`, which is `False` with `capture=no`.
2019-03-20 03:04:41 +01:00
Daniel Hahler
c7c120fba6
terminal: handle "capture" option not being available
...
This is the case with `-p no:capture` now.
2019-03-20 03:01:26 +01:00
Daniel Hahler
415899d428
config: handle `-p no:plugin` with default plugins
...
`-p no:capture` should not load its fixtures in the first place.
2019-03-20 02:47:13 +01:00
Daniel Hahler
8dda5613ef
Merge pull request #4956 from blueyed/home2
...
pytester: set HOME only with inline_run/popen
2019-03-20 02:29:29 +01:00
Daniel Hahler
714f2113bb
Merge pull request #4929 from blueyed/fix-_factorytraceback-offset
...
Fix line offsets with `ScopeMismatch` errors
2019-03-20 01:30:58 +01:00
Daniel Hahler
a50b92ea67
pytester: set HOME only with inline_run/popen
...
Ref: https://github.com/pytest-dev/pytest/issues/4955
2019-03-20 01:15:51 +01:00
Daniel Hahler
da81c1e49a
Merge pull request #4950 from blueyed/capture
...
Revisit capturing module: repr, doc fixes, minor
2019-03-20 01:12:22 +01:00
Bruno Oliveira
23ab43233e
Merge pull request #4920 from nicoddemus/subtests-pytest-1367
...
Internal refactorings required for *external* pytest-subtests plugin
2019-03-19 18:57:11 -03:00
Bruno Oliveira
1a119a22d1
Internal refactorings in order to support the new pytest-subtests plugin
...
Related to #1367
2019-03-19 18:20:41 -03:00
Daniel Hahler
7395501d1d
Easier read with _colorama_workaround/_readline_workaround
2019-03-19 01:17:21 +01:00
Daniel Hahler
920bffbfbb
Revisit _pytest.capture: repr, doc fixes, minor
2019-03-19 01:17:21 +01:00
Daniel Hahler
751c061d9a
Merge master into features
2019-03-19 01:07:10 +01:00
Daniel Hahler
a624b84097
Merge pull request #4941 from blueyed/testdir-home
...
pytester: testdir: set $HOME to tmpdir
2019-03-18 23:02:15 +01:00
Daniel Hahler
c75dd10671
pytester: testdir: set $HOME to tmpdir
...
This avoids loading user configuration, which might interfere with test
results, e.g. a `~/.pdbrc.py` with pdb++.
Also sets USERPROFILE, which will be required with Python 3.8 [1].
1: https://bugs.python.org/issue36264
2019-03-18 20:55:39 +01:00
henrykironde
1e3d5a0412
Add example for k flag
...
Includes an example of multiple expressions
2019-03-17 22:33:16 -04:00
Daniel Hahler
98981276a0
capture: fix FDCapture.__repr__ without targetfd_save
2019-03-18 02:33:03 +01:00
Daniel Hahler
15fe8c6e90
Handle `-p plug` after `-p no:plug`.
...
This can be used to override a blocked plugin (e.g. in "addopts") from the
command line etc.
2019-03-16 15:58:00 +01:00
Daniel Hahler
5e27ea5528
pytester: LineMatcher: assert Sequence when matching in order
...
This can be helpful when passing a set accidentally.
2019-03-15 23:07:08 +01:00
Bruno Oliveira
33d4c96aa2
Merge pull request #4830 from nicoddemus/warn-on-coroutine
...
Emit a warning when a coroutine test function is encountered
2019-03-15 09:51:34 -03:00
Daniel Hahler
95701566f3
Update src/_pytest/outcomes.py
...
Co-Authored-By: tkf <takafumi.a@gmail.com>
2019-03-15 12:21:48 +09:00
Daniel Hahler
57be1d60dd
Apply suggestions from code review
...
Co-Authored-By: tkf <takafumi.a@gmail.com>
2019-03-15 11:29:16 +09:00
Takafumi Arakaki
62f96eea6b
Include documentation
2019-03-15 11:14:50 +09:00
Daniel Hahler
d441fa66fe
Fix line offsets with `ScopeMismatch` errors
...
Fixes https://github.com/pytest-dev/pytest/issues/4928 .
2019-03-15 02:47:33 +01:00
Takafumi Arakaki
43aee15ba3
Make pytest.skip work in doctest
2019-03-15 10:20:46 +09:00
Daniel Hahler
7afe17740f
Merge master into features
2019-03-15 00:52:12 +01:00
Bruno Oliveira
40072b9511
Emit a warning when a async def function is not handled by a plugin
...
Fix #2224
2019-03-14 20:22:23 -03:00
Daniel Hahler
520af9d767
pdb: post_mortem: use super()
...
This is good practice in general, and I've seen it cause problems (MRO)
with pdb++.
2019-03-14 22:29:57 +01:00
Daniel Hahler
4d21dc4f2d
Optimize TracebackEntry.ishidden
...
The expected behavior is that there is no "__tracebackhide__" attribute,
so use `getattr` instead of multiple try/except.
2019-03-14 01:02:46 +01:00
Bruno Oliveira
44cb51010c
Improve CHANGELOG and code comment
2019-03-13 18:52:30 -03:00
Bruno Oliveira
b7ae7a654b
Remove callspec related block of code
...
It seems this is no longer required now that we don't support
yield tests anymore. The param attribute was added here:
91b6f2bda8/_pytest/python.py (L888-L891)
2019-03-12 20:10:59 -03:00
Bruno Oliveira
148e6a30c8
Improve coverage
2019-03-12 20:10:59 -03:00
Bruno Oliveira
47bd1688ed
Remove dead-code related to yield tests
...
Just noticed some code that no longer is needed when we removed yield-tests
2019-03-12 20:10:59 -03:00
Bernhard M. Wiedemann
489c61a22d
Allow tests to pass after 2038
...
without this change, the python-apache-libcloud tests failed
in the year 2039 with
fp.write(struct.pack("<ll", mtime, size))
E error: 'l' format requires -2147483648 <= number <= 2147483647
2019-03-10 05:22:21 +01:00
Stephan Hoyer
dc7ae41f33
Fix broken error message in pytester
2019-03-08 09:22:00 -08:00
Daniel Hahler
de5aa3847e
Apply suggestions from code review
...
Co-Authored-By: nicoddemus <nicoddemus@gmail.com>
2019-03-07 12:53:47 -03:00
Bruno Oliveira
0f4905a259
Simplify 'obj' property definition in PyobjMixin
...
This uses modern property definition syntax, declaring both getter
and setter as obj() functions
2019-03-07 08:15:04 -03:00
Daniel Hahler
c86d2daf81
pytester: remove unused anypython fixture
...
This became unused after ab9f6a75
(in 2009).
2019-03-06 17:42:21 +01:00
Daniel Hahler
236bada755
Merge pull request #4768 from horta/avoid-pkg_resources
...
Avoid pkg_resources import at the top-level.
2019-03-05 23:02:02 +01:00
Daniel Hahler
76687030f0
Merge branch 'master' into merge-master-into-features
...
Conflicts:
appveyor.yml
setup.py
2019-03-05 19:07:36 +01:00
Bruno Oliveira
23ea04f910
Merge pull request #4860 from nicoddemus/getfixturevalue-cleanup-1895
...
getfixturevalue does not correctly declare dependency with the calling fixture
2019-03-03 15:56:45 -03:00
Bruno Oliveira
0deb7b1696
Do not show "inifile:" string if there's no configuration file
2019-03-02 11:45:08 -03:00
Bruno Oliveira
53b8aa065c
Show testpaths option in the header if it has been used for collection
...
Fix #4875
2019-03-02 11:35:32 -03:00
Bruno Oliveira
6a2d122a50
Remove code debugging leftovers
2019-03-02 09:56:15 -03:00
Bruno Oliveira
7dceabfcb2
Ensure fixtures obtained with getfixturevalue() are finalized in the correct order
...
Fix #1895
2019-03-02 09:36:16 -03:00
Daniel Hahler
e1f97e41e3
Merge pull request #4872 from blueyed/_ensure_supporting_files
...
cacheprovider: _ensure_supporting_files: remove unused branches
2019-03-02 02:35:07 +01:00
Daniel Hahler
2d2f6cd4fd
cacheprovider: _ensure_supporting_files: remove unused branches
...
It is only called with empty/new dirs since 0385c273
.
2019-03-01 22:51:45 +01:00
Daniel Hahler
4290cacb86
Merge pull request #4864 from blueyed/isort-cfg
...
Add config for isort
2019-03-01 18:44:56 +01:00
Daniel Hahler
db5cc35b44
pytester: unset PYTEST_ADDOPTS
2019-03-01 18:43:17 +01:00
Bruno Oliveira
84555c89de
Merge pull request #4855 from blueyed/pdbcls-attr
...
--pdbcls: improve validation, and allow for "mod:attr.class"
2019-03-01 12:20:29 -03:00
Daniel Hahler
f7a3e001f7
pdb: allow for --pdbclass=mod:attr.class
2019-03-01 15:20:04 +01:00
Daniel Hahler
0d31e852b1
Run isort
2019-03-01 14:24:18 +01:00
Daniel Hahler
9cb71af9e5
_pytest.assertion.rewrite: move _format_explanation import
2019-03-01 14:13:28 +01:00
Daniel Hahler
a51dc0c7ce
Validate type with writing to captured output like without
...
Fixes https://github.com/pytest-dev/pytest/issues/4861 .
2019-03-01 14:03:51 +01:00
Daniel Hahler
a868a9ac13
pdb: validate --pdbcls option
2019-02-28 18:11:58 +01:00
Bruno Oliveira
a0207274f4
-p option now can be used to early-load plugins by entry-point name
...
Fixes #4718
2019-02-24 13:20:17 -03:00
Andras Mitzki
b26b731498
Logging: Make pytest_runtest_logreport() available for logging
...
Signed-off-by: Andras Mitzki <andras.mitzki@balabit.com>
2019-02-22 05:14:44 +01:00
Bruno Oliveira
0395996756
Merge remote-tracking branch 'upstream/master' into release-4.3.0
2019-02-16 14:06:51 +00:00
Bruno Oliveira
986dd84375
LoggingPlugin: Support to customize log_file from hook ( #4752 )
...
LoggingPlugin: Support to customize log_file from hook
2019-02-16 12:01:21 -02:00
Anthony Sottile
68dc433bf5
Merge pull request #4802 from gyermolenko/fix_code_block_in_Node_docstring
...
Fix code-block in Node docstring
2019-02-15 20:09:32 -05:00
Daniel Hahler
6fb7269979
terminal: write_fspath_result: work around py bug
2019-02-15 17:47:00 +01:00
Andras Mitzki
e3824d23bc
LoggingPlugin: Expose setting log_file_handler
...
- This patch allows to set log_file (path) from hook
Signed-off-by: Thomas Hisch
Signed-off-by: Andras Mitzki <andras.mitzki@balabit.com>
2019-02-15 16:05:10 +01:00
Grygorii Iermolenko
80ad448590
Fix code-block in Node docstring
2019-02-15 16:12:10 +02:00
Daniel Hahler
0b1f813c38
Merge pull request #4784 from blueyed/fix-4782
...
collect: python: fix `AssertionError` with broken symlinks
2019-02-14 15:10:14 +01:00
R. Alex Matevish
40cec637d7
Update kwarg for attr.ib to use 'converter' as 'convert' is due to be deprecated
2019-02-14 00:03:41 -08:00
Daniel Hahler
407d4a0cf0
collect: python: fix `AssertionError` with broken symlinks
...
Fixes https://github.com/pytest-dev/pytest/issues/4782 .
2019-02-14 00:18:14 +01:00
Daniel Hahler
7b91952645
Merge master into features
...
Conflicts:
tox.ini
2019-02-13 17:58:16 +01:00
Anthony Sottile
f672b7e39e
Merge pull request #4773 from nicoddemus/remove-py27-py34-deprecation-warning
...
Remove py27 py34 deprecation warning
2019-02-12 21:42:07 -05:00
Anthony Sottile
f0e6bf7604
Merge pull request #4775 from asottile/stdlib
...
Replace flatten() with chain.from_iterable
2019-02-12 21:37:05 -05:00
Bruno Oliveira
e20e376881
Merge pull request #4347 from blueyed/pdb-recursive-capture
...
pdbpp: fix capturing with recursive debugging
2019-02-12 16:53:14 -02:00
Anthony Sottile
f9c1329dab
Replace flatten() with chain.from_iterable
...
flatten is an alias in more-itertools anyway
2019-02-12 06:30:00 -08:00
Bruno Oliveira
b41632e9a8
Revert "Show deprecation message when running under Python 2.7 and 3.4"
...
This reverts commit eb92e57509
.
2019-02-12 10:39:25 -02:00
Danilo Horta
821b6ef2a6
Avoid pkg_resources import at the top-level.
2019-02-11 23:26:35 +00:00
Bruno Oliveira
67dd10de26
Merge pull request #4763 from blueyed/lsof
...
--lsof: suppress stderr
2019-02-11 13:18:40 -02:00
Daniel Hahler
f13935da53
Display --help/--version with ArgumentErrors
2019-02-11 15:49:48 +01:00
Daniel Hahler
61b9246afe
Fix/improve handling of pkg init and test file via args
...
Ref: https://github.com/pytest-dev/pytest/issues/4344#issuecomment-441095934
2019-02-11 15:04:24 +01:00
Daniel Hahler
9feb4941f4
pdb: fix capturing with recursive debugging and pdb++
...
While I think that pdb++ should be fixed in this regard (by using
`pdb.Pdb`, and not `self.__class__` maybe), this ensures that custom
debuggers like this are working.
2019-02-11 14:52:20 +01:00
Daniel Hahler
237f690f8b
--lsof: suppress stderr
...
This can spam a lot of warnings (per invocation), e.g.:
> lsof: WARNING: can't stat() nsfs file system /run/docker/netns/default
Output information may be incomplete.
Or from Travis/MacOS:
> lsof: WARNING: can't stat() vmhgfs file system /Volumes/VMware Shared Folders
> Output information may be incomplete.
> assuming "dev=31000003" from mount table
2019-02-11 14:08:44 +01:00
Daniel Hahler
ed01dc6567
Merge pull request #4652 from blueyed/RunResult-repr
...
Add __repr__ for RunResult
2019-02-09 01:26:24 +01:00
Bruno Oliveira
3a366f451a
Merge pull request #4741 from thisch/refactor_terminalreporter
...
Remove terminal_reporter workaround from logging.py
2019-02-08 21:47:53 -02:00
Daniel Hahler
fc8800c71f
Merge pull request #4722 from fetzerch/ignore_wildcards
...
Add ability to use globs when using --ignore
2019-02-09 00:11:04 +01:00
Daniel Hahler
9bcbf552d6
Add __repr__ for RunResult
2019-02-08 23:41:20 +01:00
Bruno Oliveira
32c6d4f603
Merge pull request #4738 from pstradomski/master
...
Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.
2019-02-08 19:57:14 -02:00
Daniel Hahler
b4b2f58eab
Merge pull request #4747 from blueyed/visit-filter
...
pytest.main: collect: factor out _visit_filter
2019-02-08 22:19:38 +01:00
Daniel Hahler
9c03196e79
Merge master into features
2019-02-08 22:02:29 +01:00
Daniel Hahler
64e8185ff7
Merge master into features
2019-02-08 20:09:09 +01:00
Daniel Hahler
7bb504b807
pytest.main: collect: factor out _visit_filter
2019-02-08 19:28:12 +01:00
Daniel Hahler
913a2da6e5
Fix handling of collect_ignore from parent conftest
...
`_collectfile` should be called on files only.
Fixes https://github.com/pytest-dev/pytest/issues/4592 .
2019-02-08 18:46:43 +01:00
Anthony Sottile
ea732464aa
Merge pull request #4740 from asottile/bugfix_4739
...
Fix `parametrize(... ids=<function>)` when the function returns non-strings
2019-02-07 21:47:33 -08:00
Thomas Hisch
ddbea29c12
Remove terminal_reporter workaround from logging.py
...
The workaround was removed from the logging module by creating python
properties for verbosity related settings in the terminalreporter.
Closes : #4733
2019-02-07 22:52:07 +01:00
Anthony Sottile
4c7ddb8d9b
Fix `parametrize(... ids=<function>)` when the function returns non-strings.
2019-02-07 12:25:59 -08:00
Thomas Hisch
a1fcd6e445
Merge pull request #4734 from thisch/refactor_clilogging
...
Refactor _setup_cli_logging code
2019-02-07 20:15:41 +01:00
Thomas Hisch
7b8fd0cc12
Refactor _setup_cli_logging code
...
Change the indentation in _setup_cli_logging by moving the
self._log_cli_enabled check outside of the _setup_cli_logging method.
2019-02-07 19:39:12 +01:00
Paweł Stradomski
391dc549c0
Add comment on why realpath is needed
2019-02-07 12:56:13 +01:00
Paweł Stradomski
59e6fb94b5
Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.
2019-02-07 02:05:22 +01:00
Zac Hatfield-Dodds
3384ffc6eb
Merge pull request #4725 from nicoddemus/collection-finish
...
Call pytest_report_collectionfinish hook when --collect-only is passed
2019-02-06 12:38:12 -10:00
Bruno Oliveira
e276bd3332
pytest.warns emits a warning on unknown keyword arguments
2019-02-06 19:52:13 -02:00
Ronny Pfannschmidt
429485e621
Merge pull request #4720 from thisch/removesetupclilogging
...
Only call _setup_cli_logging in __init__
2019-02-06 20:05:41 +01:00
Christian Fetzer
2dc2a19db5
Add ability to exclude files matching glob patterns in conftest.py
...
This adds the `collect_ignore_glob` option for `conftest.py` to allow
Unix-style wildcards for excluding files.
2019-02-06 16:49:43 +01:00
Bruno Oliveira
54af0f4c65
Call pytest_report_collectionfinish hook when --collect-only is passed
...
Fix #2895
2019-02-06 12:58:23 -02:00
Christian Fetzer
fc5d4654e5
Add ability to exclude files matching glob patterns with --ignore-glob
...
This adds the `--ignore-glob` option to allow Unix-style wildcards so
that `--ignore-glob=integration*` excludes all tests that reside in
files starting with `integration`.
Fixes : #3711
2019-02-06 11:29:30 +01:00
Bruno Oliveira
19c93d16d1
Do not raise UsageError when "pytest_plugins" is a module
...
Fix #3899
2019-02-06 08:24:22 -02:00
Thomas Hisch
0ce8b910ca
Only call _setup_cli_logging in __init__
...
Supersedes #4719
2019-02-06 07:03:40 +01:00
Anthony Sottile
2264db7f4a
Merge pull request #4682 from arel/parameterize-conditional-raises-document-only
...
Document parametrizing conditional raises
2019-02-02 13:15:26 -08:00
Bruno Oliveira
c3d7340542
Fix setUpClass being called in subclasses that were skipped
...
Fix #4700
2019-01-31 20:24:11 -02:00
Bruno Oliveira
02962fabda
Merge remote-tracking branch 'upstream/features' into merge-master-into-features
2019-01-30 09:37:46 -02:00
Bruno Oliveira
b77d168d58
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
2019-01-30 09:37:29 -02:00
Bruno Oliveira
c0e6543b5a
Fix pytest_report_teststatus call to pass new config object ( #4691 )
2019-01-30 09:36:54 -02:00
Bruno Oliveira
1dc16ad77b
Merge pull request #4690 from nicoddemus/deprecated-python-summary
...
Show deprecation message when running under Python 2.7 and 3.4
2019-01-30 09:07:59 -02:00
Anthony Sottile
acece23697
pre-commit autoupdate
2019-01-29 21:13:32 -08:00
Anthony Sottile
e5f823a3a7
fixes for flake8 3.7
2019-01-29 21:11:15 -08:00
Bruno Oliveira
b41dc03930
Merge pull request #4691 from nicoddemus/config-terminal-summary-hook
...
Add config to pytest_terminal_summary hook
2019-01-29 21:11:37 -02:00
Bruno Oliveira
ade5f2c8c5
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
2019-01-29 19:36:56 -02:00
Bruno Oliveira
3e0e819158
Merge pull request #4280 from blueyed/trace-quit
...
pdb: improve quitting from debugger
2019-01-29 19:14:20 -02:00
Bruno Oliveira
eb92e57509
Show deprecation message when running under Python 2.7 and 3.4
...
Fix #4627
2019-01-29 19:02:41 -02:00
Bruno Oliveira
7ad499ad76
Merge pull request #4681 from RonnyPfannschmidt/fix-4680-tmppath-is-tmpdir
...
Fix 4680 - `tmp_path` and `tmpdir` now share the same temporary directory
2019-01-29 19:00:56 -02:00
Ronny Pfannschmidt
2d7582bd92
flip around basetemp folder reset to see if it helps on windows
2019-01-29 18:58:00 +01:00
Bruno Oliveira
6c3b86369f
Add config to pytest_terminal_summary hook
...
The docs stated that this hook got the 'config' parameter in 3.5, but the docs
wre probably changed by mistake.
2019-01-29 15:41:13 -02:00
Bruno Oliveira
5b09eb1d74
Add config parameter to pytest_report_teststatus hook
2019-01-28 19:00:50 -02:00
Bruno Oliveira
1c5009c3fb
Handle unittest.SkipTest exception with non-ascii characters
...
Fix #4669
2019-01-28 12:50:04 -02:00
Arel Cordero
fd4289dae0
Adding `does_not_raise` to documentation only
2019-01-27 16:42:10 +00:00
Arel Cordero
977adf1354
Improving sphinx docs based on feedback
2019-01-27 16:41:23 +00:00
Arel Cordero
afe9fd5ffd
Adds `does_not_raise` context manager
...
Addressing issues #4324 and #1830
2019-01-27 16:40:35 +00:00
Ronny Pfannschmidt
c75bd08807
ensure tmp_path is always a realpath
2019-01-27 14:08:43 +01:00
Ronny Pfannschmidt
f7d7555521
fix #4680 - ensure tmpdir and tmp_path are the same
2019-01-27 13:05:34 +01:00
Bruno Oliveira
9905a73ae0
Merge pull request #4511 from jhunkeler/junit-strict
...
Toggle JUnit behavior with INI option
2019-01-24 20:54:32 -02:00
Bruno Oliveira
51dd738b1a
Merge pull request #4673 from kown7/count-tests
...
Count tests
2019-01-24 20:46:29 -02:00
Bruno Oliveira
7ddfc04793
Merge pull request #4665 from nicoddemus/group-warnings-by-message
...
Group warnings by message instead of by test id
2019-01-24 20:00:27 -02:00
wim glenn
2d18546870
resolving report.when attribute should be reliable now
2019-01-24 11:12:59 -06:00
wim glenn
0f546c4670
pytest_terminal_summary uses result from pytest_report_teststatus hook, rather than hardcoded strings
...
Less hacky way to make XPASS yellow markup. Make sure collect reports still have a "when" attribute.
xfail changed to XFAIL in the test report, for consistency with other outcomes which are all CAPS
2019-01-24 10:17:29 -06:00
Kristoffer Nordstroem
8723eb16ea
only print selected if any have been selected
2019-01-24 00:00:29 +01:00
Bruno Oliveira
daf39112e7
Merge pull request #4091 from nicoddemus/setup-methods-as-fixtures-3094
...
Use fixtures to invoke xunit-style fixtures
2019-01-23 19:23:31 -02:00
Bruno Oliveira
9543d1901f
Group warnings by message instead of by test id
2019-01-22 19:42:22 -02:00
Anthony Sottile
92a2c1a9c4
remove and ban py.io.BytesIO, py.process, py.path.local.sysfind
2019-01-21 19:51:16 -08:00
Kristoffer Nordstroem
9f86e83478
count selected tests
2019-01-21 23:56:39 +01:00
Anthony Sottile
0c6ca0da62
Fix usages of py.io.saferepr
2019-01-20 16:36:23 -08:00
Anthony Sottile
095ce2ca7f
Fix linting errors and py references in saferepr.py
2019-01-20 16:36:14 -08:00
Anthony Sottile
dbb6c18c44
copy saferepr from pylib verbatim
...
Copied from b9da2ed6178cd37d4ed6b41f9fa8234dce96973f
2019-01-20 16:30:31 -08:00
Anthony Sottile
ec5e279f93
Remove and ban use of py.builtin
2019-01-20 11:59:48 -08:00
Daniel Hahler
e69b1255d7
Improve quitting from pdb
...
Regarding tests: it merges ``test_pdb_interaction``,
``test_pdb_print_captured_stdout``, and
``test_pdb_print_captured_stderr`` into
``test_pdb_print_captured_stdout_and_stderr`` (clarity and performance,
especially since pexpect tests are slow).
2019-01-20 00:34:16 +01:00
Bruno Oliveira
57bf9d6740
Merge pull request #4654 from AuHau/fix/#4653-Fix_tmp_path_symlink_resolution
...
Fixes #4653 - tmp_path provides real path
2019-01-19 09:41:47 -02:00
Ronny Pfannschmidt
f28b834426
fix #4649 - also transfer markers to keywordmapping
...
as it turns out it is distinct from nodekeywords and behaves completely different
2019-01-18 23:18:51 +01:00
Adam Uhlir
04bd147d46
Fixes #4653 - tmp_path provides real path
2019-01-18 12:54:00 -08:00
Bruno Oliveira
1a04e8903a
Merge pull request #4537 from chdsbd/master
...
Bugfix: monkeypatch.delattr handles class descriptors
2019-01-16 08:09:59 -02:00
Joseph Hunkeler
8967976443
Ensure xml object is viable before testing family type
2019-01-14 22:58:41 -05:00
Joseph Hunkeler
bcacc40775
Update comment text
2019-01-14 22:58:41 -05:00
Joseph Hunkeler
aaa7d36bc9
Change family behavior:
...
* "legacy" is no longer a copy of "xunit1"
* Attempts to use "legacy" will redirect to "xunit1"
* record_xml_attribute is not compatible outside of legacy family
* Replace call to method/override raw() with to_xml()
2019-01-14 22:58:40 -05:00
Joseph Hunkeler
8937e39afd
Raise TypeError instead of NotImplementedError if not list type
2019-01-14 22:58:40 -05:00
Joseph Hunkeler
343430c537
Replace family "old" with "legacy"
2019-01-14 22:58:40 -05:00
Joseph Hunkeler
335cc5d651
Handle backwards-compatiblity
2019-01-14 22:58:40 -05:00
Joseph Hunkeler
2e551c32b6
Add junit_family config option
2019-01-14 22:58:40 -05:00
Joseph Hunkeler
af2ee1e80a
Emit JUnit compatible XML
...
* Remove non-standard testcase elements: 'file' and 'line'
* Replace testcase element 'skips' with 'skipped'
* Time resolution uses the standard format: 0.000
* Tests use corrected XML output with proper attributes
2019-01-14 22:58:40 -05:00
Daniel Hahler
1a358df998
Merge master into features
2019-01-14 17:15:39 +01:00
Anthony Sottile
5bb0be1e24
Merge pull request #4615 from asottile/some_dead_code
...
Remove some dead code
2019-01-14 07:35:21 -08:00