Commit Graph

188 Commits

Author SHA1 Message Date
Daniel Hahler 8011ff5bda Add _sys_snapshot fixture and use it with more tests 2019-04-05 11:55:23 +02:00
Daniel Hahler 4148663706
Merge pull request #4979 from blueyed/minor
Minor: whitespace, typo, docs
2019-03-26 10:01:13 +01:00
Daniel Hahler 08f3b02dfc tests: fnmatch_lines: use list
For strings fnmatch_lines converts it into a Source objects, splitted on
newlines.  This is not necessary here, and it is more consistent to use
lists here in the first place.
2019-03-23 11:36:18 +01:00
Daniel Hahler 7a6bcc3639 Add reference to test_cmdline_python_namespace_package 2019-03-22 13:23:44 +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
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 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
Bruno Oliveira 19c93d16d1 Do not raise UsageError when "pytest_plugins" is a module
Fix #3899
2019-02-06 08:24:22 -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 eb92e57509 Show deprecation message when running under Python 2.7 and 3.4
Fix #4627
2019-01-29 19:02:41 -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 b7e8171cf8
Merge branch 'features' into remove-legacy-warn 2018-12-17 10:37:31 -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 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 40b85d7ee8 Remove Metafunc.addcall
Fix #3083
2018-12-01 16:41:59 -02:00
Anthony Sottile b3700f61ba Fix formatting of print() calls 2018-11-22 00:15:14 -08:00
Bruno Oliveira 557cb6cffe Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-11-13 09:01:37 -02:00
Bruno Oliveira dc20dedbc7 Change RemovedInPytest4Warnings to errors by default
To keep existing tests which emit RemovedInPytest4Warnings running, decided
to go with a command line option because:

* Is harder to integrate an ini option with tests which already use an ini file
* It also marks tests which need to be removed/updated in 4.1, when
  RemovedInPytest4Warning and related functionality are removed.

Fix #3737
2018-11-12 16:10:57 -02:00
Daniel Hahler bee72a6622 Fix nodes._check_initialpaths_for_relpath for dirs
Ref: https://github.com/pytest-dev/pytest/issues/4321#issuecomment-436951894

Hardens some of the not many tests affected by this:

1. `testing/test_session.py::test_rootdir_option_arg` displayed:

> root/test_rootdir_option_arg2/test_rootdir_option_arg.py

2. `test_cmdline_python_namespace_package` displayed "hello/" prefix for:

> hello/test_hello.py::test_hello
> hello/test_hello.py::test_other
2018-11-09 13:16:59 +01:00
Daniel Hahler a0890f98d8 tests: harden test_config_error 2018-11-09 01:31:53 +01:00
Anthony Sottile 2368fbb63c Apply reorder-python-imports to all files 2018-10-25 00:01:29 -07:00
Bruno Oliveira 54b8ad4554
Merge pull request #4159 from thisch/subclassedfile
Increase required verbosity level for debug output
2018-10-16 10:41:27 -03:00
Thomas Hisch e8c220b9bd Increase required verbosity level for debug output
To show the subclassed file in legacy test suits in the runtest output
you have to set the verbosity level to at least "-vv" now.

Closes #3211
2018-10-15 20:38:32 +02:00
Bruno Oliveira 9646a1cd7a Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-15 12:55:28 -03:00
Bruno Oliveira 486ded3fca Fix flaky durations test
Unfortunately due to fluctuations in runtime "test_something"
might still appear in the final message.

Example failure:

