Commit Graph

1406 Commits

Author SHA1 Message Date
Bruno Oliveira 08734bdd18 --lf now skips colletion of files without failed tests
Fix #5172
2019-04-28 20:23:46 -03:00
Bruno Oliveira a3c2ec3c5b Add CHANGELOG for #5182 2019-04-28 11:10:21 -03:00
Bruno Oliveira 915ecb0dac Add CHANGELOG for #5177 2019-04-28 10:47:19 -03: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
Nikolay Kondratyev bc00d0f7db Fix handle repr error with showlocals and verbose output 2019-04-19 18:54:21 +03:00
Daniel Hahler 4749dca764 changelog [ci skip] 2019-04-18 23:54:20 +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
Anthony Sottile 990133f804
Merge pull request #5132 from nicoddemus/merge-master-into-features
Merge master into features
2019-04-15 13:11:33 -07: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 8d3a5dcd1b Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2019-04-15 14:47:45 -03: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 006dc30476 Preparing release version 4.4.1 2019-04-15 14:24:17 +00:00
Daniel Hahler 6f0a5789fb Merge master into features 2019-04-14 23:22:21 +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
Bruno Oliveira 19035f4b55
Merge pull request #5068 from blueyed/reportchars
Add support for reportchars=A (`-rA`)
2019-04-12 08:13:22 -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 42e60d935a doc/changelog 2019-04-11 11:44:04 +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 12133d4eb7 changelog [ci skip] 2019-04-10 23:15:25 +02:00
Daniel Hahler dde27a2305 changelog [ci skip] 2019-04-10 21:39:51 +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
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 0f965e57a2 changelog, fix branch coverage 2019-04-05 12:12:29 +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 eb5b2e0db5 Support glob argument with ``--cache-show`` 2019-04-04 18:10:39 +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 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
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 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 9121138a1b Emit warning for unknown marks 2019-04-01 10:40:18 +11:00
Zac-HD bcc08ffe4d More docs on registering marks 2019-03-31 14:22:30 +11:00
Bruno Oliveira 8881b201aa Preparing release version 4.4.0 2019-03-29 20:49:18 +00: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 46d9243eb0 changelog 2019-03-28 11:56:53 +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 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
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 b18df936ea changelog 2019-03-26 10:06:53 +01:00
Bruno Oliveira 645774295f Add CHANGELOG 2019-03-25 20:16:59 -03: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 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 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
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 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
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
Miro Hrončok 2af0a023c9 Pin sphinx-removed-in to >= 0.2.0 to support Sphinx 2.0
Fixes https://github.com/pytest-dev/pytest/issues/4912
2019-03-15 10:56:13 +01: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
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
Miro Hrončok 134b957bf4 Remove deprecated Sphinx directive add_description_unit()
Partial solution for https://github.com/pytest-dev/pytest/issues/4912
2019-03-14 12:16:59 +01:00
Bruno Oliveira 74416525d2
Merge pull request #4903 from bmwiedemann/y2038
Allow tests to pass after 2038
2019-03-13 20:07:25 -03:00
Bruno Oliveira 44cb51010c Improve CHANGELOG and code comment 2019-03-13 18:52:30 -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
Daniel Hahler 6630d96253
Merge pull request #4914 from hroncok/issue4913
Fix pytest tests invocation with custom PYTHONPATH
2019-03-12 18:58:54 +01:00
Miro Hrončok d32ab6029f Fix pytest tests invocation with custom PYTHONPATH
Fixes https://github.com/pytest-dev/pytest/issues/4913

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2019-03-12 17:31:42 +01:00
Bruno Oliveira 492cc4219c Prepare release 4.3.1 2019-03-11 12:59:54 -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
Bruno Oliveira a0f652c559
Rename 4898.trivial.rst to 4898.bugfix.rst 2019-03-08 22:41:57 -03:00
Bruno Oliveira 877b57ae9b
Add CHANGELOG entry 2019-03-08 22:33:07 -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 d97473e551 Add test and CHANGELOG for #1895 2019-03-02 09:39:30 -03:00
Daniel Hahler db5cc35b44 pytester: unset PYTEST_ADDOPTS 2019-03-01 18:43:17 +01:00
Daniel Hahler f7a3e001f7 pdb: allow for --pdbclass=mod:attr.class 2019-03-01 15:20:04 +01:00
Bruno Oliveira 33db5e081d
Tweak changelog 2019-03-01 10:09:29 -03: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
Bruno Oliveira 2cf1de3f2d
Merge pull request #4727 from nicoddemus/early-load-4718
Change -p so it is possible to early load setuptools plugins
2019-02-25 10:05:51 -03: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
Bruno Oliveira ede6387caa Require funcsigs>=1.0 on Python 2.7
Fix #4815
2019-02-24 12:11:08 -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 31c869b4c4 Preparing release version 4.3.0 2019-02-16 14:11:58 +00: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
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
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
Bruno Oliveira 82cc3d8cc2 Preparing release version 4.2.1 2019-02-12 20:17:06 +00: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
Sam Brightman a8003286b5 Add CHANGELOG entry for #4770 2019-02-12 13:32:06 +00:00
Bruno Oliveira b759ebdb93 Add CHANGELOG entry for #4698 2019-02-12 10:39:58 -02:00
Danilo Horta 821b6ef2a6 Avoid pkg_resources import at the top-level. 2019-02-11 23:26:35 +00: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
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
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 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 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
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
Ronny Pfannschmidt 526f4a95cc
Merge pull request #4735 from kohr-h/pytest_plugins_module_name
Mention that `pytest_plugins` should not be used as module name
2019-02-07 07:07:58 +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
Bruno Oliveira 2f083504ee
Merge pull request #4709 from namurphy/warns-docs
Document how to customize test failure message for missing warnings
2019-02-06 20:51:14 -02: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
Holger Kohr 7445b5345f Mention that `pytest_plugins` should not be used as module name 2019-02-06 21:57:42 +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
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
Nick Murphy 4e93dc2c97 Update changelog for pytest.warns doc update 2019-02-01 22:11:41 -05: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 fa979a4290 Preparing release version 4.2.0 2019-01-30 14:25:38 -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 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
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
Bruno Oliveira 7e8e593a45 Add CHANGELOG entry for #4691 2019-01-29 15:52:45 -02:00
Bruno Oliveira d720312df0 Add CHANGELOG entry for #4688 2019-01-28 19:03:19 -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 c1fe07276c Adding changelog entries for `does_not_raise` 2019-01-27 16:41:10 +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 37aab5dd6b Add CHANGELOG entry for #4660 2019-01-24 20:07:21 -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 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
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 0c6ca0da62 Fix usages of py.io.saferepr 2019-01-20 16:36:23 -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 85c5fa9f64
Update changelog 2019-01-14 22:58:41 -05:00
Joseph Hunkeler bcacc40775
Update comment text 2019-01-14 22:58:41 -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
Bruno Oliveira 6504746652 Add CHANGELOG entry for #4643 2019-01-14 09:03:23 -02:00
Bruno Oliveira 34eeda1c09 Preparing release version 4.1.1 2019-01-12 00:55:12 +00:00
Bruno Oliveira 3efb26ae7f
Merge pull request #4632 from AnjoMan/dont-rewrite-objects-with-failing-getattr
Assertion rewrite breaks for objects that reimplement `__getattr__`
2019-01-11 14:07:22 -02:00
Anton Lodder 77da4f118c Add changelog 4631 and AUTHOR credits for Anton Lodder 2019-01-10 20:48:51 -05:00
Bruno Oliveira 5f16ff3acc
Merge pull request #4212 from RonnyPfannschmidt/doctest-testmod-has-call
Doctest: hack in handling mock style objects
2019-01-10 19:13:45 -02:00
Bruno Oliveira 71a745270a
Merge pull request #4607 from oscarbenjamin/long_output
Show full repr with assert a==b and -vv
2019-01-10 12:30:46 -02:00
Bruno Oliveira 0f918b1a9d xunit-style functions and methods are invoked by autouse fixtures
Fix #3094, Fix #517
2019-01-10 12:10:04 -02:00
Ronny Pfannschmidt a6988aa0b9 fix doctest module when a mock object is around
fixes #3456
2019-01-10 12:50:22 +01:00
Bruno Oliveira a0ab5a7cd8
Merge pull request #4609 from yoavcaspi/documentation-configuration-files
Documentation configuration files
2019-01-09 22:32:02 -02:00
Bruno Oliveira ba8b3be61a
Improve CHANGELOG 2019-01-09 20:27:18 -02:00
Victor Maryama 081accb62c Fixed linting in changelog. 2019-01-09 13:11:22 +01:00
Victor Maryama fe4835c15e Added changelog entry. 2019-01-09 12:55:15 +01:00
Oscar Benjamin 85055a9efe Show full repr with assert a==b and -vv 2019-01-08 01:25:05 +00:00
Yoav Caspi 149620f858 update changelog 2019-01-06 23:11:27 +02:00
Anthony Sottile 4f38c610c3 Uninstall hypothesis in regen tox env 2019-01-06 07:53:39 -08:00
Bruno Oliveira 9d297c06e8 Preparing release version 4.1.0 2019-01-05 16:38:59 -02:00
Bruno Oliveira 0c4898670c Add changelog entry and update docs for importorskip 2019-01-05 12:55:39 -02:00
Bruno Oliveira 30c7a7bd69 Merge remote-tracking branch 'upstream/master' into features 2019-01-02 19:16:18 -02:00
Jeffrey Rackauckas 1eef53b6fe Update --collect-only to display test descriptions when ran in verbose mode. 2018-12-29 22:46:46 -08:00
Adam Johnson 388aff16c8 Improve detailed summary report docs
The existing examples had 0 tests collected so didn't show the actual summary report. Also I added a section explaining the difference between `p` and `P`.
2018-12-29 11:47:39 +00:00
Ronny Pfannschmidt 134641fcb5 add first set of changelog entries for marker removal 2018-12-21 14:02:38 +01:00
Hyunchel Kim ece01b0f56 Update cache documentation example to correctly show cache hit and miss 2018-12-21 04:43:26 +00:00
Bruno Oliveira c378cb4793 Remove support for applying marks to values in parametrize
Fix #3082
2018-12-20 16:16:13 -02:00
Bruno Oliveira a93f41233a Raise an error if pytest_plugins is defined in a non-top-level conftest.py file
Fix #4548
2018-12-19 18:09:47 -02:00
Bruno Oliveira 9138419379 Remove support for '[pytest]' section in setup.cfg file
Fix #3086
2018-12-19 17:43:17 -02:00
Bruno Oliveira 0115766df3 Calling fixtures directly is now an error instead of a warning
Fix #4545
2018-12-19 09:26:29 -02:00
Bruno Oliveira 8563364d8b
Merge pull request #4542 from nicoddemus/remove-legacy-warn
Remove config.warn, Node.warn and pytest_logwarning
2018-12-18 19:11:36 -02:00
Ronny Pfannschmidt e63c7a13ff
Merge pull request #4327 from ndevenish/approx
Let approx() work on more generic sequences
2018-12-17 15:21:12 +01:00
Bruno Oliveira b7e8171cf8
Merge branch 'features' into remove-legacy-warn 2018-12-17 10:37:31 -02:00
Bruno Oliveira 75e93e5168
Merge pull request #4556 from nicoddemus/idfunc-failure
Errors in parametrize id functions now propagate the error instead of issuing a warning
2018-12-17 10:36:15 -02:00
Bruno Oliveira 843d00c219 Fix linting 2018-12-17 10:35:17 -02:00
Bruno Oliveira c6d27d8224
Merge pull request #4555 from nicoddemus/remove-record-xml-pytest-main-str
Remove record_xml_property and support for strings in pytest.main()
2018-12-17 10:08:51 -02:00
Bruno Oliveira 84390acccc
Merge pull request #4553 from nicoddemus/junit-durations
Rename "junit_time" to "junit_duration_report" option
2018-12-17 10:08:20 -02:00
Kanguros f04d3c8b7d Adding change log entry 2018-12-16 21:27:59 +01:00
Bruno Oliveira 1499778d5e Errors in parametrize id functions now propagate the error instead of issuing a warning
Fix #2169
2018-12-14 21:07:54 -02:00
Bruno Oliveira a7e401656e Remove support to pass strings to pytest.main()
Fix #3085
2018-12-14 15:45:47 -02:00
Bruno Oliveira 6e1b1abfa7 Remove deprecated record_xml_property
Fix #4547
2018-12-14 15:10:08 -02:00
Daniel Hahler 8e287c5c77 Merge master into features 2018-12-14 16:44:43 +01:00
Bruno Oliveira 231863b133 Rename "junit_time" to "junit_duration_report" option
Just realized while reading the changelog that "junit_time" is not a very good
name, so I decided to open this PR renaming it to "junit_duration_report" which
I believe conveys the meaning of the option better
2018-12-14 12:56:26 -02:00
Bruno Oliveira fd48cd57f9 Remove config.warn, Node.warn; pytest_logwarning issues a warning when implemented
Fix #3078
2018-12-14 12:50:18 -02:00
Bruno Oliveira 98987177a0 Review changelog entries for features branch
I used `towncrier --draft` to see the full changelog, and decided to "nitpick" it
so it reads better as a whole.
2018-12-14 11:17:24 -02:00
Bruno Oliveira 1e80a9cb34 Remove pytest_funcarg__ prefix support for defining fixtures
Fix #4543
2018-12-13 21:41:38 -02:00
Bruno Oliveira 6c5a1150d4 Preparing release version 4.0.2 2018-12-13 23:37:51 +00:00
Bruno Oliveira 26d202a7bd
Merge pull request #4529 from aparamon/jxmlunit-call-time
Add --junittime=call option
2018-12-13 13:51:06 -02:00
Bruno Oliveira b390c66dc4
Merge pull request #4292 from blueyed/exit-outcome
Derive outcomes.exit.Exit from SystemExit instead of KeyboardInterrupt
2018-12-13 13:43:39 -02:00
Bruno Oliveira f96e1b6f3e
Merge pull request #4532 from nicoddemus/failure-summary
Change -ra to show errors and failures last, instead of first
2018-12-13 10:30:28 -02:00
Bruno Oliveira 5b83417afc Deprecate the 'message' parameter of pytest.raises
Fix #3974
2018-12-12 22:26:30 -02:00
Anthony Sottile a254ad0436 Raise `TypeError` for `with raises(..., match=<non-None falsey value>)`. 2018-12-12 14:59:22 -08:00
Daniel Hahler 7a600ea3eb
Improve changelog 2018-12-12 23:28:47 +01:00
Christopher Dignam f8d31d2400 Bugfix: monkeypatch.delattr handles class descriptors
Correct monkeypatch.delattr to match the correct behavior of
monkeypatch.setattr when changing class descriptors
2018-12-12 15:20:24 -05:00
Bruno Oliveira e3d30f8ebf Remove deprecated PyCollector.makeitem
Fix #4535
2018-12-12 14:15:52 -02:00
Andrey Paramonov b1e766c30e Update docs 2018-12-12 13:27:44 +03:00
Bruno Oliveira 3cd11617ea Add CHANGELOG 2018-12-11 20:40:06 -02:00
Daniel Hahler ebe0a88226
Merge pull request #4522 from blueyed/p-no-space
Handle missing space with -p
2018-12-11 13:33:18 +01:00
Daniel Hahler 8152b6837e
Merge pull request #4419 from blueyed/set_trace-kwargs
pdb: support kwargs with `pdb.set_trace`
2018-12-11 04:28:24 +01:00
Daniel Hahler 0e4e8e00a9
Merge pull request #4504 from feuillemorte/4278_add_cachedir_tag
#4278 Added a CACHEDIR.TAG file to the cache directory
2018-12-11 04:27:35 +01:00
Daniel Hahler 7b1cb885c7 Handle missing space with -p
This still does not use an actual argument parser, which only gets
instantiated below, and it does not appear to make sense instantiating
it just for this pre-parsing it seems.

