Commit Graph

2715 Commits

Author SHA1 Message Date
Daniel Hahler 6af674a3ac
Merge pull request #4520 from blueyed/PYTEST_DISABLE_PLUGIN_AUTOLOAD-del
tests: fix tests that require PYTEST_DISABLE_PLUGIN_AUTOLOAD to be unset
2018-12-12 18:40:46 +01:00
Daniel Hahler 5ecbb02ace tests: fix test_raises_exception_looks_iterable
Started to fail on py37-xdist between
https://travis-ci.org/pytest-dev/pytest/jobs/465498973 and
https://travis-ci.org/pytest-dev/pytest/jobs/465792343, but could not
find a diff in versions (from the tox header), and both commits failed
locally.
2018-12-10 06:26:32 +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 64ee1ee81b tests: fix tests that require PYTEST_DISABLE_PLUGIN_AUTOLOAD to be unset
Fix pytest's own tests with PYTEST_DISABLE_PLUGIN_AUTOLOAD=1.
2018-12-09 12:06:18 +01:00
Pedro Algarvio 6da8befc74
Black suggestions 2018-12-03 12:58:22 +00:00
Pedro Algarvio 14024c7fc1
Test case for #4500 bug and respective fix #4487 2018-12-03 12:17:14 +00:00
Pedro Algarvio 517b8bc69e
Stop using the deprecated `\.warn()` log handler method 2018-12-03 11:52:33 +00:00
Bruno Oliveira 9e522c97fa Try to fix/improve reporting of test_request_garbage
* Run it in a subprocess to reduce possible intereference from the outer pytest
* Print the leaked objects to see if they provide any hints
2018-11-24 08:29:39 -02:00
Anthony Sottile 860bc50772
Merge pull request #4451 from asottile/report_correct_filename_raises_exec
Fix `raises(..., "code(string)")` frame filename.
2018-11-23 17:29:09 -08:00
Anthony Sottile 0d5298475d Fix `raises(..., "code(string)")` frame filename. 2018-11-23 15:01:35 -08:00
Daniel Hahler be3b8fc9c1 Fix warnings summary header appearing twice
Ref: https://github.com/pytest-dev/pytest/pull/4450#discussion_r236017645
Ref: https://github.com/pytest-dev/pytest/pull/4399
2018-11-23 22:47:58 +01:00
Daniel Hahler 0cf45ee18a Display "short test summary info" after (main) warnings again
Fixes https://github.com/pytest-dev/pytest/issues/3952.
2018-11-23 20:06:09 +01:00
Bruno Oliveira 0b73d6d4f5
Merge pull request #4444 from RonnyPfannschmidt/fix-4386-2
fix #4386 - handle uninitialized exceptioninfo in repr/str
2018-11-23 12:40:41 -02:00
Bruno Oliveira e4ae33d592
Merge pull request #4394 from blueyed/cache-ensure-files
cacheprovider: do not write README/.gitignore to existing dir
2018-11-23 09:07:49 -02:00
Bruno Oliveira c5c728c8bc Fix test/improve tests a bit in py27 2018-11-22 21:38:33 -02:00
Bruno Oliveira 9ae8429a21 Use a more specific exception type in test_raises_repr_inflight
As requested during review
2018-11-22 20:24:46 -02:00
Ronny Pfannschmidt abaf496fe8
Merge pull request #4440 from nicoddemus/config-warning-stacklevel
Adjust stacklevel of "config" warnings
2018-11-22 21:02:52 +01:00
Ronny Pfannschmidt b71bd9b300 fix #4386 - handle uninitialized exceptioninfo in repr/str 2018-11-22 20:52:15 +01:00
Ronny Pfannschmidt 94d032a6de
Merge pull request #4436 from asottile/print_function
Fix formatting of print() calls
2018-11-22 20:17:19 +01:00
Bruno Oliveira aa765cf8c2 Adjust stacklevel of "config" warnings
Related to #4439
2018-11-22 14:44:01 -02:00
Ronny Pfannschmidt 5f1d692072 use Path.resolve in test to sort out osx temporary folder being a symlink 2018-11-22 16:10:12 +01:00
Anthony Sottile b3700f61ba Fix formatting of print() calls 2018-11-22 00:15:14 -08:00
Ronny Pfannschmidt fc61bdd907 fix 4425: resolve --basetemp to absolute paths 2018-11-20 16:14:50 +01:00
Anthony Sottile 10cdae8e38
Merge pull request #4414 from asottile/starred_with_side_effect
Fix assertion rewriting involving Starred + side-effects
2018-11-17 16:17:24 -08:00
Daniel Hahler 5fab0ca312
Merge pull request #4403 from RonnyPfannschmidt/fix-4400
Fix #4400 - rearrange the handling of yield test warnings/errors
2018-11-18 00:57:44 +01:00
Anthony Sottile 690a63b921 Fix assertion rewriting involving Starred + side-effects 2018-11-17 10:42:51 -08:00
Daniel Hahler a252e81ced Fix collection of testpaths with `--pyargs`
Fixes https://github.com/pytest-dev/pytest/issues/4405.
2018-11-17 13:28:10 +01:00
Ronny Pfannschmidt 950d30e6e0 fix #4400 - rearrange the handling of yield test warnings/errors 2018-11-16 13:49:46 +01:00
Daniel Hahler 0385c27343 cacheprovider: do not write README/.gitignore to existing dir
Fixes https://github.com/pytest-dev/pytest/issues/4393.
2018-11-14 22:09:09 +01:00
Bruno Oliveira e025974cbd Merge remote-tracking branch 'upstream/master' into release-4.0.0 2018-11-13 20:58:24 +00:00
Bruno Oliveira fea09cda6c
Merge pull request #4383 from nicoddemus/merge-master-into-features
Merge master into features (about to prepare 4.0)
2018-11-13 18:57:41 -02:00
Daniel Hahler a72eff5a08
Merge pull request #4382 from blueyed/pytester-pop-TOX_ENV_DIR
pytester: pop TOX_ENV_DIR from os.environ
2018-11-13 12:42:51 +01:00
Bruno Oliveira 557cb6cffe Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-11-13 09:01:37 -02:00
Daniel Hahler a6a96469ca pytester: pop TOX_ENV_DIR from os.environ
Closes: https://github.com/pytest-dev/pytest/pull/4378
Fixes: https://github.com/pytest-dev/pytest/issues/4366
2018-11-13 09:02:52 +01:00
Daniel Hahler 27dab4e05f Fix CallInfo.__repr__ for unfinished call
Fixes https://github.com/pytest-dev/pytest/issues/3554
Ref: https://github.com/pytest-dev/pytest/pull/3560
Ref: https://github.com/pytest-dev/pytest/pull/3562
2018-11-13 08:51:43 +01:00
Bruno Oliveira f8f22d29ee Use a custom cache directory for test_stepwise tests
Otherwise the tests will use tox's env cache which makes them flaky
2018-11-12 16:57:39 -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 be15ad8d25 Fix collection of direct symlinked files not in python_files
Fixes https://github.com/pytest-dev/pytest/issues/4325.
2018-11-11 01:37:06 +01:00
Daniel Hahler f551cb9677 Skip Instances with --collect-only 2018-11-10 23:48:02 +01:00
Daniel Hahler 87254ca593 Add test for --deselect without "::()"
Closes: https://github.com/pytest-dev/pytest/issues/4127.
2018-11-10 23:46:41 +01:00
Daniel Hahler ac8b9c6e9d Node: do not add "::()" to nodeid
Fixes https://github.com/pytest-dev/pytest/issues/4127.
2018-11-10 23:46:41 +01:00
Daniel Hahler b51c1c3b8d tests: fix equal_with_bash for .coverage files
Fixes https://github.com/pytest-dev/pytest/issues/4162.
2018-11-10 03:24:02 +01: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 1b260a844f Merge branch 'master' into features 2018-11-09 12:49:55 +01:00
Bruno Oliveira e00f3a2fb7
Merge pull request #4353 from blueyed/test_fileimport
tests: test_fileimport: improve reporting on failure
2018-11-09 08:32:49 -02:00
Daniel Hahler a507f44465 cache_dir: use $TOX_ENV_DIR/ prefix if set
Fixes https://github.com/pytest-dev/pytest/issues/4270
2018-11-09 05:29:28 +01:00
Daniel Hahler 4a74d455de minor: typos 2018-11-09 02:03:44 +01:00
Daniel Hahler a0890f98d8 tests: harden test_config_error 2018-11-09 01:31:53 +01:00
Daniel Hahler b494d3d1c1 tests: test_fileimport: improve reporting on failure 2018-11-09 01:17:36 +01:00
Bruno Oliveira 423e19909e
Merge pull request #4307 from fzarifian/fzarifian-pr4304
#4304 the stepwise plugin must be blocked on cacheprovider plugin block request
2018-11-08 20:42:04 -02:00