https://ci.appveyor.com/project/pytestbot/pytest/builds/19494829/job/8lx847u0c78m63wf
2018-10-14 12:22:56 -03:00
Bruno Oliveira 9fb305b17b
Merge pull request #4086 from jeffreyrack/4063-exclude-0-durations
Exclude durations that are 0.00 seconds long.
2018-10-13 22:16:04 -03:00
Daniel Hahler 7268462b33 Resolve symlinks for args
This fixes running `pytest tests/test_foo.py::test_bar`, where `tests`
is a symlink to `project/app/tests`: previously
`project/app/conftest.py` would be ignored for fixtures then.
2018-10-13 23:59:05 +02:00
Bruno Oliveira 3683d92c53 Adjust the 'durations hidden' message 2018-10-13 18:40:32 -03:00
Bruno Oliveira 24c83d725a
Merge pull request #4129 from nicoddemus/merge-master-into-features
Merge master into features (prepare for 3.9)
2018-10-13 12:05:54 -03:00
Daniel Hahler 6bf4692c7d acceptance_test: clarify/document/fix tests
Ref: e2e6e31711 (r30863971)
2018-10-13 14:41:17 +02:00
Daniel Hahler 81426c3d19 tests: harden test_cmdline_python_package_symlink 2018-10-13 14:41:12 +02:00
Bruno Oliveira 8e11fe5304 Improve tracebacks for ImportErrors in conftest.py files
Fix #3332
2018-10-12 10:10:55 -03:00
Niklas JQ c14a23d4e4 Fix #4093: multiple string literals on a line 2018-10-10 19:28:31 +02:00
Jeffrey Rackauckas fc11b81005 Exclude durations that are 0.00 seconds long. 2018-10-07 19:19:48 -07:00
Bruno Oliveira 1a323fbd3c Show a warning when non-str is given to Monkeypatch.setenv 2018-10-01 20:07:07 -03:00
CrazyMerlyn b01704cce1 Fix exit code for command line errors
Fixes #3913
2018-09-03 04:16:35 +00:00
Anthony Sottile f2e35c8c4f
Merge pull request #3859 from asottile/pyupgrade_1_4
Some pyupgrade 1.4.x changes
2018-08-23 18:32:53 -07:00
Anthony Sottile 85482d575e Replace Source with dedent where possible 2018-08-23 09:06:17 -07:00
Anthony Sottile 8bb8b91357 pyupgrade 1.4: tests 2018-08-22 18:47:21 -07:00
Bruno Oliveira 07a560ff24 Fix collection error when tests is specified with --doctest-modules
The problem was that _matchnodes would receive two items: [DoctestModule, Module]. It would then collect the first one, *cache it*, and fail to match against the name in the command line. Next, it would reuse the cached item (DoctestModule) instead of collecting the Module which would eventually find the "test" name on it.

Added the type of the node to the cache key to avoid this problem, although I'm not a big fan of caches that have different key types.

Fix #3843
2018-08-21 21:02:46 -03:00
Bruno Oliveira ef8ec01e39 Fix issue where fixtures would lose the decorated functionality
Fix #3774
2018-08-04 15:14:00 -03:00
Ronny Pfannschmidt e860ff7299 port some acceptance tests over to copy_example 2018-06-26 22:59:40 +02:00
Anthony Sottile cbaa7dd56a Upgrade pre-commit hooks except pyupgrade 2018-06-26 06:35:27 -07:00
Ronny Pfannschmidt 703e4b11ba run black 2018-05-23 16:48:46 +02:00
Ronny Pfannschmidt 9aacb4635e run pyupgrade 2018-05-23 16:45:09 +02:00
Bruno Oliveira 78c900448e Add acceptance test for #2798 2018-04-10 21:04:30 -03:00
Bruno Oliveira 59e7fd478e Sort fixtures by scope when determining fixture closure
Fix #2405
2018-03-20 20:10:53 -03:00
Bruno Oliveira aff463a3c4 Merge remote-tracking branch 'upstream/master' into features 2018-01-27 12:28:43 -02:00
Bruno Oliveira af37778b0d All classes now subclass object for better py3 compatibility
Fix #2147
2018-01-24 18:23:42 -02:00
Anthony Sottile bd1d17e8de Replace py.std with stdlib imports 2018-01-09 12:44:10 -08:00