`-p` without the required value is being handled before already though,
so it could potentially be passed down from somewhere already?!

Fixes https://github.com/pytest-dev/pytest/issues/3532.
2018-12-11 04:27:03 +01:00
Daniel Hahler fc4aa27cae Derive outcomes.exit.Exception from SystemExit instead of KeyboardInterrupt
This is required for properly getting out of pdb, where
KeyboardInterrupt is caught in py36 at least.

Ref: https://github.com/pytest-dev/pytest/issues/1865#issuecomment-242599949
2018-12-11 04:22:33 +01:00
Daniel Hahler 0db5ccb0dd Merge master into features 2018-12-10 05:42:07 +01:00
Daniel Hahler f3babf13ea Ensure that PYTEST_ADDOPTS are valid by themselves
Fixes https://github.com/pytest-dev/pytest/issues/4265.
2018-12-09 21:57:10 +01:00
Daniel Hahler 8a0ed7e2b3
Revisit changelog entry [ci skip] 2018-12-05 19:14:41 +01:00
Daniel Hahler 62b8f2f731
Update changelog [ci skip] 2018-12-05 19:07:10 +01:00
Tomer Keren 41031fce2f Address code review 2018-12-05 17:18:57 +02:00
Tomer Keren b7a64d6729 Create changelog file for 1495 2018-12-05 11:29:32 +02:00
Tomer Keren e1e4b226c6 👌 Address code review
Edited the changelog for extra clarity, and to fire off auto-formatting

Oddly enough, keeping `filename='{filename!r}'` caused an error while
collecting tests, but getting rid of the single ticks fixed it
Hopefully closes #3191
2018-12-05 10:52:12 +02:00
Bruno Oliveira 26d27df6fc Improve changelog message 2018-12-05 10:41:30 +02:00
Tomer Keren aaf7f7fcca Update changelog 2018-12-05 10:41:30 +02:00