Compare commits

...

1586 Commits
3.5.0 ... 4.0.2

Author SHA1 Message Date
Bruno Oliveira
6c5a1150d4 Preparing release version 4.0.2 2018-12-13 23:37:51 +00:00
Bruno Oliveira
e03c1f538f Merge pull request #4540 from asottile/type_error_falsey_match_value
Raise `TypeError` for `with raises(..., match=<non-None falsey value>)`.
2018-12-13 06:01:44 -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
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
Bruno Oliveira
22345ef722 Merge pull request #4525 from blueyed/fix-test_raises_exception_looks_iterable
tests: fix test_raises_exception_looks_iterable
2018-12-10 15:29:18 -02: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
abb0dfcfa3 Merge pull request #4523 from blueyed/addopts-separate
Ensure that PYTEST_ADDOPTS and addopts ini values are valid by themselves.
2018-12-10 01:43:04 +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
Ronny Pfannschmidt
818aa4d343 Merge pull request #4509 from Tadaboody/doc_doctest_fixture_pitfall_1495
Document doctest fixture pitfalls
2018-12-05 15:40:45 +01:00
Tomer Keren
b7a64d6729 Create changelog file for 1495 2018-12-05 11:29:32 +02:00
Tomer Keren
cb52d17d07 Document doctest fixture pitfalls 2018-12-05 11:25:52 +02:00
Bruno Oliveira
60599b667e Merge pull request #4505 from yashtodi94/patch-1
Rectified typo
2018-12-04 12:23:31 -02:00
Yash Todi
db32949c50 Rectified typo 2018-12-04 19:33:13 +05:30
Ronny Pfannschmidt
86ccfaec22 Merge pull request #4503 from asottile/upgrade
Upgrade sphinx doc requirements
2018-12-04 07:49:07 +01:00
Anthony Sottile
ae92b8c624 Upgrade sphinx doc requirements 2018-12-03 15:30:45 -08:00
Anthony Sottile
99d3fe22dc Merge pull request #4501 from s0undt3ch/master
Test case for #4500 and respective fix #4487
2018-12-03 09:11:00 -08:00
Pedro Algarvio
6da8befc74 Black suggestions 2018-12-03 12:58:22 +00:00
Pedro Algarvio
c1bdb07b2f Fix change log entry 2018-12-03 12:17:14 +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
Daniel Hahler
ecc5c84c1e Merge pull request #4487 from s0undt3ch/master
Logging done late enough might happen when capture already stopped.
2018-12-02 12:10:00 +01:00
Pedro Algarvio
f792cc420c Add changelog entry 2018-12-01 21:40:11 +00:00
Pedro Algarvio
f4d3ec6370 Logging done late enough might happen when capture already stopped. 2018-12-01 21:40:11 +00:00
Bruno Oliveira
d8e00c983e Merge pull request #4465 from nicoddemus/appveyor-retry
[skip travis] Use retry script on AppVeyor
2018-11-26 12:54:02 -02:00
Bruno Oliveira
b00b715cb6 [skip travis] Use retry script on AppVeyor
Fix #4387
2018-11-26 11:35:34 -02:00
Bruno Oliveira
d05b30ce11 Merge pull request #4462 from asottile/bump_pygments_pytest
Bump pygments-pytest
2018-11-25 00:01:06 -02:00
Anthony Sottile
2eac1bfcb8 Bump pygments-pytest 2018-11-24 17:25:53 -08:00
Bruno Oliveira
91b25c4dec Merge pull request #4461 from asottile/fix_rtd
Fix rtd by installing pygments-pytest
2018-11-24 21:24:52 -02:00
Anthony Sottile
d219e033e9 Fix rtd by installing pygments-pytest 2018-11-24 14:48:12 -08:00
Anthony Sottile
3d8d04c6f8 Merge pull request #4456 from asottile/pygments_pytest
Highlight docs with pygments-pytest
2018-11-24 07:32:51 -08:00
Bruno Oliveira
8facf1db90 Merge pull request #4457 from nicoddemus/test-request-garbage
Try to fix/improve reporting of test_request_garbage
2018-11-24 10:08:44 -02: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
7015801377 Highlight docs with pygments-pytest 2018-11-23 22:01:30 -08: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
Bruno Oliveira
f75f2117d0 Merge pull request #4450 from nicoddemus/release-4.0.1
Release version 4.0.1
2018-11-23 23:21:49 -02: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
Bruno Oliveira
16b15af624 Preparing release version 4.0.1 2018-11-23 20:09:57 +00:00
Bruno Oliveira
23e4447922 Merge pull request #4399 from blueyed/summary
Display "short test summary info" after (main) warnings again
2018-11-23 18:06:40 -02: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
9424d88843 Merge pull request #4427 from RonnyPfannschmidt/fix-4425
fix 4425: resolve --basetemp to absolute paths
2018-11-22 17:10:10 -02:00
Bruno Oliveira
d471ecc4d8 Add changelog entry 2018-11-22 14:45:50 -02: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
Ronny Pfannschmidt
2c45bc3019 Merge pull request #4437 from asottile/consistency_errors_red
Color the setup ERROR red
2018-11-22 12:00:07 +01:00
Anthony Sottile
664257c7a3 Color the setup ERROR red 2018-11-22 00:20:13 -08:00
Anthony Sottile
b3700f61ba Fix formatting of print() calls 2018-11-22 00:15:14 -08:00
Bruno Oliveira
3eaa6d8835 Merge pull request #4433 from 3lnc/doc_explicit_multimarker
Adds note on multiple module marker usage
2018-11-21 20:51:29 -02:00
Bruno Oliveira
f1fe9e41ac Mention PR# in the comment for future reference 2018-11-21 20:49:17 -02:00
Bruno Oliveira
4f5c153d29 Fix call to os.path.abspath: the argument might already be a Path instance
There's Path.absolute(), but it is not public, see https://bugs.python.org/issue25012.
2018-11-21 20:46:08 -02:00
Slam
ee4f8c98a9 Adds note on multiple module marker usage 2018-11-21 14:37:28 +02:00
Bruno Oliveira
f180ab3e69 Use os.path.abspath to get absolute path instead of Path.resolve()
Unfortunately it seems there is a difference in resolve() behavior depending
on the platform
2018-11-20 20:08:01 -02:00
Ronny Pfannschmidt
fc61bdd907 fix 4425: resolve --basetemp to absolute paths 2018-11-20 16:14:50 +01:00
Ronny Pfannschmidt
45c33c4e05 Merge pull request #4379 from hoylemd/improve_minversion_again
Use packaging/pkg_resources to check minversion
2018-11-19 21:38:45 +01:00
Michael D. Hoyle
1568e38997 Use pkg_resources.parse_version in minver check
Use pkg_resources.parse_version in minver check

Add meself to AUTHORS & changelog

Format CHANGELOG
2018-11-19 11:25:27 -05:00
Anthony Sottile
a281d6620b Merge pull request #4417 from blueyed/tox-mock
tox.ini: remove additionally missed mock deps
2018-11-18 12:06:59 -08:00
Daniel Hahler
c56cc93cbd tox.ini: remove additionally missed mock deps
Ref: https://github.com/pytest-dev/pytest/pull/4415#discussion_r234452144
2018-11-18 19:37:04 +01:00
Daniel Hahler
cdbe2299ec Merge pull request #4409 from blueyed/str
Add Testdir.__str__ to return str(self.tmpdir)
2018-11-18 12:52:31 +01:00
Ronny Pfannschmidt
5c24430555 Merge pull request #4415 from blueyed/extras-testing
setup.py: add "testing" extra requirement
2018-11-18 12:16:06 +01:00
Daniel Hahler
e46f995cc7 setup.py: add "testing" extra requirement
Use this in tox to stream-line base testing requirements.

Closes https://github.com/pytest-dev/pytest/issues/4410.
2018-11-18 08:55:17 +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
Daniel Hahler
7f990e2b9a Merge pull request #4408 from blueyed/default-invalid-escape-sequence
tox.ini: do not cause SyntaxWarning with py37  [ci skip]
2018-11-17 20:08:37 +01:00
Anthony Sottile
690a63b921 Fix assertion rewriting involving Starred + side-effects 2018-11-17 10:42:51 -08:00
Daniel Hahler
4c9cde74ab Merge pull request #4411 from blueyed/fix-testpaths-with-pyargs
Fix collection of testpaths with `--pyargs`.
2018-11-17 17:20:29 +01:00
Ronny Pfannschmidt
94e5bdd4e0 Merge pull request #4413 from blueyed/tox-posargs
tox: fix/improve posargs with pexpect factor(s)  [ci skip]
2018-11-17 17:18:31 +01:00
Daniel Hahler
cb1d4044e6 tox: fix/improve posargs with pexpect factor(s) [ci skip] 2018-11-17 15:35:40 +01: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
Daniel Hahler
3acfa3abdc Add Testdir.__str__ to return str(self.tmpdir)
I just expected this with `monkeypatch.setenv("PYTHONPATH", str(testdir))`,
wondering why it was not picked up correctly.
`
2018-11-17 13:18:54 +01:00
Daniel Hahler
084c36d538 tox.ini: do not cause SyntaxWarning with py37 [ci skip]
Do not cause a SyntaxError for something like:

> DeprecationWarning: invalid escape sequence \w

This was happening via pdb++ when it imported pygments (and that had no
compiled .pyc file).
2018-11-17 11:53:15 +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
9dec146edf Merge pull request #4388 from nicoddemus/release-4.0.0
Release 4.0.0
2018-11-14 15:11:09 -02:00
Bruno Oliveira
c2d6b3524c Preparing release version 4.0.0 2018-11-13 21:01:51 +00: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
b7863a5f48 Merge pull request #4381 from blueyed/callinfo-repr
Fix CallInfo.__repr__ for unfinished call
2018-11-13 18:13:58 +01: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
Daniel Hahler
46c8363e12 Merge pull request #4380 from blueyed/improve-ci
Travis: move faster builds to baseline
2018-11-13 12:40:26 +01: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
8198e7cd33 Merge pull request #4349 from nicoddemus/pytest4-warnings-as-errors
Change RemovedInPytest4Warnings to errors by default
2018-11-13 08:31:47 -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
Daniel Hahler
3e05848ab9 AppVeyor: run py{27,37}-xdist first 2018-11-13 01:33:05 +01:00
Daniel Hahler
5902e5a2ce Travis: move faster builds to baseline
- use py27-pexpect,py27-trial,py27-numpy and py37-xdist in baseline,
  using pexpect there catches errors with pdb tests early, and
  py37-xdist is much faster than py37.
- move py34 and py36 out of baseline.
2018-11-13 01:26:22 +01:00
Bruno Oliveira
243d898b38 Merge pull request #4373 from blueyed/py37-by-default
CI: use py37 instead of py36 by default
2018-11-12 20:56:10 -02: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
Bruno Oliveira
3cec1482eb Merge branch 'master' into py37-by-default 2018-11-12 14:03:59 -02:00
Bruno Oliveira
0df5ce4082 Fix basepython for linting testenv in tox.ini 2018-11-12 14:03:04 -02:00
Bruno Oliveira
93a9836962 Merge pull request #4374 from blueyed/doctesting
CI: doctesting uses coverage, fiy py37 on AppVeyor
2018-11-12 13:57:58 -02:00
Daniel Hahler
935b106213 CI: use py37 instead of py36 by default
Closes https://github.com/pytest-dev/pytest/issues/4370.
2018-11-12 03:16:52 +01:00
Daniel Hahler
74366426b9 Travis: use last TOXENV for PATH 2018-11-11 22:08:45 +01:00
Daniel Hahler
9628242423 CI: doctesting uses coverage, fiy py37 on AppVeyor 2018-11-11 21:49:59 +01:00
Bruno Oliveira
9af613bef2 Merge pull request #4372 from nicoddemus/release-3.10.1
Release version 3.10.1
2018-11-11 15:35:21 -02:00
Bruno Oliveira
7b833ce5f9 Merge pull request #4368 from blueyed/toxenv-coverage
Travis: use coverage from existing tox env  [skip appveyor]
2018-11-11 11:57:20 -02:00
Bruno Oliveira
11a9cbd50b Merge pull request #4365 from blueyed/xenial
Travis: use Xenial by default  [skip appveyor]
2018-11-11 11:55:06 -02:00
Bruno Oliveira
2626bd9afa Preparing release version 3.10.1 2018-11-11 13:43:04 +00:00
Bruno Oliveira
b6f16abfe0 Merge pull request #4369 from blueyed/cleanup
Cleanup/follow-up to #4319
2018-11-11 11:38:06 -02:00
Bruno Oliveira
e5a9f92dfb Merge pull request #4337 from blueyed/fix-sym
Fix collection of symlinked files
2018-11-11 11:36:31 -02:00
Daniel Hahler
a6ff5e6bfc Cleanup/follow-up to #4319 2018-11-11 01:38:34 +01: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
dc9ceda5d2 Travis: use Xenial by default [skip appveyor] 2018-11-11 01:02:06 +01:00
Daniel Hahler
825085f699 Travis: use coverage from existing tox env [skip appveyor] 2018-11-11 00:59:46 +01:00
Daniel Hahler
b1312147e0 Merge pull request #4358 from blueyed/instance
Node: do not add "::()" to nodeid
2018-11-11 00:42:57 +01:00
Daniel Hahler
7ab3d818f0 Merge pull request #4356 from blueyed/fix-equal_with_bash
tests: fix equal_with_bash to handle appearing .coverage files
2018-11-11 00:42:23 +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
e14ca19988 Merge pull request #4352 from blueyed/_check_initialpaths_for_relpath
Fix nodes._check_initialpaths_for_relpath for dirs
2018-11-10 03:18:36 +01:00
Ronny Pfannschmidt
10d27f412b Merge pull request #4360 from blueyed/merge-master
Merge master into features
2018-11-09 17:26:40 +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
b92530de78 Merge pull request #4271 from blueyed/pytest_cache
cache_dir: use $TOX_ENV_DIR/ prefix if set
2018-11-09 09:09:45 +01:00
Daniel Hahler
afaad2f82b Merge pull request #4354 from blueyed/minor
A set of minor changes from my Git stashes
2018-11-09 08:25:17 +01: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
d4fdf793b5 Merge pull request #4350 from blueyed/fix-macos-py37
Travis: fix MacOS py37 build
2018-11-09 02:05:47 +01:00
Daniel Hahler
feccf532d2 doc: improve runpytest_subprocess 2018-11-09 02:03:44 +01:00
Daniel Hahler
859b322773 doc: improve/simplify doc for breakpoint behavior 2018-11-09 02:03:44 +01:00
Daniel Hahler
4a74d455de minor: typos 2018-11-09 02:03:44 +01:00
Daniel Hahler
c1bde8e0a2 minor: check bool before function call 2018-11-09 01:37:51 +01:00
Daniel Hahler
560c055b09 Session._collect: use reversed parts 2018-11-09 01:36:20 +01:00
Daniel Hahler
a0890f98d8 tests: harden test_config_error 2018-11-09 01:31:53 +01:00
Daniel Hahler
401a3cd1bc minor: improve FixtureDef.__repr__
Ref: https://github.com/pytest-dev/pytest/pull/4105#pullrequestreview-163486766
2018-11-09 01:27:18 +01:00
Daniel Hahler
b494d3d1c1 tests: test_fileimport: improve reporting on failure 2018-11-09 01:17:36 +01:00
Daniel Hahler
6c06057242 Merge pull request #4336 from blueyed/cwd2
Fix/improve handling of chdir with no-args and testpaths
2018-11-09 00:38:34 +01:00
Daniel Hahler
bb8a8495ff Revert "Attempt to fix macosx build setup"
This reverts commit 28dbffdaf2.

Appears to be not necessary anymore:
https://travis-ci.org/pytest-dev/pytest/jobs/452598885#L906

[skip appveyor]
2018-11-09 00:33:52 +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
Daniel Hahler
f06fe43649 Merge pull request #4330 from blueyed/fix-report-last-write
Fix TypeError in report_collect with _collect_report_last_write
2018-11-08 21:06:17 +01:00
Daniel Hahler
3137c89cf1 Fix/improve handling of chdir with no-args and testpaths
Fixes https://github.com/pytest-dev/pytest/issues/4332.
2018-11-08 17:50:45 +01:00
Daniel Hahler
5dd509c963 Merge pull request #4338 from blueyed/merge-master
Merge master into features
2018-11-08 17:45:05 +01:00
Fabien ZARIFIAN
f48a26f59c Update AUTHORS 2018-11-08 08:12:08 +01:00
Daniel Hahler
9d838fa861 Merge branch 'master' into features
Conflicts:
	src/_pytest/main.py
2018-11-08 02:48:59 +01:00
Daniel Hahler
91404db284 Fix TypeError in report_collect with _collect_report_last_write
`_collect_report_last_write` might be None, when `pytest_collection` was
not called before.  Not sure if this indicates another problem, but it
can be reproduced with `testing/test_collection.py::TestCollector::()::test_getcustomfile_roundtrip`.

Fixes https://github.com/pytest-dev/pytest/issues/4329
2018-11-07 23:42:02 +01:00
Daniel Hahler
4c00552192 Merge pull request #4317 from blueyed/cwd
Handle os.chdir() during collection
2018-11-07 22:49:47 +01:00
Ronny Pfannschmidt
64762d2cfc Merge pull request #4319 from blueyed/harden-test_collect_init_tests
Fix handling of duplicate args with regard to Python packages
2018-11-07 21:48:54 +01:00
Bruno Oliveira
17b8e2d45b Fix linting 2018-11-07 18:32:23 -02:00
Bruno Oliveira
9a884f1ccb Improve changelog a bit 2018-11-07 18:30:13 -02:00
Daniel Hahler
827573c049 cleanup, TODO: use _node_cache 2018-11-07 20:14:07 +01:00
Daniel Hahler
6fce1f0ac7 pkg_roots per session 2018-11-07 20:06:35 +01:00
Daniel Hahler
bbb9d72c13 remove paths/parts 2018-11-07 19:36:19 +01:00
Daniel Hahler
f8b944dee0 pkg_roots 2018-11-07 19:35:25 +01:00
Daniel Hahler
f840521854 harden test_collect_init_tests 2018-11-07 19:29:55 +01:00
Daniel Hahler
134b103605 XXX: revert _collect_seen_pkgdirs 2018-11-07 11:01:39 +01:00
Daniel Hahler
fa35f650b5 Fix handling of duplicate args with regard to Python packages
Fixes https://github.com/pytest-dev/pytest/issues/4310.
2018-11-07 10:06:09 +01:00
Daniel Hahler
cb57159e01 Handle os.chdir() during collection 2018-11-05 23:18:47 +01:00
Bruno Oliveira
1752c7e710 Merge pull request #4314 from RonnyPfannschmidt/bestrelpath-cache-move-to-session
move Bestrelpath cache move to session
2018-11-05 17:51:49 -03:00
Anthony Sottile
176d27440c Merge pull request #4308 from asottile/compare_versions_with_loose_version
Don't string-compare version numbers
2018-11-05 12:42:26 -08:00
Bruno Oliveira
832b59b316 Merge pull request #4312 from Lothiraldan/patch-1
Add missing `-` in front of the new option `--sw`
2018-11-05 17:17:15 -03:00
Ronny Pfannschmidt
f521f5e012 move the _bestrelpathcache to session 2018-11-05 21:07:21 +01:00
Boris Feld
d42c490bc1 Add missing - in front of the new option --sw 2018-11-05 15:39:35 +01:00
Fabien ZARIFIAN
5f61f0d2cb Update __init__.py
As mentionned by @RonnyPfannschmidt, use set_blocked on module stepwise (and it's brother pytest_stepwise like consider_pluginarg method does)
2018-11-05 10:51:15 +01:00
Ronny Pfannschmidt
e253852e4b Merge pull request #4309 from asottile/less_unicode_hax
Use unicode/bytes literals instead of calls
2018-11-05 07:17:13 +01:00
Anthony Sottile
a4819844a4 Use unicode/bytes literals instead of calls 2018-11-04 17:43:24 -08:00
Anthony Sottile
db996335c8 Merge pull request #4302 from jdufresne/pypi
Update pypi.python.org reference to pypi.org
2018-11-04 17:32:56 -08:00
Anthony Sottile
85a3333824 Don't string-compare version numbers 2018-11-04 17:31:48 -08:00
Anthony Sottile
4bf6a07fe2 Merge pull request #4305 from RonnyPfannschmidt/cleanup-tobytes
replace byte/unicode helpers in test_capture with python level syntax
2018-11-04 17:29:41 -08:00
Fabien ZARIFIAN
db70c75807 Create 4304.bugfix.rst 2018-11-05 00:36:25 +01:00
Fabien ZARIFIAN
1793ac38a9 Update __init__.py 2018-11-05 00:21:12 +01:00
Bruno Oliveira
4aa3c4fa2b Merge pull request #4303 from blueyed/fix-changelog
doc: add lost changelog entry
2018-11-04 20:21:06 -03:00
Fabien ZARIFIAN
a447dc86fb Add test to branch 2018-11-05 00:14:35 +01:00
Ronny Pfannschmidt
7cb271b46f replace byte/unicode helpers in test_capture with python level syntax 2018-11-04 22:01:01 +01:00
Fabien ZARIFIAN
c55ca155e9 Update __init__.py
#4304
2018-11-04 21:55:56 +01:00
Ronny Pfannschmidt
5eb4016110 Merge pull request #4301 from nicoddemus/merge-master-into-features
Merge master into features
2018-11-04 20:23:33 +01:00
Daniel Hahler
34152445cf doc: add lost changelog entry
Closes https://github.com/pytest-dev/pytest/issues/4300.

[ci skip]
2018-11-04 18:26:09 +01:00
Jon Dufresne
5e0441d96e Update pypi.python.org reference to pypi.org 2018-11-04 09:02:54 -08:00
Bruno Oliveira
d1c9c54571 Merge pull request #4297 from nicoddemus/release-3.10.0
Release 3.10.0
2018-11-04 12:25:30 -03:00
Bruno Oliveira
bb2ed2f898 Merge pull request #4298 from blueyed/howto
doc: fix HOWTORELEASE.rst
2018-11-03 20:32:54 -03:00
Bruno Oliveira
3d88d1827b Fixed linting 2018-11-03 19:50:19 -03:00
Daniel Hahler
7b5f3fe83a doc: fix HOWTORELEASE.rst
Remove last step, because it was merged already before (changed in
77cad3c4).

[ci skip]
2018-11-03 21:26:08 +01:00
Daniel Hahler
f2b9bbdd4a Merge pull request #4287 from blueyed/pdb-unconfigure-twice
debugging: make pytest_configure re-entrant
2018-11-03 21:09:13 +01:00
Bruno Oliveira
c2e906ec97 Preparing release version 3.10.0 2018-11-03 13:51:39 +00:00
Bruno Oliveira
1ec6805112 Fix escape in code sample 2018-11-03 13:48:10 +00:00
Bruno Oliveira
6befdf8b46 Merge remote-tracking branch 'upstream/master' into release-3.10.0 2018-11-03 13:42:20 +00:00
Bruno Oliveira
4cb838d978 Merge pull request #4237 from boxed/master
Performance fixes
2018-11-03 10:39:29 -03:00
Daniel Hahler
e61e81a7b5 Make debugging's pytest_configure re-entrant
This is relevant when using runpytest in-process.

Fixes:

E             def test_1(testdir):
E                 testdir.runpytest()
E         >       __import__('pdb').set_trace()
E
E         ../../test_trace_after_runpytest.py:3:
E         …/Vcs/pytest/src/_pytest/debugging.py:81: in set_trace
E             tw = _pytest.config.create_terminal_writer(cls._config)
E
E         config = None, args = (), kwargs = {}, tw = <py._io.terminalwriter.TerminalWriter object at 0x7f1097088160>
E
E             def create_terminal_writer(config, *args, **kwargs):
E                 """Create a TerminalWriter instance configured according to the options
E                 in the config object. Every code which requires a TerminalWriter object
E                 and has access to a config object should use this function.
E                 """
E                 tw = py.io.TerminalWriter(*args, **kwargs)
E         >       if config.option.color == "yes":
E         E       AttributeError: 'NoneType' object has no attribute 'option'
2018-11-02 18:25:01 +01:00
Daniel Hahler
023e1c78df paths: use set and isdisjoint
Time: 5.36s => 4.85s (before rebase: 4.45s => 3.55s)
2018-11-02 17:43:04 +01:00
Daniel Hahler
6ffa347c77 Handle dirs only once
Time: 5.73s/5.88s => 5.36s

(Before rebase: 4.86s => 4.45s)
2018-11-02 17:43:04 +01:00
Anders Hovmöller
2b50911c9d Minor refactor for readability
Time: 5.73s => 5.88s/5.82s
2018-11-02 17:42:53 +01:00
Anders Hovmöller
a41820fbf0 collection: performance: use optimized parts function
Time: 8.53s => 5.73s
2018-11-02 17:42:53 +01:00
Bruno Oliveira
21725e9304 Merge pull request #4285 from kchmck/fix-4046
Fix problems with running tests in package `__init__` files (#4046)
2018-11-02 08:26:07 -03:00
Bruno Oliveira
48f52b1be0 Merge pull request #4279 from williamjamir/improve-warning-msg
Improve the warning message for the implicitly str conversion
2018-11-02 08:22:15 -03:00
Daniel Hahler
a5b3ad2e45 Merge pull request #4284 from blueyed/test-dunder-class
python: collect: ignore exceptions with isinstance
2018-11-01 22:15:29 +01:00
Daniel Hahler
e30f7094f3 python: collect: ignore exceptions with isinstance
Fixes https://github.com/pytest-dev/pytest/issues/4266.
2018-11-01 22:14:13 +01:00
Mick Koch
5197354375 Add changelog entry 2018-11-01 13:13:33 -04:00
Mick Koch
5ac4eff09b Fix __init__.py as argument also including other package files 2018-11-01 13:10:52 -04:00
Mick Koch
320e41b142 Add failing test for __init__.py also including other package files 2018-11-01 13:10:52 -04:00
Mick Koch
70976b04be Add test for __init__.py collection with package directory as argument 2018-11-01 13:10:17 -04:00
Daniel Hahler
d65f300988 Move handling of duplicate files
This removes the hack added in https://github.com/pytest-dev/pytest/pull/3802.

Adjusts test:

- it appears to not have been changed to 7 intentionally.
- removes XXX comment, likely not relevant anymore since 6dac7743.
2018-11-01 13:06:36 -04:00
Anthony Sottile
948fd7b8b0 fixup pyupgrade crlf incorrect fixes 2018-11-01 08:40:35 -07:00
Bruno Oliveira
f2cebce2eb Merge pull request #4272 from blueyed/cache-non-default
cacheprovider: display cachedir also in non-verbose mode if customized
2018-11-01 12:19:21 -03:00
Daniel Hahler
a192e6b430 Merge pull request #4247 from blueyed/lru
_getconftestmodules: use functools.lru_cache
2018-11-01 15:55:38 +01:00
Daniel Hahler
f8a2452247 changelog [ci skip] 2018-11-01 15:53:31 +01:00
Bruno Oliveira
56e6bb0ff6 Merge pull request #4282 from avallbona/patch-1
Update talks.rst
2018-10-31 22:33:45 -03:00
Bruno Oliveira
017e504a11 Merge pull request #4277 from blueyed/pdb-set_trace-capture-msg
pdb: improve msg about output capturing with set_trace
2018-10-31 21:48:47 -03:00
Andreu Vallbona Plazas
9871d5ec2d Updated the talks.rst
corrected the target name
2018-11-01 01:24:18 +01:00
Bruno Oliveira
642521a9b3 Merge pull request #4281 from asottile/bump_hooks
Upgrade pyupgrade for crlf fixes (again)
2018-10-31 20:58:05 -03:00
Bruno Oliveira
0994829afe Move pytest talk to the start of the section 2018-10-31 19:35:47 -03:00
Daniel Hahler
ce1cc3dddb _getconftestmodules: use functools.lru_cache
Also renames `_path2confmods` to `_dirpath2confmods` for clarity (it is
expected to be a dirpath in `_importconftest`).

Uses an explicit maxsize, since it appears to be only relevant for a
short period [1].

Removes the lru_cache on _getconftest_pathlist, which makes no
difference when caching _getconftestmodules, at least with the
performance test of 100x10 files (#4237).

1: https://github.com/pytest-dev/pytest/pull/4237#discussion_r228528007
2018-10-31 23:17:05 +01:00
Daniel Hahler
65817dd797 changelog [ci skip] 2018-10-31 23:13:25 +01:00
Andreu Vallbona Plazas
c31abb1176 Update talks.rst
Added the slides of a PyconES 2017 talk about pytest and its plugins ecosystem.
2018-10-31 23:06:44 +01:00
Bruno Oliveira
d4ca634ef6 Fix linting 2018-10-31 18:21:55 -03:00
Anthony Sottile
af00367fed Upgrade pyupgrade for crlf fixes (again) 2018-10-31 13:26:49 -07:00
William Jamir Silva
9b94313b44 Update changelog 2018-10-31 17:12:50 -03:00
William Jamir Silva
5404246e64 Improve the warning message for the implicitly str conversion
Signed-off-by: William Jamir Silva <williamjamir@gmail.com>
2018-10-31 16:19:10 -03:00
Daniel Hahler
e0038b82f7 pdb: improve msg about output capturing with set_trace
Do not display "IO-capturing turned off/on" when ``-s`` is used to avoid
confusion.
2018-10-31 17:09:01 +01:00
Bruno Oliveira
0fea71a4f5 Merge pull request #4164 from RonnyPfannschmidt/nowarn-session-attributes
don`t parse compat properties as fixtures
2018-10-31 12:52:52 -03:00
Bruno Oliveira
7571f079c8 Merge pull request #4276 from pfctdayelise/flaky-docs
Add docs page discussing flaky tests
2018-10-31 11:25:27 -03:00
Bruno Oliveira
b5d62cdb55 Update 2701.bugfix.rst 2018-10-31 11:07:24 -03:00
Bruno Oliveira
cc25256982 Fix linting2 2018-10-31 11:05:58 -03:00
Ronny Pfannschmidt
da04ff52e4 ignore _CompatProperty when parsing fixtures
this avoid triggering the warnings when parsing the session node as session plugin
2018-10-31 15:01:41 +01:00
Bruno Oliveira
d5b5be6fbe Fix linting 2018-10-31 10:44:43 -03:00
Brianna Laugher
3b65d190a4 Add docs page discussing flaky tests 2018-10-31 23:45:09 +11:00
Daniel Hahler
ff04a1fb09 Merge pull request #4267 from nicoddemus/tmpdir-4262
Fix access denied error when deleting a stale temporary directory
2018-10-31 00:25:13 +01:00
Daniel Hahler
1f1d4aaf68 cacheprovider: display cachedir also in non-verbose mode if customized 2018-10-30 23:09:54 +01:00
Anthony Sottile
196a739f58 Merge pull request #4269 from asottile/upgrade_hooks
Upgrade pre-commit hooks
2018-10-30 14:06:19 -07:00
Bruno Oliveira
f20eeebde9 Fix access denied error when deleting a stale temporary directory
Fix #4262
2018-10-30 15:35:53 -03:00
Anthony Sottile
b17e6cea21 Upgrade pre-commit hooks 2018-10-30 11:02:44 -07:00
Bruno Oliveira
233c2a23de Merge pull request #4250 from blueyed/ignore-pyc
collection: _recurse: skip __pycache__
2018-10-30 08:25:57 -03:00
Bruno Oliveira
46ec0ec43a Merge pull request #4264 from scop/spelling2
Spelling and grammar fixes
2018-10-30 08:24:01 -03:00
Ville Skyttä
a035c89ea7 Spelling fix 2018-10-30 09:38:55 +02:00
Daniel Hahler
40228fce5a collection: _recurse: skip __pycache__ 2018-10-30 02:34:32 +01:00
Anthony Sottile
f258b75a24 Merge pull request #4261 from asottile/no_anonymous_source_warning
Swallow warnings during anonymous compilation of source
2018-10-29 18:29:53 -07:00
Ville Skyttä
22ab737243 Spelling and grammar fixes 2018-10-29 23:45:45 +02:00
Anthony Sottile
0d1f142b1c Swallow warnings during anonymous compilation of source 2018-10-29 08:38:10 -07:00
Anthony Sottile
8c475a45bb Unrelated cleanups of source.py 2018-10-28 16:43:17 -07:00
Bruno Oliveira
e6e40db9c7 Merge pull request #4258 from pecey/tmp/issue-4255
Fixes #4255 by adding to the doc that module names are not regex-escaped
2018-10-28 09:44:13 -03:00
Ronny Pfannschmidt
cc531a1ca9 Merge pull request #4253 from nicoddemus/merge-master-into-features
Merge master into features
2018-10-28 10:13:08 +01:00
Palash Chatterjee
c3acf049bd Fixes #4255 by adding to the documentation that module names are not regex-escaped 2018-10-28 10:45:34 +05:30
Bruno Oliveira
bab1ef5d38 Merge pull request #4257 from Bernardoow/changed_address_to_pytest-datadir
changed address to pytest-data-dir
2018-10-27 17:16:32 -03:00
Bernardo Gomes
b0c0911ba3 changed address to pytest-data-dir 2018-10-27 14:31:50 -03:00
Bruno Oliveira
3b7fbcd47f Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-27 14:29:01 -03:00
Bruno Oliveira
9ef23b686c Merge pull request #4252 from nicoddemus/release-3.9.3
Preparing release version 3.9.3
2018-10-27 13:36:42 -03:00
Bruno Oliveira
96784c2052 Preparing release version 3.9.3 2018-10-27 13:07:54 +00:00
Ronny Pfannschmidt
9fe871016d Merge pull request #4147 from davidszotten/stepwise
Stepwise
2018-10-27 15:05:05 +02:00
Bruno Oliveira
e986d06ade Merge pull request #4251 from blueyed/python-collect
python: collect: revisit
2018-10-27 10:02:23 -03:00
Bruno Oliveira
ebba3ebe67 Merge pull request #4240 from RonnyPfannschmidt/perf-example-collect-files
add script to generate a example folder for collecting many files
2018-10-26 19:19:02 -03:00
Ankit Goel
1d09e1d8ce Merge pull request #4248 from jdufresne/binary-type
Remove use of unnecessary compat shim, six.binary_type
2018-10-27 00:03:16 +05:30
Bruno Oliveira
d59786fcc4 Merge pull request #4222 from RonnyPfannschmidt/pathlib-fixes
handle race condition when creation and deletion of a numbered dir overlap
2018-10-26 14:36:43 -03:00
Ankit Goel
af34164858 Fix changelog file extension 2018-10-26 22:03:57 +05:30
Daniel Hahler
dcdf86ef5b python: collect: revisit 2018-10-26 16:06:37 +02:00
Jon Dufresne
167e9b954a Remove use of unnecessary compat shim, six.binary_type
The type `bytes` is available on all supported Python versions. On
Python 2.7, it is an alias of str, same as six.binary_type.

Makes the code slightly more forward compatible.
2018-10-26 06:27:50 -07:00
Daniel Hahler
9cde67c09c Merge pull request #4224 from blueyed/_getconftestmodules
_getconftestmodules: avoid isfile()/dirpath()
2018-10-26 14:44:46 +02:00
Ronny Pfannschmidt
ae2fc27799 handle test folder cleanup being unable to create a cleanup lock 2018-10-26 14:31:54 +02:00
Bruno Oliveira
56989a8350 Merge pull request #4244 from RonnyPfannschmidt/fix-4243
fix #4243 - support positional argument stacklevel on python2
2018-10-26 08:09:33 -03:00
Bruno Oliveira
8d0e1a99e4 Merge pull request #4241 from blueyed/move-duplicates
Move handling of duplicate files
2018-10-26 08:07:48 -03:00
Ronny Pfannschmidt
ce0b0518c7 fix #4243 - support positional argument stacklevel on python2 2018-10-26 09:01:25 +02:00
Ronny Pfannschmidt
bf19917537 Merge pull request #4242 from pytest-dev/merge-master
merge master into features
2018-10-26 07:21:59 +02:00
Anthony Sottile
777e9e1e17 Merge remote-tracking branch 'origin/master' into merge-master 2018-10-25 18:00:39 -07:00
Ronny Pfannschmidt
bfa1993840 add script to generate a example folder for collecting many files 2018-10-25 22:07:20 +02:00
Daniel Hahler
e041823643 Move handling of duplicate files
This removes the hack added in https://github.com/pytest-dev/pytest/pull/3802.

Adjusts test:

- it appears to not have been changed to 7 intentionally.
- removes XXX comment, likely not relevant anymore since 6dac7743.
2018-10-25 20:48:08 +02:00
Daniel Hahler
63691f5656 _getconftestmodules: avoid isfile()/dirpath()
Ref: https://github.com/pytest-dev/pytest/issues/2206#issuecomment-432623646
2018-10-25 20:25:07 +02:00
Daniel Hahler
6dc575f5ee Merge pull request #4239 from blueyed/lru_cache
Move lru_cache wrapper to compat
2018-10-25 20:09:01 +02:00
Daniel Hahler
0dc6cb298e Move lru_cache wrapper to compat
Ref: https://github.com/pytest-dev/pytest/pull/4227#discussion_r228060373
2018-10-25 18:20:36 +02:00
Bruno Oliveira
041044eef0 Merge pull request #4238 from asottile/cl
Add a changelog for #4235 [ci skip]
2018-10-25 13:14:05 -03:00
Anthony Sottile
1af31a09f4 Add a changelog for #4235 [ci skip] 2018-10-25 09:09:25 -07:00
Daniel Hahler
f466105d66 Merge pull request #2619 from blueyed/pdb-resume-capture
pdb: resume capturing after `continue`
2018-10-25 14:28:47 +02:00
Bruno Oliveira
ccdb248397 Merge pull request #4235 from asottile/reorder_python_imports
Apply reorder-python-imports to all files
2018-10-25 08:37:40 -03:00
Daniel Hahler
ede3a4e850 pytest_{enter,leave}_pdb: pass through pdb instance 2018-10-25 13:28:24 +02:00
Daniel Hahler
a4ea66cb1f pdb: resume capturing after continue
After `pdb.set_trace()` capturing is turned off.
This patch resumes it after using the `continue` (or `c` / `cont`)
command.

Store _pytest_capman on the class, for pdbpp's do_debug hack to keep it.

Without this, `debug …` would fail like this:

    /usr/lib/python3.6/cmd.py:217: in onecmd
        return func(arg)
    .venv/lib/python3.6/site-packages/pdb.py:608: in do_debug
        return orig_do_debug(self, arg)
    /usr/lib/python3.6/pdb.py:1099: in do_debug
        sys.call_tracing(p.run, (arg, globals, locals))
    /usr/lib/python3.6/bdb.py:434: in run
        exec(cmd, globals, locals)
    /usr/lib/python3.6/bdb.py:51: in trace_dispatch
        return self.dispatch_line(frame)
    /usr/lib/python3.6/bdb.py:69: in dispatch_line
        self.user_line(frame)
    /usr/lib/python3.6/pdb.py:261: in user_line
        self.interaction(frame, None)
    .venv/lib/python3.6/site-packages/pdb.py:203: in interaction
        self.setup(frame, traceback)
    E   AttributeError: 'PytestPdb' object has no attribute '_pytest_capman'

- add pytest_leave_pdb hook
- fixes test_pdb_interaction_capturing_twice: would fail on master now,
  but works here
2018-10-25 13:28:24 +02:00
Anthony Sottile
2368fbb63c Apply reorder-python-imports to all files 2018-10-25 00:01:29 -07:00
Ronny Pfannschmidt
f6dfca7182 Merge pull request #4229 from nicoddemus/fix-warning-location
Show node that originated a warning in the warnings summary
2018-10-25 08:26:01 +02:00
Ronny Pfannschmidt
65b97c2f41 Merge pull request #4227 from blueyed/_getconftest_pathlist-lru
Use functools.lru_cache with _getconftest_pathlist
2018-10-25 08:12:51 +02:00
Bruno Oliveira
4a69104af3 Merge pull request #4232 from blueyed/fix-doc-caplog
doc: fix caplog: s/methods/properties/
2018-10-24 19:27:30 -03:00
Bruno Oliveira
1786ad16a7 functools.lru_cache does not exist on Python 2, apply for Python 3 only 2018-10-24 18:59:54 -03:00
Daniel Hahler
2cf4c67e45 doc: fix caplog: s/methods/properties/ 2018-10-24 23:57:11 +02:00
Bruno Oliveira
2ad43ee442 Show node that originated a warning in the warnings summary
Fix #4221
2018-10-24 18:49:53 -03:00
Daniel Hahler
15278aacb9 Merge pull request #4231 from blueyed/fix-master
Fix flake8: os imported, but unused
2018-10-24 23:47:46 +02:00
Daniel Hahler
57caa4e25e Fix flake8: os imported, but unused
Likely due to b6fa4e24.
2018-10-24 23:43:41 +02:00
Daniel Hahler
66ce952da6 Merge pull request #4228 from blueyed/merge-master
Merge master into features
2018-10-24 23:04:52 +02:00
Bruno Oliveira
b6fa4e248f Merge pull request #4028 from asottile/revert_breakpoint_code
Revert patching of breakpointhook as it appears to do nothing
2018-10-24 17:50:19 -03:00
Daniel Hahler
eee8201e4f Merge remote-tracking branch 'origin/master' into merge-master 2018-10-24 22:36:34 +02:00
Daniel Hahler
e690e191fd Merge pull request #4225 from blueyed/collect-performance
TerminalWriter: write "collecting" msg only once every 0.5s
2018-10-24 22:35:53 +02:00
Daniel Hahler
d40cd3ec6b Use functools.lru_cache with _getconftest_pathlist
For pytest's own suite the `cache_info()` looks as follows:

    > session.config._getconftest_pathlist.cache_info()
    CacheInfo(hits=231, misses=19, maxsize=None, currsize=19)

While it does not really make a difference for me this might help with
larger test suites / the case mentioned in
https://github.com/pytest-dev/pytest/issues/2206#issuecomment-432623646.
2018-10-24 18:22:30 +02:00
Daniel Hahler
9df1b037d6 Merge pull request #4217 from nicoddemus/fix-macos-py37-travis
Fix MacOS py37 on Travis
2018-10-24 17:51:49 +02:00
Bruno Oliveira
28dbffdaf2 Attempt to fix macosx build setup
This has been failing as of 2018-10-23 while installing gcc with
this message:

	==> Installing numpy dependency: gcc
	==> Downloading https://homebrew.bintray.com/bottles/gcc-8.2.0.high_sierra.bottl
	######################################################################## 100.0%
	==> Pouring gcc-8.2.0.high_sierra.bottle.1.tar.gz
	Error: The `brew link` step did not complete successfully
	The formula built, but is not symlinked into /usr/local
	Could not symlink include/c++
	Target /usr/local/include/c++
	already exists. You may want to remove it:
	  rm '/usr/local/include/c++'
	To force the link and overwrite all conflicting files:
	  brew link --overwrite gcc
	To list all files that would be deleted:
	  brew link --overwrite --dry-run gcc
	Possible conflicting files are:
	/usr/local/include/c++ -> /usr/local/Caskroom/oclint/0.13.1,17.4.0/oclint-0.13.1/include/c++
2018-10-24 12:46:45 -03:00
Daniel Hahler
f8f4c16020 TerminalWriter: write "collecting" msg only once every 0.1s
Running `pytest -k doesnotmatch` on pytest's own tests takes ~3s with
Kitty terminal for me, but only ~1s with `-q`.
It also is faster with urxvt, but still takes 2.2s there.

This patch only calls `report_collect` every 0.1s, which is good enough
for reporting collection progress, and improves the time with both Kitty
and urxvt to ~1.2s for me.
2018-10-24 16:48:35 +02:00
Bruno Oliveira
8bced7415c Merge pull request #4220 from anpr/doc_raise_on_empty_parameterset
Add `empty_parameter_set_mark` ini option documentation to the parametrize doc
2018-10-23 19:10:44 -03:00
Bruno Oliveira
72d98a7c52 Merge pull request #4214 from blueyed/fix-4174
Fix "Plugin already registered" error with symlinks
2018-10-23 17:10:15 -03:00
Andreas Profous
0dd85157ea Add reference to `empty_parameter_set_mark` parametrize doc 2018-10-23 22:03:05 +02:00
Daniel Hahler
2a45851c9e Merge pull request #4218 from blueyed/remove-_shutil_rmtree_remove_writable
minor: remove unused _shutil_rmtree_remove_writable
2018-10-23 18:34:28 +02:00
Daniel Hahler
b51ee48f78 minor: remove unused _shutil_rmtree_remove_writable 2018-10-23 17:36:22 +02:00
Daniel Hahler
fadac0ffc0 Fix "Plugin already registered" error with symlinks
Fixes https://github.com/pytest-dev/pytest/issues/4174.
2018-10-23 10:15:23 +02:00
Anthony Sottile
799b72cf6f Merge pull request #4213 from asottile/flake8_master_fixes
Fixes for flake8 master
2018-10-22 20:08:38 -07:00
Bruno Oliveira
fc0f89ac14 Merge pull request #4215 from nicoddemus/release-3.9.2
Release version 3.9.2
2018-10-22 22:08:16 -03:00
Bruno Oliveira
771e860011 Preparing release version 3.9.2 2018-10-22 21:47:42 +00:00
Anthony Sottile
cb39bd0651 Fixes for flake8 master 2018-10-22 08:50:00 -07:00
Anthony Sottile
c94b2b227e Merge pull request #4208 from nicoddemus/pytestskip-docs-4206
Remove pytest.config example from skipping at module level docs
2018-10-21 10:28:53 -07:00
Ankit Goel
f30911d3af Merge pull request #4209 from nicoddemus/fixture-named-request
Issue a warning when a fixture named 'request' is collected
2018-10-21 05:49:08 +05:30
Ankit Goel
cd72e23f3f Merge pull request #4207 from nicoddemus/recursive-dep-fixtures
Improve error message when a recursive dependency between fixtures is detected
2018-10-20 22:19:21 +05:30
Bruno Oliveira
7bb51b8ceb Issue a warning when a fixture named 'request' is collected
Fix #611
2018-10-20 12:09:44 -03:00
Bruno Oliveira
b9990f77ff Merge pull request #4204 from vbarbaresi/3340_log_hooks
Fix logging usage in hooks pytest_sessionstart/finish
2018-10-20 11:36:06 -03:00
Bruno Oliveira
6b126997e1 Remove pytest.config example from skipping at module level docs 2018-10-20 11:28:39 -03:00
Bruno Oliveira
02ae7d8531 Improve error message when a recursive dependency between fixtures is detected
Fix #2909
2018-10-20 09:44:42 -03:00
Bruno Oliveira
f947cb2613 Merge remote-tracking branch 'upstream/features' into davidszotten/stepwise 2018-10-20 09:18:02 -03:00
Vincent Barbaresi
db106d6085 Fix logging usage in hooks pytest_sessionstart/finish #3340 2018-10-20 09:55:10 +02:00
Bruno Oliveira
b0eed7b56c Merge pull request #4205 from vbarbaresi/fix_typo
fix typo in tmpdir documentation (trivial)
2018-10-19 17:49:32 -03:00
Vincent Barbaresi
51d358a7a9 fix typo in tmpdir documentation 2018-10-19 19:22:04 +02:00
Bruno Oliveira
c54cdd05b8 Merge pull request #4201 from ykantor/patch-1
Update tmpdir.rst - very trivial
2018-10-19 12:13:35 -03:00
Bruno Oliveira
dde147641e Fix linting 2018-10-19 09:33:51 -03:00
Bruno Oliveira
2abd005cc9 Merge pull request #4195 from nicoddemus/issue-3691
Use safe_str() to format warning message about unicode in Python 2
2018-10-19 07:18:29 -03:00
Ronny Pfannschmidt
366b88388b Merge pull request #4200 from asottile/upgrade_hooks
Upgrade pre-commit/pre-commit-hooks to 2.0.0
2018-10-19 08:33:03 +02:00
ykantor
0fc1801d0d Update tmpdir.rst 2018-10-19 05:54:29 +02:00
Anthony Sottile
11ff14be1f Upgrade pre-commit/pre-commit-hooks to 2.0.0 2018-10-18 20:11:35 -07:00
Anthony Sottile
dc0b4efffa Merge pull request #4196 from nicoddemus/better-signature-error-msg-4026
Improve error message when it is not possible to determine a function's signature
2018-10-18 18:56:55 -07:00
Bruno Oliveira
864d7fef30 Add back some {posargs} placeholders for pytest invocations in tox.ini
Those were removed by accident in a previous commits it seems
2018-10-18 21:57:11 -03:00
Bruno Oliveira
18035211f5 Use safe_str() to format warning message about unicode in Python 2
Fix #3691
2018-10-18 21:56:17 -03:00
Anthony Sottile
61080da89d Merge pull request #4192 from asottile/fix_recwarn_stacklevel
Fix filename reported by `warnings.warn` when using `recwarn` under python2.
2018-10-18 16:22:00 -07:00
Bruno Oliveira
ac5704290f Improve error message when it is not possible to determine a function's signature
Fix #4026
2018-10-18 20:06:43 -03:00
Bruno Oliveira
b432f1207c Merge pull request #4190 from nicoddemus/merge-master-into-features
Merge master into features
2018-10-18 19:23:16 -03:00
Anthony Sottile
cdd0e18ca8 Emulate resetting the warnings registry for python 2.x 2018-10-18 10:43:05 -07:00
Bruno Oliveira
43c3f59660 Merge pull request #4188 from svenstaro/make-it-more-colorful
Make --color more colorful
2018-10-18 14:14:53 -03:00
Bruno Oliveira
e4871f7722 Merge pull request #4183 from RonnyPfannschmidt/bump-setuptools
fix #4177 - pin setuptools>=40.0
2018-10-18 07:49:03 -03:00
Bruno Oliveira
517ee588c6 Merge pull request #4186 from nicoddemus/drop-coveralls
No longer upload code coverage to coveralls
2018-10-18 07:48:40 -03:00
Ankit Goel
1b51497936 [WIP] Update warning stacklevel when wrapping warnings.warn 2018-10-18 02:36:41 +00:00
Sven-Hendrik Haase
f694d8d6ad Make --color more colorful 2018-10-18 03:56:58 +02:00
Bruno Oliveira
a83ee197c6 Merge remote-tracking branch 'upstream/master' into RonnyPfannschmidt/bump-setuptools 2018-10-17 19:05:52 -03:00
Bruno Oliveira
12f94b81c0 No longer upload code coverage to coveralls
We have since moved to codecov and uploading to coveralls is breaking
OS-X builds for py37 [1], so we might as well take this opportunity to drop
it.

[1] https://travis-ci.org/pytest-dev/pytest/jobs/442858038
2018-10-17 18:18:08 -03:00
Bruno Oliveira
e6b01b45f1 Merge pull request #4185 from RonnyPfannschmidt/fix-fail
fix test_cleanup_keep for expecting symlinks
2018-10-17 18:15:37 -03:00
David Szotten
e478f66d8b cache is set by the cacheprovider 2018-10-17 21:17:54 +01:00
Ronny Pfannschmidt
56dd7bc551 TestNumberedDir: ignore that symlinks arent created on windows 2018-10-17 21:39:23 +02:00
Bruno Oliveira
8a768b0db0 Merge pull request #4182 from nicoddemus/fix-deprecations-hook-name
Fix hook name in deprecations.rst
2018-10-17 16:18:52 -03:00
Ronny Pfannschmidt
8dca8f3c9f fix test_cleanup_keep for expecting symlinks 2018-10-17 21:16:44 +02:00
Ronny Pfannschmidt
cc335d44a0 fix #4179 - bring back the current testrun symlink 2018-10-17 20:43:27 +02:00
Ronny Pfannschmidt
4f4c91caf5 fix #4177 - pin setuptools>=40.0 2018-10-17 20:08:07 +02:00
Bruno Oliveira
ba5a295544 Fix hook name in deprecations.rst
As mentioned in https://github.com/pytest-dev/pytest/issues/4128#issuecomment-430690498
2018-10-17 14:53:41 -03:00
Bruno Oliveira
93bdbf7572 Merge pull request #4173 from nicoddemus/warning-docs-update
Update warnings docs
2018-10-17 09:24:32 -03:00
Anthony Sottile
ab8907f6f5 s/comparision/comparison/g [ci skip] 2018-10-16 17:23:29 -07:00
Bruno Oliveira
215a2ed3de Update warnings docs
Some points on the document work different in 3.9, plus changed the order
of the sections a bit to make more sense for users reading it for the first time.
2018-10-16 21:00:57 -03:00
Bruno Oliveira
f7285b6ab2 Merge pull request #4172 from nicoddemus/merge-features-into-master
Merge features into master
2018-10-16 18:59:23 -03:00
Bruno Oliveira
ee0a306ee4 Merge remote-tracking branch 'upstream/features' into merge-features-into-master 2018-10-16 17:41:27 -03:00
Bruno Oliveira
7931b5b489 Merge pull request #4171 from RonnyPfannschmidt/release-3.9.1
Release 3.9.1
2018-10-16 17:40:31 -03:00
Ronny Pfannschmidt
c5bbf8ac73 make note about the unpublished 3.9.0 release 2018-10-16 22:21:15 +02:00
Ronny Pfannschmidt
253c5786af Preparing release version 3.9.1 2018-10-16 22:16:58 +02:00
Ronny Pfannschmidt
c4550bc922 Merge branch 'release-3.9.0' of github.com:nicoddemus/pytest into release-3.9.1 2018-10-16 22:07:38 +02:00
Bruno Oliveira
2c00f8aad1 Merge pull request #4170 from RonnyPfannschmidt/fix-metadata-url-quotes
Fix metadata url quotes
2018-10-16 16:58:36 -03:00
Ronny Pfannschmidt
456715a5c1 fix url quotes in setup.cfg metadata 2018-10-16 21:48:39 +02:00
Ankit Goel
f858177495 Merge pull request #4167 from vbarbaresi/3533_junit_escape_skipped
Fix #3533: properly escape raw XML object
2018-10-16 21:10:42 +05:30
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
Vincent Barbaresi
d72154acda add changelog for #3533 2018-10-16 15:07:23 +02:00
Vincent Barbaresi
f55ded20a9 fix #3533: properly escape raw XML object
Using string formatting with the raw escaped object lead to string evaluation
"<py._xmlgen.raw object>"
Format the unescaped string first, then use the XML escape method as a last step.
2018-10-16 14:46:39 +02:00
Bruno Oliveira
17655b54f2 Merge pull request #4163 from nicoddemus/travis-passenv-4162
Pass TRAVIS env var to test environments [skip appveyor]
2018-10-15 20:50:43 -03:00
Bruno Oliveira
12edc4e7b8 Pass TRAVIS env var to test environments [skip appveyor]
xdist has an workaround inplace for Travis so "-n auto" works.

Fix #4162
2018-10-15 20:06:59 -03:00
David Szotten
c25310d34f fix cacheprovider test 2018-10-15 21:51:15 +01:00
Bruno Oliveira
2868c31495 Preparing release version 3.9.0 2018-10-15 20:23:30 +00:00
Bruno Oliveira
39a13d7064 Fix tmp_path example in docs 2018-10-15 20:19:15 +00:00
Bruno Oliveira
e4e4fd1e52 Merge pull request #4158 from nicoddemus/merge-master-into-features
Merge master into features (prepare for 3.9, pt2)
2018-10-15 17:12:08 -03:00
David Szotten
d67d189d00 grammar 2018-10-15 20:04:39 +01:00
David Szotten
8187c148d9 now pinned to pytest version 2018-10-15 20:04:39 +01:00
David Szotten
e773c8ceda linting 2018-10-15 20:04:39 +01:00
David Szotten
4f652c9045 we have a pr number now 2018-10-15 20:04:39 +01:00
David Szotten
126bb0760e authors 2018-10-15 20:04:39 +01:00
David Szotten
8c059dbc48 draft changelog 2018-10-15 20:04:39 +01:00
David Szotten
fd66f69c19 draft doc 2018-10-15 20:04:39 +01:00
David Szotten
63c01d1541 update for builtin plugin 2018-10-15 20:04:39 +01:00
David Szotten
c56d7ac40e move files into the pytest file structure 2018-10-15 20:04:39 +01:00
David Szotten
d9c428c1de add compat for pytest 3.7 and tox config for (some of) the versions i could still get working 2018-10-15 20:04:39 +01:00
Niclas Olofsson
bd9495486b pytest 2.7 compatibility. 2018-10-15 20:04:39 +01:00
Niclas Olofsson
33f1ff4e8c Use result.stderr in tests since result.errlines has changed behaviour. 2018-10-15 20:04:39 +01:00
Niclas Olofsson
1d23bef3fb Use a single node ID rather than a set for failed tests. 2018-10-15 20:04:38 +01:00
Niclas Olofsson
661055105c Restructured project. 2018-10-15 20:04:38 +01: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
9087ac4010 Merge pull request #4157 from nicoddemus/fix-pr-template-link
Use full link to changelog's README in PR template
2018-10-15 12:50:16 -03:00
Anthony Sottile
093e19a7d9 Merge pull request #4153 from asottile/syntax_warning_filename
Display the filename when encountering `SyntaxWarning`.
2018-10-15 08:40:51 -07:00
Bruno Oliveira
9e867ce864 Use full link to changelog's README in PR template
Fix #4156
2018-10-15 12:19:52 -03:00
Bruno Oliveira
8abf30ad71 Merge pull request #4155 from Tadaboody/Add_a_simple_example_on_how_to_use_pytester_to_the_CONTRIBUTING_guide_4151
Add testdir examples to CONTRIBUTING guide
2018-10-15 08:48:57 -03:00
Bruno Oliveira
ea25eb1ecc Fix linting 2018-10-15 08:15:40 -03:00
Bruno Oliveira
58b6e8616c Merge pull request #4149 from RonnyPfannschmidt/modern-build
modernize packaging for setuptools>30.3
2018-10-15 08:13:47 -03:00
Bruno Oliveira
f129ba617f Improve docs a bit 2018-10-15 08:00:16 -03:00
Tomer Keren
99d957bd3d Check off PR requirements 2018-10-15 11:36:31 +03:00
Tomer Keren
661013c3e9 Add testdir examples to CONTRIBUTING guide
Hopefully Closes: #4151
2018-10-15 11:13:24 +03:00
Ankit Goel
141c51f0cb Merge pull request #4145 from labcodes/4098
Add returncode argument to pytest.exit
2018-10-15 11:04:11 +05:30
Ronny Pfannschmidt
d65c7658d5 changelog 2018-10-15 07:32:38 +02:00
Ronny Pfannschmidt
7855284ef7 move most setuptools parameters over to setup.cfg 2018-10-15 07:30:07 +02:00
Ronny Pfannschmidt
5b0f88712b Merge pull request #4148 from RonnyPfannschmidt/pathlib-cleanup-symlink-is-fine
fix #4135 - handle symlinks in tmp path cleanup
2018-10-15 07:02:13 +02:00
Anthony Sottile
2e42d937dc Display the filename when encountering SyntaxWarning.
```console
$ cd t && rm -rf __pycache__ && pytest t.py -q -c /dev/null; cd ..
.                                                                        [100%]
=============================== warnings summary ===============================
<unknown>:2: DeprecationWarning: invalid escape sequence \.

-- Docs: https://docs.pytest.org/en/latest/warnings.html
1 passed, 1 warnings in 0.01 seconds

```

```console
$ cd t && rm -rf __pycache__ && pytest t.py -q -c /dev/null; cd ..
.                                                                        [100%]
=============================== warnings summary ===============================
/tmp/pytest/t/t.py:2: DeprecationWarning: invalid escape sequence \.
  '\.wat'

-- Docs: https://docs.pytest.org/en/latest/warnings.html
1 passed, 1 warnings in 0.01 seconds
```
2018-10-14 16:11:47 -07:00
Jose Carlos Menezes
27d932e882 Fix order of parameters when raising Exit exception 2018-10-14 18:48:32 -03:00
Jose Carlos Menezes
40091ec2c7 Update pytest.exit docstring 2018-10-14 18:44:53 -03:00
Jose Carlos Menezes
76fb9970c8 Check if returncode is not None before assigning test return code 2018-10-14 18:43:48 -03:00
Jose Carlos Menezes
d32f2c5c14 Change Exit.__init__ params order to keep backward compatibility 2018-10-14 18:42:55 -03:00
Bruno Oliveira
49defa2890 Merge pull request #4144 from nicoddemus/fix-flaky-durations-test
Fix flaky durations test
2018-10-14 18:40:14 -03:00
Bruno Oliveira
fe2dae4885 Merge pull request #4140 from blueyed/ci
Faster CI
2018-10-14 18:39:13 -03:00
Bruno Oliveira
ced62f30ba Attempt to create symlinks even on Windows, skipping when not possible 2018-10-14 18:21:04 -03:00
Jose Carlos Menezes
bbd1cbb0b3 Update changelog to better reading 2018-10-14 18:03:37 -03:00
Jose Carlos Menezes
d4dfd526c1 Update pytest.exit docstring 2018-10-14 18:01:47 -03:00
Ronny Pfannschmidt
d4351ac5a2 modernize packaging for setuptools>30.3 2018-10-14 21:44:32 +02:00
Jose Carlos Menezes
766d2daa06 Update returncode exit test to check exitstatus returrned from test session 2018-10-14 16:41:16 -03:00
Jose Carlos Menezes
836c9f82f1 Set test session exitstatus value from Exit excetion return code 2018-10-14 16:39:43 -03:00
Jose Carlos Menezes
46d6a3fc27 Pass returncode to Error exception when creating instance 2018-10-14 16:36:53 -03:00
Ronny Pfannschmidt
1dfa303b1e fix #4135 - handle symlinks in tmp path cleanup 2018-10-14 21:20:34 +02:00
Bruno Oliveira
6258248865 Merge pull request #4138 from blueyed/cov-pexpect
tox.ini: clean up changedir
2018-10-14 15:41:54 -03:00
Bruno Oliveira
4808145846 test_request_garbage is flaky when running with xdist
Example failure:

https://travis-ci.org/pytest-dev/pytest/jobs/441305926#L545
2018-10-14 15:17:08 -03:00
Jose Carlos Menezes
a0666354dd Update changelog 2018-10-14 12:29:19 -03:00
Jose Carlos Menezes
ce55dcf64c Add test for calling pytest.exit with statuscode
It checks that a SystemError was raised and the SystemError code
is the same as the returncode argument.
2018-10-14 12:29:19 -03:00
Jose Carlos Menezes
d7be039f1b Add returncode argument to pytest.exit
If the argument is not None, it'll raise a SystemExit exception to
cleanly exit pytest.
2018-10-14 12:26:31 -03:00
Bruno Oliveira
7e1fac5f91 Merge pull request #4139 from blueyed/passenv
tox.ini: passenv: COVERAGE_*
2018-10-14 12:24: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
Daniel Hahler
0be84cd68b Merge pull request #4141 from blueyed/testpaths-fix
tox.ini: fix testpaths
2018-10-14 17:21:10 +02:00
Daniel Hahler
323c846ce6 tox.ini: fix testpaths
Broken recently in 307fa7a4 (features branch).

[ci skip] (since it apparently is not tested/used there)
2018-10-14 17:05:28 +02:00
Daniel Hahler
3bd9f981a2 tox.ini: clean up changedir 2018-10-14 14:33:28 +02:00
Daniel Hahler
7ded937e19 AppVeyor: use fast_finish
This runs py27, py37 and linting first - simulating the baseline stage
used on Travis.
2018-10-14 14:27:34 +02:00
Daniel Hahler
6d0667f1db CI: run specialized factors in a single job
Given the setup time for jobs, it makes sense to run
*-pexpect,*-trial,*-numpy in a single build job.
2018-10-14 14:27:34 +02:00
Daniel Hahler
7c380b19f3 tox.ini: passenv: COVERAGE_*
This is required to pass through COVERAGE_PROCESS_START etc.
2018-10-14 12:34:17 +02:00
Daniel Hahler
5322f422e3 Merge pull request #4108 from blueyed/realpath
Resolve symlinks for args
2018-10-14 11:30:18 +02:00
Daniel Hahler
c6c326f076 Merge pull request #4137 from blueyed/toxini
tox.ini: pexpect: use posargs; cleanup posargs
2018-10-14 11:29:34 +02:00
Daniel Hahler
d6832a8b56 Merge pull request #4133 from blueyed/pdb-quit
pdb: handle quitting in post_mortem
2018-10-14 11:29:09 +02:00
Daniel Hahler
3bfaa8ab84 Merge pull request #4132 from blueyed/pdb-internal-dupe
Do not print (duplicate) INTERNALERROR with --pdb.
2018-10-14 11:25:35 +02: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
Bruno Oliveira
e3bf9cede4 Fix linting 2018-10-13 22:13:25 -03:00
Daniel Hahler
4a49715614 tox.ini: pexpect: use posargs; cleanup posargs
- no need for {posargs:testing} really
- remove `-ra`, used with addopts already
2018-10-14 00:08:46 +02:00
Daniel Hahler
86c7dcff68 pdb: handle quitting in post_mortem
`help quit` in pdb says:

> Quit from the debugger. The program being executed is aborted.

But pytest would continue with the next tests, often making it necessary
to kill the pytest process when using `--pdb` and trying to cancel the
tests using `KeyboardInterrupt` / `Ctrl-C`.
2018-10-14 00:05:45 +02: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
Daniel Hahler
448830e656 Do not print INTERNALERROR with --pdb
This gets printed by the terminal reporter already, and currently
results in the same error being displayed twice, e.g. when raising an
`Exception` manually from `pytest.debugging.pytest_exception_interact`.
2018-10-13 23:56:34 +02:00
Bruno Oliveira
3683d92c53 Adjust the 'durations hidden' message 2018-10-13 18:40:32 -03:00
Daniel Hahler
d3d8d53e41 tests: test_pdb: fix print statements 2018-10-13 23:33:52 +02:00
Jeffrey Rackauckas
7a271a91b0 Fix rounding error when displaying durations in non-verbose mode. 2018-10-13 12:55:17 -07:00
Jeffrey Rackauckas
47f5c29002 Update messaging for --durations when not in verbose mode. 2018-10-13 12:51:04 -07:00
Bruno Oliveira
27d2683a02 Merge pull request #4134 from blueyed/minor
Minor: code style / constant
2018-10-13 16:13:02 -03:00
Bruno Oliveira
792f365c14 Merge pull request #4136 from luziferius/patch-1
docs: deprecation.rst: Add missing arguments to example code
2018-10-13 16:12:49 -03:00
Thomas Hess
91b2797498 docs: deprecation.rst: Add missing arguments to code example
In the proposed new style using `@pytest.mark.parametrize`,
the example function signature missed the actual arguments.
Add the missing arguments
2018-10-13 20:33:31 +02:00
Daniel Hahler
c27c8f41a8 Merge pull request #4123 from blueyed/clarify
tests: clarify/document/harden acceptance tests
2018-10-13 18:26:10 +02:00
Daniel Hahler
ee54fb9a6b pytester: use EXIT_INTERRUPTED 2018-10-13 17:06:40 +02:00
Daniel Hahler
10ddc466bf minor: typo and code style 2018-10-13 17:06:40 +02: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
ed42ada373 Merge pull request #4124 from nicoddemus/traceback-import-error-3332
Improve tracebacks for ImportErrors in conftest
2018-10-13 09:25:10 -03:00
Daniel Hahler
e2667106a2 Merge pull request #4126 from blueyed/testpaths
tox.ini: use testpaths, cleanup other pytest options
2018-10-13 14:10:44 +02:00
Bruno Oliveira
29d5849519 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-13 08:50:32 -03:00
Bruno Oliveira
eabf15b626 Merge pull request #4125 from nicoddemus/docs-baseline
Run docs, doctesting and linting in the same job to save some CI time
2018-10-12 21:01:59 -03:00
Bruno Oliveira
2dc619cbf4 Run docs, doctesting and linting in the same environment to save some CI time 2018-10-12 13:35:27 -03:00
Daniel Hahler
307fa7a42a tox.ini: use testpaths, cleanup other pytest options 2018-10-12 17:07:45 +02:00
Bruno Oliveira
ef97121d42 Removed unused ConftestImportFailure.__str__ method 2018-10-12 10:57:13 -03:00
Ankit Goel
d46b6b2bc3 Merge pull request #4121 from labcodes/3713
Update usefixtures documentation
2018-10-12 19:08:40 +05:30
Bruno Oliveira
2cb3534679 Move filter_traceback to _pytest._code 2018-10-12 10:19:50 -03:00
Bruno Oliveira
8e11fe5304 Improve tracebacks for ImportErrors in conftest.py files
Fix #3332
2018-10-12 10:10:55 -03:00
Bruno Oliveira
36dc671843 New ExceptionInfo.getrepr 'chain' parameter to be able to suppress chained exceptions 2018-10-12 10:08:55 -03:00
Jose Carlos Menezes
dbaa9464ba Update usefixtures documentation
Clarifying that it can't be used with fixture functions
2018-10-12 09:45:49 -03:00
Bruno Oliveira
933de16fe4 Merge pull request #3988 from RonnyPfannschmidt/tmpdir-port-pathlib
Tmpdir port pathlib
2018-10-12 08:33:47 -03:00
Bruno Oliveira
e8348a1d12 Merge pull request #4077 from nicoddemus/short-usage-errors
Improve internal error messages
2018-10-12 08:18:07 -03:00
Bruno Oliveira
0f5263cdc3 Merge pull request #4109 from njonesu/master
Fix multiple string literals on a line #4093
2018-10-11 15:50:08 -03:00
Ronny Pfannschmidt
4736b2bdfb address review comments 2018-10-11 20:48:30 +02:00
Anthony Sottile
8ecdd4e9ff Merge pull request #4104 from asottile/deprecated_call_match
Implement pytest.deprecated_call with pytest.warns
2018-10-11 08:20:13 -07:00
Daniel Hahler
b3940666a7 Merge pull request #4103 from blueyed/conftest
conftest: optimize _getconftestmodules
2018-10-11 13:52:48 +02:00
Bruno Oliveira
e20987ce82 Merge pull request #4110 from blueyed/pdb
tests: fixes for pdbpp
2018-10-11 08:43:24 -03:00
Ronny Pfannschmidt
584051aa90 extend docs with basics about tmp_path and tmp_path_facotry 2018-10-11 10:33:59 +02:00
Ronny Pfannschmidt
16e2737da3 implement tmp_path_factory and deprecate pytest.ensuretemp as intended 2018-10-11 09:41:37 +02:00
Ronny Pfannschmidt
36c2a101cb add missing docstring 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
ebd597b2fd use the constant for lock timeouts 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
94829c391b make tmpdir env cleanup idempotent 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
b82d6f7a0b pytester: use per test tmproot 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
4a436b5470 resolve in code review commments 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
ad6f63edda add changelog 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
3036914097 sort out rmtree expectations 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
2831cb9ab5 unify paths.py and pathlib.py 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
00716177b4 fix missed Path import 2018-10-11 07:15:09 +02:00
Ronny Pfannschmidt
85cc9b8f12 move all the things into _pytest.pathlib 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
fed4f73a61 ignore rmtree errors 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
d76fa59b35 fix lock timeouts for good this time 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
2532dc1dbb fix up lock consideration argument 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
642cd86dd1 shape up removal and lock destruction 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
b3a5b0ebe1 remove path from exposure 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
8b4a29357e fix typo 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
ab3637d486 implement cleanup for unlocked folders 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
66a690928c bring in purepath and fix an assertion 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
8e00280fc1 fix linting 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
d053cdfbbb factor out max and iterate on locks and cleanups 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
2e39fd89d1 add python27 support by using reduce instead of max 2018-10-11 07:15:08 +02:00
Ronny Pfannschmidt
b48e23d54c port interals of tmpdir to a basic pathlib implementation
this is still lacking locking and cleanup of the folders
2018-10-11 07:15:08 +02:00
Bruno Oliveira
c9a85b0e78 Fix linting 2018-10-10 19:54:39 -03:00
Bruno Oliveira
bf265a424d Minor adjustments found during code review 2018-10-10 19:35:49 -03:00
Bruno Oliveira
5436e42990 Use pytest.fail(..., pytrace=False) when treating user errors
This prevents an enormous and often useless stack trace from showing
to end users.

Fix #3867
Fix #2293
2018-10-10 19:16:53 -03:00
Bruno Oliveira
67f40e18a7 Use attr.s(repr=False) because we customize MarkInfo's repr 2018-10-10 19:13:34 -03:00
Daniel Hahler
52ff1eaf37 _getconftestmodules: optimize 2018-10-10 21:30:33 +02:00
Daniel Hahler
602e74c2a7 Merge pull request #4107 from blueyed/__tracebackhide__
pytester: fix __tracebackhide__ for {re_,fn}match_lines
2018-10-10 20:55:32 +02:00
Daniel Hahler
be511c1a05 tests: add missing expect before sendeof for pdbpp
With pdb++ this additional `expect` is required, otherwise `sendeof()`
will block forever.
2018-10-10 20:50:49 +02:00
Daniel Hahler
f36f9d2698 tests: fix/clarify expect for Pdb
`expect()` expects an regular expression, so "Pdb" is equivalent to
"(Pdb)".

But instead of escaping the parenthesis this patch removes them, to
allow for matching "(Pdb++)", too.
2018-10-10 20:50:49 +02:00
Anthony Sottile
dbfb3ccc42 Add changelog entry 2018-10-10 10:46:09 -07:00
Niklas JQ
d1322570dd Fix issue 4093 2018-10-10 19:45:07 +02:00
Daniel Hahler
4c9015c3b1 Merge pull request #4105 from blueyed/repr
Fix trailing whitespace in FixtureDef.__repr__
2018-10-10 19:28:32 +02:00
Niklas JQ
c14a23d4e4 Fix #4093: multiple string literals on a line 2018-10-10 19:28:31 +02:00
Daniel Hahler
b8fc3e569a pytester: fix __tracebackhide__ for {re_,fn}match_lines 2018-10-10 19:27:43 +02:00
Anthony Sottile
e0f6fce9e9 In python2, display previously warned warnings 2018-10-10 09:37:21 -07:00
Daniel Hahler
d93de6cc67 Fix trailing whitespace in FixtureDef.__repr__ 2018-10-10 18:14:56 +02:00
Anthony Sottile
aeb92accb2 Implement pytest.deprecated_call with pytest.warns 2018-10-10 08:03:23 -07:00
Anthony Sottile
943bbdd8ce Merge pull request #4100 from nicoddemus/merge-master-into-features
Merge master into features
2018-10-10 07:35:09 -07:00
Bruno Oliveira
9a3836a0cf Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-09 19:34:04 -03:00
Anthony Sottile
4b164d947d Merge pull request #4099 from asottile/re-enable_linting_windows
re-enable linting tox env on windows
2018-10-09 15:16:08 -07:00
Anthony Sottile
11a07211b6 re-enable linting tox env on windows 2018-10-09 13:01:51 -07:00
Anthony Sottile
28a3f0fcb9 Revert "Merge pull request #4094 from pytest-dev/asottile/asottile-patch-1"
This reverts commit c55d641963, reversing
changes made to 8393fdd51d.
2018-10-09 12:50:03 -07:00
Anthony Sottile
b8c30aab2b Merge pull request #4097 from asottile/improve_doc_plugin_load
Fix formatting for plugin loading in conftest
2018-10-09 10:23:04 -07:00
Daniel Hahler
b8958168f5 Merge pull request #4092 from altendky/4073-altendky-subprocessing_timeout-take_2
Correct timing in test_pytester.test_testdir_run_with_timeout()
2018-10-09 18:46:58 +02:00
Anthony Sottile
aaaae0b232 Fix formatting for plugin loading in conftest 2018-10-09 09:30:56 -07:00
Anthony Sottile
c55d641963 Merge pull request #4094 from pytest-dev/asottile/asottile-patch-1
Temporarily disable `linting` env in appveyor
2018-10-08 22:55:34 -07:00
Anthony Sottile
4ec85f934c Temporarily disable linting env in appveyor 2018-10-08 22:54:32 -07:00
Ronny Pfannschmidt
8393fdd51d Merge pull request #4089 from asottile/upgrade_hooks
Upgrade pre-commit hooks
2018-10-09 07:43:28 +02:00
Kyle Altendorf
4071c8a4a8 Correct timing in test_pytester.test_testdir_run_with_timeout() 2018-10-08 21:03:42 -04:00
Anthony Sottile
e8c10d4a98 Merge pull request #4090 from asottile/faster_tests
Improve performance of ~3 of the slowest tests
2018-10-08 17:07:10 -07:00
Anthony Sottile
a86035625c Increase recursion limit (broke xdist tests) 2018-10-08 12:57:45 -07:00
Anthony Sottile
4f631440be Use RuntimeError for py27 + py34 compat 2018-10-08 11:47:06 -07:00
Anthony Sottile
3901569f26 Improve performance of ~3 of the slowest tests 2018-10-08 11:12:55 -07:00
Anthony Sottile
689b856cb7 Merge pull request #4088 from Sup3rGeo/bugfix/announcements-name-victor-maryama
Renamed Victor to full name.
2018-10-08 10:16:20 -07:00
Anthony Sottile
65545d8fb2 Manual fixups of black formatting 2018-10-08 10:12:42 -07:00
Anthony Sottile
1caf6d5907 Upgrade pre-commit hooks 2018-10-08 10:10:46 -07:00
Victor Maryama
55871c68a4 Renamed Victor to full name. 2018-10-08 18:43:50 +02:00
Jeffrey Rackauckas
fc11b81005 Exclude durations that are 0.00 seconds long. 2018-10-07 19:19:48 -07:00
Kyle Altendorf
a6fb4c8268 Merge pull request #4078 from altendky/4073-altendky-subprocessing_timeout
Add timeout for Testdir.runpytest_subprocess() and Testdir.run()
2018-10-07 18:07:06 -04:00
Kyle Altendorf
48dcc67274 Increase timeout in test_testdir_run_with_timeout to decrease false failures 2018-10-06 22:02:33 -04:00
Kyle Altendorf
ccaec8d360 __tracebackhide__ = True 2018-10-06 21:57:03 -04:00
Ronny Pfannschmidt
66609665f2 Merge pull request #4076 from nicoddemus/unittest-param-fixture-msg
Improve error message when TestCase functions use a parametrized fixture
2018-10-06 07:43:57 +02:00
Kyle Altendorf
4b36f9aa64 Tidy timeout checking 2018-10-05 16:46:24 -04:00
Kyle Altendorf
5ecbb0acba Correct new changelog to have newline at end 2018-10-05 10:22:07 -04:00
Kyle Altendorf
20902deb75 Add Kyle Altendorf to AUTHORS 2018-10-05 10:02:59 -04:00
Kyle Altendorf
ed5556bdac Add to docstrings 2018-10-05 10:02:59 -04:00
Kyle Altendorf
ee64f1fb9f Add changelog file for 4073 2018-10-05 10:02:59 -04:00
Kyle Altendorf
8e0e862c84 Stretch out the time assertion for slow AppVeyor 2018-10-05 01:38:01 -04:00
Kyle Altendorf
42422a7f62 Throw away arbitrary args to runpytest_subprocess() 2018-10-05 00:30:25 -04:00
Kyle Altendorf
f3a173b736 Revert "Use signal.alarm() for py2 timeout"
This reverts commit 900cef6397.
2018-10-05 00:05:46 -04:00
Kyle Altendorf
5c38a5160d Slight diff tidy 2018-10-04 23:33:38 -04:00
Kyle Altendorf
dcf9eb0104 Raise an exception on unexpected kwargs 2018-10-04 23:27:01 -04:00
Kyle Altendorf
dd225e1b9d Tidy getting of timeout from kwargs 2018-10-04 23:15:30 -04:00
Kyle Altendorf
900cef6397 Use signal.alarm() for py2 timeout 2018-10-04 23:11:26 -04:00
Kyle Altendorf
0d095fc978 Up timeout to 1 second for test 2018-10-04 23:09:07 -04:00
Kyle Altendorf
dcd635ba0c Correct timeout to check every so often 2018-10-04 23:08:57 -04:00
Kyle Altendorf
33f0338eeb kill and wait for subprocess before raising TimeoutExpired 2018-10-04 22:52:51 -04:00
Kyle Altendorf
d5e5433553 Add descriptive message for timeout 2018-10-04 21:43:41 -04:00
Kyle Altendorf
d2906950ce monotonic.monotonic() -> time.time() 2018-10-04 21:26:08 -04:00
Bruno Oliveira
fe7050ba00 Fix lint 2018-10-04 18:45:30 -03:00
Bruno Oliveira
a1208f5631 Merge pull request #4075 from nicoddemus/dynamic-fixturenames
Fix request.fixturenames to return fixtures created dynamically
2018-10-04 09:21:23 -03:00
Kyle Altendorf
870a93c37b Actually construct TimeoutExpired 2018-10-04 01:02:58 -04:00
Kyle Altendorf
96b2ae6654 Initial pass at timeout for subprocessing pytest
pytest-dev/pytest#4073
2018-10-03 23:56:57 -04:00
Anthony Sottile
b098292352 Merge pull request #4069 from asottile/deindent_4066
Fix source reindenting by using `textwrap.dedent` directly.
2018-10-03 16:11:51 -07:00
Bruno Oliveira
212937eb3e Improve error message when TestCase functions use a parametrized fixture
Fix #2535
2018-10-03 19:43:46 -03:00
Bruno Oliveira
70c7273640 Fix request.fixturenames to return fixtures created dynamically
Fix #3057
2018-10-03 18:50:14 -03:00
Anthony Sottile
e5ab62b1b6 Remove (unused) offset= parameter from deindent() 2018-10-03 13:33:10 -07:00
Anthony Sottile
b8b9e8d41c Remove duplicate test (tested above) 2018-10-03 10:01:06 -07:00
Bruno Oliveira
e712adc226 Merge pull request #4072 from pecey/tmp/issue-4064
Fixes #4064 by correcting the documentation for unit-tests
2018-10-03 12:26:35 -03:00
Palash Chatterjee
f9ac60807c Fixes #4064 by correcting the documentation for unit-tests 2018-10-03 18:11:09 +05:30
Bruno Oliveira
3f03625a5d Merge pull request #4070 from jeffreyrack/4058-update-fixture-docs
Update documentation to indicate a fixture can be invoked more than once in it's scope.
2018-10-03 08:39:41 -03:00
Ronny Pfannschmidt
29d3faed66 Merge pull request #4068 from nicoddemus/merge-master-into-features
Merge master into features
2018-10-03 08:30:39 +02:00
Jeffrey Rackauckas
c5dec6056f Fix wording in fixtures doc. 2018-10-02 21:17:53 -07:00
Jeffrey Rackauckas
642847c079 Update documentation on fixture being invoked more than once in a scope. 2018-10-02 20:53:15 -07:00
Anthony Sottile
f102ccc8f0 Fix source reindenting by using textwrap.dedent directly. 2018-10-02 16:13:35 -07:00
Bruno Oliveira
20f93ae8fa Merge pull request #4067 from beneyal/master
Add pytest.freeze_includes() to reference
2018-10-02 20:02:37 -03:00
Bruno Oliveira
1101a20408 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-10-02 18:13:54 -03:00
Anthony Sottile
df435fa8bd Merge pull request #4065 from asottile/release-3.8.2
Preparing release version 3.8.2
2018-10-02 13:53:52 -07:00
Ben Eyal
a5269b26e0 Add anchor for "Freezing pytest" 2018-10-02 17:54:59 +03:00
Anthony Sottile
d3673c7429 Preparing release version 3.8.2 2018-10-02 07:46:02 -07:00
Ben Eyal
5010e02eda Add pytest.freeze_includes to reference 2018-10-02 17:39:08 +03:00
Bruno Oliveira
25fe3706a4 Merge pull request #4056 from nicoddemus/unicode-vars
Ensure Monkeypatch setenv and delenv use bytes keys in Python 2
2018-10-02 07:56:32 -03:00
Bruno Oliveira
1a323fbd3c Show a warning when non-str is given to Monkeypatch.setenv 2018-10-01 20:07:07 -03:00
Bruno Oliveira
9d971d33be Hide internal pytest.warns traceback 2018-10-01 18:45:08 -03:00
Bruno Oliveira
bc009a8582 Fix test to comply with pypy 6.0 2018-10-01 18:37:27 -03:00
Bruno Oliveira
5e7d427df1 Merge pull request #4060 from nicoddemus/4051-changelog
Improve changelog for #4051
2018-10-01 18:12:52 -03:00
Bruno Oliveira
dd59ed3b18 Merge pull request #4059 from labcodes/documenting-scopes
Add possible values for fixture scope to docs
2018-10-01 17:25:42 -03:00
Bruno Oliveira
20d0f0e56b Improve changelog for #4051 2018-10-01 17:12:05 -03:00
Bruno Oliveira
d24a7e6c5a Issue warning if Monkeypatch.setenv/delenv receive non-strings in Python 2
Fixes the bug described in:

	https://github.com/tox-dev/tox/pull/1025#discussion_r221273830

Which is more evident when using `unicode_literals`.
2018-10-01 17:05:30 -03:00
Jose Carlos Menezes
4dc73bda45 Update changelog 2018-10-01 14:41:30 -03:00
Jose Carlos Menezes
732cc2687d Add possible values for fixture scope to docs 2018-10-01 14:31:28 -03:00
Ronny Pfannschmidt
5d2d64c190 Merge pull request #4057 from jeffreyrack/4051-improve-error-messaging
Improve error messaging when invalid syntax is passed to the -m option
2018-10-01 07:16:59 +02:00
Jeffrey Rackauckas
7a6d16c1eb Adding .rst to end of changelog fragment filename. 2018-09-30 18:45:49 -07:00
Jeffrey Rackauckas
c2179c3127 Improve error messaging when invalid syntax is passed to the -m option 2018-09-30 18:34:56 -07:00
Bruno Oliveira
d8d7f73e1c Merge pull request #4045 from nicoddemus/root-conftest-warning-workaround-4039
Do not issue non-top-level conftest warning when --pyargs is used
2018-09-27 09:26:11 -03:00
Ronny Pfannschmidt
3c23b5b010 Merge pull request #4037 from nicoddemus/deprecate-item-warnings-captured-hook
Document that item parameter of pytest_warning_captured hook is deprecated
2018-09-27 13:20:26 +02:00
Bruno Oliveira
783019a8e6 Rename 4040.trivial.rst to 4040.bugfix.rst 2018-09-27 08:08:03 -03:00
Bruno Oliveira
d2fc7ca6e0 Merge pull request #4041 from Zac-HD/user-properties-type
Ensure user_properties is a list
2018-09-27 08:04:30 -03:00
Bruno Oliveira
2d06927a06 Merge pull request #4040 from ods/summary_passes_less_noisy
Exclude empty reports for passed tests
2018-09-27 08:01:58 -03:00
Denis Otkidach
44d29d887e Changelog entry on excluding empty reports for passed tests 2018-09-26 19:02:35 +03:00
Bruno Oliveira
32c5a113e2 Do not issue non-top-level conftest warning when --pyargs is used
Fix #4039
2018-09-26 12:02:08 -03:00
Bruno Oliveira
ba5630e0f8 Simplify test_pytest_plugins_in_non_top_level_conftest_deprecated 2018-09-26 10:49:14 -03:00
Denis Otkidach
808df48ee8 Test for excluding empty reports for passed tests 2018-09-26 16:44:00 +03:00
Zac-HD
a089a9577e Succinct definition of user_properties 2018-09-26 22:40:11 +10:00
Zac-HD
6be2136f20 Ensure user_properties is a list 2018-09-26 22:04:50 +10:00
Denis Otkidach
f9ab81a493 Exclude empty reports for passed tests 2018-09-26 11:55:39 +03:00
Bruno Oliveira
1636522563 Document that item parameter of pytest_warning_captured hook is deprecated
Our policy is to not deprecate features during bugfix releases, but in this
case I believe it makes sense as we are only documenting it as deprecated,
without issuing warnings which might potentially break test suites.

This will get the word out that hook implementers should not use this parameter
at all.

Fix #4036
2018-09-25 17:38:22 -03:00
Bruno Oliveira
b1fbb2ab92 Merge pull request #4032 from hjwp/patch-1
add documentation of register_assert_rewrite
2018-09-25 08:43:29 -03:00
Daniel Hahler
e85edf5212 Merge pull request #4029 from nicoddemus/warnings-example-deprecation-docs
Add an example on how to update config.warn calls
2018-09-25 13:25:21 +02:00
Bruno Oliveira
b03bad5dbb Fix linting 2018-09-25 08:12:55 -03:00
Harry Percival
19ec300b2a fix rst syntax again 2018-09-25 06:58:47 +01:00
Harry Percival
11442f2ad7 fix rst syntax thing 2018-09-25 06:57:33 +01:00
Harry Percival
97748b6605 mention conftest.py as a good place to do it. 2018-09-25 06:55:28 +01:00
Harry Percival
2b762337bd add documentation of register_assert_rewrite
wip
2018-09-25 06:49:50 +01:00
Bruno Oliveira
9899b8f1fb Add an example on how to update config.warn calls
As commented in https://github.com/pytest-dev/pytest-cov/pull/230#pullrequestreview-157958838
2018-09-23 22:42:09 -03:00
Anthony Sottile
956b3aca97 Revert patching of breakpointhook as it appears to do nothing 2018-09-23 18:39:50 -07:00
Anthony Sottile
4474beeb82 Typo fix [ci skip] 2018-09-23 18:07:28 -07:00
Ronny Pfannschmidt
5d8467bedc Merge pull request #4023 from nicoddemus/deprecated-3.9
Add 3.9 deprecated features to deprecations.rst
2018-09-23 18:21:32 +02:00
Ronny Pfannschmidt
eca3e781b6 Merge pull request #4022 from iwanb/fix_reload
Fix #3539: reload module with assertion rewrite import hook
2018-09-23 18:17:56 +02:00
Bruno Oliveira
0d04aa7c59 Add 3.9 deprecated features to deprecations.rst 2018-09-23 09:26:12 -03:00
iwanb
c61ff31ffa Fix #3539: reload module with assertion rewrite import hook 2018-09-23 13:05:55 +02:00
Ronny Pfannschmidt
e03a19f88d Merge pull request #4021 from nicoddemus/merge-master-into-features
Merge master into features
2018-09-23 11:57:05 +02:00
Bruno Oliveira
fcc5b6d604 Add "deprecation" to possible changelog entries in pre-commit 2018-09-22 18:43:22 -03:00
Bruno Oliveira
42afce27b3 Merge pull request #4019 from nicoddemus/deprecation-warnings-4013
Show deprecation warnings even if filters are customized
2018-09-22 18:17:07 -03:00
Bruno Oliveira
56d0b5a7e2 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-09-22 18:14:36 -03:00
Ankit Goel
ec57cbf82d Merge pull request #4020 from crazymerlyn/release-3.8.1
Preparing release version 3.8.1
2018-09-23 00:56:27 +05:30
CrazyMerlyn
3f6a46c2a4 Preparing release version 3.8.1 2018-09-22 16:34:06 +00:00
Bruno Oliveira
c30184709d Show deprecation warnings even if filters are customized
Fix #4013
2018-09-22 10:25:57 -03:00
Bruno Oliveira
4ba3cb25b0 Merge pull request #4016 from williamjamir/patch-1
Include Python 3.7 on getting started doc
2018-09-21 20:02:25 -03:00
William Jamir Silva
650c458df9 Include Python 3.7 on getting started doc
Close #3932
2018-09-21 19:18:51 -03:00
Ankit Goel
58aa4f91f5 Merge pull request #4012 from maxalbert/fix-docstring-typo
Fix typo in docstring
2018-09-21 22:07:57 +05:30
Maximilian Albert
9b382ed16c Fix typo in docstring 2018-09-21 17:11:15 +01:00
Ronny Pfannschmidt
f02dbaf97f Merge pull request #4010 from nicoddemus/package-len-error-3749
Fix 'Package has no len()' error during collection
2018-09-21 07:40:20 +02:00
Bruno Oliveira
41f6ea13ce Fix 'Package has no len()' error during collection
Fix #3749
2018-09-20 17:53:21 -03:00
Ronny Pfannschmidt
f6eb39df33 Merge pull request #4001 from asottile/fix_bytes_repr_text_mix_python_2
Fix UnicodeDecodeError in assertion with mixed non-ascii bytes repr + text
2018-09-20 22:16:37 +02:00
Bruno Oliveira
7a5e11bbcf Merge pull request #3997 from nicoddemus/deprecation-docs
Introduce deprecations page
2018-09-20 08:22:51 -03:00
Anthony Sottile
7122fa5613 Fix UnicodeDecodeError in assertion with mixed non-ascii bytes repr + text 2018-09-19 20:24:00 -07:00
Bruno Oliveira
7aff81739e Merge pull request #3998 from blueyed/logging-del
logging: del item.catch_log_handler only in teardown
2018-09-19 20:07:19 -03:00
Bruno Oliveira
27772f67c0 Merge pull request #3987 from nicoddemus/fix-find-scope-3941
Fix scope determination with indirect parameters
2018-09-19 20:06:45 -03:00
Bruno Oliveira
10b3b2dc68 Merge pull request #3990 from blueyed/coverage-source
coverage: use modules
2018-09-19 19:55:11 -03:00
Bruno Oliveira
c2841542af Introduce deprecations page
fix #3996
2018-09-19 19:51:29 -03:00
wim glenn
1f28096587 Merge pull request #4003 from pytest-dev/wimglenn-patch-1
seems this subdir is now .pytest_cache not .cache
2018-09-19 14:49:38 -05:00
wim glenn
e86b01e831 Update customize.rst 2018-09-19 14:06:36 -05:00
Thomas Hisch
83802d1494 Merge pull request #3986 from thisch/fb3964
Add support for logging in collection-phase
2018-09-19 20:47:19 +02:00
Bruno Oliveira
d1fa8ae08e Improve CHANGELOG entry 2018-09-19 12:52:10 -03:00
Ronny Pfannschmidt
29dac03314 Merge pull request #3980 from nicoddemus/rewrite-cwd-changed
Fix assertion rewriter crash if cwd changes mid-testing
2018-09-19 17:45:26 +02:00
Daniel Hahler
e7eb7e799b logging: del item.catch_log_handler only in teardown
Without this caplog.record_tuples etc is not available anymore when using
`--pdb`.
2018-09-19 17:17:47 +02:00
Thomas Hisch
18cc74b8d0 Remove useless comment 2018-09-19 15:18:37 +02:00
Bruno Oliveira
7f48f552c1 Fix linting 2018-09-19 10:18:05 -03:00
Bruno Oliveira
1e2e65f0fa Add references to the relevant Python issues 2018-09-19 08:20:23 -03:00
Daniel Hahler
28c9cc7321 coverage: use modules for source
This should increase coverage for subprocesses, where previously
`source` paths were used only from the config file, but not the initial
`--source` argument.
2018-09-19 07:46:19 +02:00
Bruno Oliveira
ccb90b5c46 [WIP] Introduce deprecations page
fix #3996
2018-09-18 20:56:40 -03:00
Thomas Hisch
048342817b Add testcase for logging to file 2018-09-18 21:47:42 +02:00
Thomas Hisch
d1a3aa7b2b Update 3964.rst 2018-09-18 21:31:20 +02:00
Thomas Hisch
e967d4587a Add support for logging in collection-phase
The logging plugin does not output log messages generated during the
collection-phase when live-logging is enabled. This fixes this.

Fixes #3964
2018-09-18 20:18:24 +02:00
Bruno Oliveira
a79dc12f1e Merge pull request #3970 from sambarluc/raise_on_empty_parameterset
Raise exception if parametrize collects an empty parameter set
2018-09-18 08:11:34 -03:00
Bruno Oliveira
37d2469266 Use a PurePath instance to do matching against patterns in assertion rewrite
This way we don't need to have real file system path, which prevents the
original #3973 bug.
2018-09-17 20:29:09 -03:00
Bruno Oliveira
1df6d28080 Fix assertion rewriter crash if cwd changes mid-testing
Unfortunately we need to get a `py.path.local` object to perform the fnmatch
operation, it is different from the standard `fnmatch` module because it
implements its own custom logic. So we need to use `py.path` to perform
the fnmatch for backward compatibility reasons.

Ideally we should be able to use a "pure path" in `pathlib` terms (a path
not bound to the file system), but we don't have those in pylib.

Fix #3973
2018-09-17 20:04:44 -03:00
Daniel Hahler
03eaad376b tox: coverage factor: combine and report 2018-09-17 14:44:47 +02:00
Daniel Hahler
739f9a4a4b Travis: use codecov-bash
Faster to install and will retry uploads on connection errors.
2018-09-17 14:44:47 +02:00
Daniel Hahler
93224f8cf9 tox: remove obsolete whitelist_externals 2018-09-17 14:44:47 +02:00
Ronny Pfannschmidt
bb57186dd4 Merge pull request #3983 from nicoddemus/update-backward-policy
Review backward compatibility policy
2018-09-16 20:43:55 +02:00
Bruno Oliveira
2803eb9fbb Merge pull request #3984 from nicoddemus/fix-docs-formatting
Fix rendering of the ini example for python_files
2018-09-15 12:05:59 -03:00
Andrea Cimatoribus
913c07e414 Add changelog file and new author 2018-09-15 09:18:03 +02:00
Andrea Cimatoribus
4a9f468aac Update documentation 2018-09-15 09:18:03 +02:00
Andrea Cimatoribus
05155e4db0 Fail at parametrize option for empty parameter set
Optionally raise an exception when parametrize collects no arguments.
Provide the name of the test causing the failure in the exception
message.

See: #3849
2018-09-15 09:18:03 +02:00
Ronny Pfannschmidt
f53eff93db Merge pull request #3982 from nicoddemus/ignore-pytest-cache
Ignore pytest cache
2018-09-15 07:21:45 +02:00
Ronny Pfannschmidt
bceaede198 Merge pull request #3978 from nicoddemus/warn-yield-and-compat-properties
Actually deprecate long standing features
2018-09-15 07:19:59 +02:00
Bruno Oliveira
86a14d007d Fix scope determination with indirect parameters
Fix #3941
2018-09-14 21:33:59 -03:00
Bruno Oliveira
a4dd6ee3ce Fix linting 2018-09-14 17:31:01 -03:00
Bruno Oliveira
130cf7e0db Fix rendering of the ini example for python_files
Also added an example using one pattern per line
2018-09-14 17:27:25 -03:00
Bruno Oliveira
cbb41f1ae2 Ignore Sphinx's .doctrees folder 2018-09-14 16:00:35 -03:00
Bruno Oliveira
fa78da3c03 Update backward compatibility policy with new practices 2018-09-14 15:58:22 -03:00
Bruno Oliveira
ae8f3695b5 Move UnformattedWarning to _pytest.warning_types 2018-09-14 15:31:20 -03:00
Bruno Oliveira
87ddb2dbd5 Change flaky test_request_garbage to provide more debug information
This test fails *very* rarely when running in xdist.
2018-09-14 15:25:45 -03:00
Bruno Oliveira
9aa6b0903b .pytest_cache is now automatically ignored by Git 2018-09-14 15:16:40 -03:00
Bruno Oliveira
da6830f19b Introduce UnformattedWarning to keep warning types and messages in _pytest.deprecated 2018-09-14 14:49:05 -03:00
Bruno Oliveira
32ee0b9c88 Move warning messages to _pytest.deprecated 2018-09-13 15:56:50 -03:00
Bruno Oliveira
49800ea134 Merge pull request #3977 from RonnyPfannschmidt/remove-im-func
Remove im_func
2018-09-13 15:46:33 -03:00
Bruno Oliveira
feb8240410 Use self.Function again during collection 2018-09-13 15:44:02 -03:00
Bruno Oliveira
b7dd9154c3 Deprecate custom node types during collection by using special names 2018-09-13 14:55:28 -03:00
Bruno Oliveira
482bd5efd2 Show deprecation warning for cached_setup 2018-09-13 14:25:46 -03:00
Bruno Oliveira
bf074b37a3 Show deprecation warnings for compat properties
Fix #3616
2018-09-13 14:10:30 -03:00
Bruno Oliveira
495a55725b Separate deprecations and removals in the CHANGELOG 2018-09-13 14:02:01 -03:00
Bruno Oliveira
53c9124fc9 Merge pull request #3947 from nicoddemus/warnings-filter-precedence
-W now takes precedence over filters in ini files
2018-09-13 13:23:00 -03:00
Ronny Pfannschmidt
8fe55b1d18 add changelog for fix #3975 2018-09-13 15:40:45 +02:00
Ronny Pfannschmidt
a0ce9a4441 remove the legacy code about im_func and generalize using fix and compat.getimfunc 2018-09-13 15:38:36 +02:00
Daniel Hahler
2cf2dc3d95 Merge pull request #3967 from blueyed/optional-mock
tests: use unittest.mock with py34+
2018-09-13 07:36:42 +02:00
Daniel Hahler
7537e94ddf tests: use unittest.mock with py34+
Fixes https://github.com/pytest-dev/pytest/issues/3965.

Has to work around https://github.com/tox-dev/tox/issues/706.

No coverage for pluggymaster builds is OK though anyway.
2018-09-12 23:21:47 +02:00
Bruno Oliveira
ab40696007 -W now takes precedence over filters in ini files
Fix #3946
2018-09-11 19:00:42 +02:00
Anthony Sottile
2c90b3db9e Merge pull request #3957 from asottile/changelog_files
Improve pre-commit detection for changelog filenames
2018-09-08 10:58:50 -07:00
Anthony Sottile
826adafe2e Improve pre-commit detection for changelog filenames 2018-09-07 09:36:09 -07:00
Anthony Sottile
3dd2933dbd Merge pull request #3948 from nicoddemus/fix-changelog
Amend CHANGELOG with missing #3251
2018-09-07 09:15:09 -07:00
Ronny Pfannschmidt
d12f46caef Merge pull request #3949 from nicoddemus/merge-master-into-features
Merge master into features
2018-09-07 07:58:36 +02:00
Bruno Oliveira
b55351274e Amend CHANGELOG with missing #3251 2018-09-06 18:56:08 -03:00
Bruno Oliveira
c00d934b21 Merge pull request #3933 from nicoddemus/idval-hypothesis-flaky-3707
Use -n auto now that xdist behaves well in Travis and AppVeyor
2018-09-06 15:15:55 -03:00
Bruno Oliveira
6b526cbe6a Merge pull request #3943 from nicoddemus/no-coverage-on-deploy
Disable coverage during deployment stage
2018-09-06 15:15:32 -03:00
Bruno Oliveira
e0539e6ede Merge pull request #3942 from nicoddemus/merge-features-into-master
Merge features into master
2018-09-06 09:35:28 -03:00
Bruno Oliveira
5eb85efa14 Use -n auto now that xdist behaves well in Travis and AppVeyor
This hopefully fixes the flaky test_idval_hypothesis on AppVeyor

Fix #3707
2018-09-06 09:22:13 -03:00
Bruno Oliveira
9ee8d72fd2 Disable coverage during deployment stage
Otherwise it will fail as there's no coverage data to combine/publish
2018-09-06 09:18:47 -03:00
Bruno Oliveira
8c4ca383ca Merge remote-tracking branch 'upstream/features' into merge-features-into-master 2018-09-06 09:15:56 -03:00
Bruno Oliveira
f2a427da25 Merge pull request #3940 from nicoddemus/release-3.8.0
Release 3.8.0
2018-09-06 09:15:00 -03:00
Bruno Oliveira
e0466d0ad8 Merge pull request #3923 from nicoddemus/codecov
Add support for codecov in AppVeyor
2018-09-06 07:02:56 -03:00
Bruno Oliveira
418a66a09f Replace coveralls' badge by codecov's 2018-09-05 22:37:32 -03:00
Bruno Oliveira
5e2bd17d18 White list external "env" used by Travis for coverage 2018-09-05 22:37:32 -03:00
Bruno Oliveira
ec6fca4aa7 Add codecov support to AppVeyor and remove coveralls 2018-09-05 19:50:06 -03:00
Bruno Oliveira
1f20626618 Preparing release version 3.8.0 2018-09-05 21:06:32 +00:00
Bruno Oliveira
69b34f7658 Merge remote-tracking branch 'upstream/master' into release-3.8.0 2018-09-05 18:02:02 -03:00
Bruno Oliveira
531b76a513 Merge pull request #3931 from nicoddemus/internal-warnings
Use standard warnings for internal pytest warnings
2018-09-05 14:05:52 -03:00
Bruno Oliveira
f63c683faa No longer escape regex in pytest.mark.filterwarnings
Fix #3936
2018-09-05 10:20:25 -03:00
Ronny Pfannschmidt
410d5762c0 Merge pull request #3919 from fabioz/master
Improve import performance of assertion rewrite. Fixes #3918.
2018-09-05 14:33:40 +02:00
Bruno Oliveira
ddb308455a Make sure warn is called in test_parameterset_extractfrom 2018-09-05 09:01:29 -03:00
Bruno Oliveira
f42b5019ec Make code_or_warning parameter private for backward-compatibility 2018-09-04 18:53:58 -03:00
Bruno Oliveira
adc9ed85bc Fix test_idval_hypothesis 2018-09-04 18:49:20 -03:00
Bruno Oliveira
4592def14d Improve test_rewarn_functional 2018-09-04 17:02:56 -03:00
Bruno Oliveira
2e0a7cf78d Revert to having just "runtest" as "when" parameter of the pytest_warning_captured hook 2018-09-04 17:01:23 -03:00
Bruno Oliveira
5a52acaa92 Make config no longer optional in parametrize id functions 2018-09-04 16:55:52 -03:00
Bruno Oliveira
6d497f2c77 Fix stacklevel for warning about Metafunc.addcall 2018-09-04 16:50:24 -03:00
Bruno Oliveira
b7560a8808 Keep backward compatibility for code as kw in Node.warn 2018-09-04 16:48:21 -03:00
Bruno Oliveira
d3ca739c00 Use explicit instances when calling warnings.warn_explicit 2018-09-04 16:29:48 -03:00
Bruno Oliveira
3db76ccf3d Fix Cache.warn function to issue a "config" warning 2018-09-04 15:53:17 -03:00
Bruno Oliveira
438f7a1254 Add "setup", "call" and "teardown" values to "when" parameter of pytest_warning_captured hook 2018-09-04 15:53:17 -03:00
Bruno Oliveira
47bf58d69e Make Node.warn support two forms, new and deprecated
As suggested during review, it now accepts two forms:

Node.warn(warning_instance)  (recommended)

Node.warn(code, message)  (deprecated)
2018-09-04 15:53:17 -03:00
Bruno Oliveira
5ef51262f7 Fix reference to PytestWarning in warningsfilter mark 2018-09-04 15:06:14 -03:00
Bruno Oliveira
a054aa4797 Issue assert rewrite warning if tuple >=1 as suggested in review 2018-09-04 14:45:48 -03:00
Bruno Oliveira
f1cfd10c94 Handle cache warnings in tests 2018-09-04 14:44:02 -03:00
Bruno Oliveira
d3f72ca202 Fix linting for warnings.rst 2018-09-04 14:33:41 -03:00
Bruno Oliveira
022c58bf64 Revert pytest_terminal_summary(tryfirst) in warnings module as this breaks tests 2018-09-04 14:26:34 -03:00
Bruno Oliveira
b42518acd5 Change std_warn to receive a single warning instance, addressed review suggestions 2018-09-04 14:20:42 -03:00
Bruno Oliveira
284a2d110f Move warnings import to top level 2018-09-04 13:46:33 -03:00
Bruno Oliveira
9ae0a3cd85 Do not trigger warning about tuples being always True if the tuple has size != 2 2018-09-04 13:41:11 -03:00
Bruno Oliveira
615c671434 Connect string literals 2018-09-04 13:34:05 -03:00
Bruno Oliveira
29bfa5efa4 Merge pull request #3925 from crazymerlyn/fix-exit-code
Fix exit code for command line errors
2018-09-04 11:53:00 -03:00
Bruno Oliveira
016f8f1536 Improve get_fslocation_from_item's docstring 2018-09-04 11:48:11 -03:00
Bruno Oliveira
e9417be9df Add comment about deprecation warnings being shown by default 2018-09-04 11:35:35 -03:00
Bruno Oliveira
c304998ed7 Remove commented out code 2018-09-04 11:35:35 -03:00
Bruno Oliveira
415a62e373 Fix typo in PytestExperimentalApiWarning 2018-09-04 11:35:35 -03:00
Bruno Oliveira
8ce3aeadbf Move PytestExerimentalApiWarning to warning_types 2018-09-04 11:35:35 -03:00
Bruno Oliveira
b818314045 Improve docs for warnings capture and PEP-0506 remarks 2018-09-04 11:35:34 -03:00
Bruno Oliveira
56d414177a Remove nodeid from messages for warnings generated by standard warnings
Standard warnings already contain the proper location, so we don't need
to also print the node id
2018-09-04 11:35:34 -03:00
Bruno Oliveira
0fffa6ba2f Implement hack to issue warnings during config
Once we can capture warnings during the config stage, we can
then get rid of this function

Related to #2891
2018-09-04 11:35:34 -03:00
Bruno Oliveira
60499d221e Add test to ensure that users can suppress internal warnings 2018-09-04 11:35:34 -03:00
Bruno Oliveira
9965ed84da Show deprecation warnings by default if no other filters are configured
Fix #2908
2018-09-04 11:35:34 -03:00
Bruno Oliveira
7e13593452 Add CHANGELOG entries for #2452
Fix #2452
Fix #2684
2018-09-04 11:35:34 -03:00
Bruno Oliveira
208dd3aad1 Add docs for internal warnings and introduce PytestDeprecationWarning
Fix #2477
2018-09-04 11:35:34 -03:00
Bruno Oliveira
19a01c9849 Make PytestWarning and RemovedInPytest4Warning part of the public API 2018-09-04 11:35:34 -03:00
Bruno Oliveira
78ac7d99f5 Deprecate Config.warn and Node.warn, replaced by standard warnings 2018-09-04 11:35:34 -03:00
Bruno Oliveira
0c8dbdcd92 Fix existing tests now that we are using standard warnings 2018-09-04 11:35:34 -03:00
Bruno Oliveira
8e4501ee29 Use std_warn for warning about applying marks directly to parameters 2018-09-04 11:35:34 -03:00
Bruno Oliveira
0100f61b62 Start the laywork to capture standard warnings 2018-09-04 11:35:15 -03:00
Bruno Oliveira
1a9d913ee1 Capture and display warnings during collection
Fix #3251
2018-09-04 11:35:06 -03:00
Bruno Oliveira
51e32cf7cc Remove Python 2.6 specific warning 2018-09-04 11:35:06 -03:00
Bruno Oliveira
3fcc4cdbd5 Make terminal capture pytest_warning_capture
pytest_logwarning is no longer emitted by the warnings plugin,
only ever emitted from .warn() functions in config and item
2018-09-04 11:35:06 -03:00
Bruno Oliveira
ffd47ceefc Implement new pytest_warning_captured hook 2018-09-04 11:35:00 -03:00
Bruno Oliveira
10f21b423a Remove assert for "reprec" because this is no longer set on the pluginmanager
It seems this has no effect since `pluggy` was developed as a separate
library.
2018-09-04 11:35:00 -03:00
Bruno Oliveira
eec7081b8d Make AssertionRewritingrHook use imp_find_module 2018-09-03 10:18:25 -03:00
CrazyMerlyn
b01704cce1 Fix exit code for command line errors
Fixes #3913
2018-09-03 04:16:35 +00:00
Ronny Pfannschmidt
15ede8aab8 Merge pull request #3924 from nicoddemus/enable-pypy
Reenable pypy now that scandir can be installed without a compiler
2018-09-02 17:34:21 +02:00
Bruno Oliveira
f7dc9b9fef Merge pull request #3922 from nicoddemus/skip-xfail-docs-3219
Mention explicitly when pytest.skip and pytest.xfail can be called
2018-09-02 11:40:34 -03:00
Bruno Oliveira
dc13f0b469 Reenable pypy now that scandir can be installed without a compiler
Ref: benhoyt/scandir#105
Ref: #3111
2018-09-02 11:17:06 -03:00
Bruno Oliveira
a13c6a84df Mention explicitly when pytest.skip and pytest.xfail can be called
Fix #3219
2018-09-02 10:42:05 -03:00
Bruno Oliveira
dfa713163a Merge pull request #3921 from nicoddemus/use-constant
Use EXIT_USAGEERROR instead of magic number
2018-09-01 20:09:39 -03:00
Bruno Oliveira
90c00dfd54 Use EXIT_USAGEERROR instead of magic number 2018-09-01 12:03:28 -03:00
Daniel Hahler
f3b9b21996 Merge pull request #3920 from blueyed/branch
tests/CI: enable branch coverage
2018-09-01 16:52:12 +02:00
Bruno Oliveira
885b8a3b4c Fix linting 2018-09-01 11:13:40 -03:00
Bruno Oliveira
4675912d89 Add tests for early rewrite bailout code and handle patterns with subdirectories 2018-09-01 10:59:21 -03:00
Bruno Oliveira
495b44198f Merge pull request #3917 from dhirensr/docs_for_detailed_info
T3566,T3546: added a blurb in usage.rst for usage of flag -r
2018-09-01 10:09:29 -03:00
Bruno Oliveira
8d8e68cf90 Merge pull request #3911 from wimglenn/i18n_width
improve line width estimate
2018-09-01 08:57:44 -03:00
Bruno Oliveira
f3b0caf299 Improve docs for summary report and move it further up in the doc 2018-09-01 08:54:00 -03:00
Bruno Oliveira
75d29acc06 Fix reference to inter-sphinx objects database 2018-09-01 08:48:47 -03:00
Daniel Hahler
cbbb36fc9b tests/CI: enable branch coverage 2018-08-31 19:26:47 +02:00
Fabio Zadrozny
d53e449296 Improve performance of assertion rewriting. Fixes #3918 2018-08-31 12:27:08 -03:00
Ronny Pfannschmidt
01df368d93 Merge pull request #3914 from nicoddemus/merge-master-into-features
Merge master into features
2018-08-31 15:31:00 +02:00
Bruno Oliveira
2256f2f04d Remove test which is no longer required and improve test_lf_and_ff_prints_no_needless_message
* test_lf_and_ff_obey_verbosity is no longer necessary because
  test_lf_and_ff_prints_no_needless_message already checks if the proper messages
  are displayed when -q is used.

* Improve test_lf_and_ff_prints_no_needless_message so we also check that
  the correct message is displayed when there are failures to run
2018-08-31 08:01:55 -03:00
dhirensr
95881c870e T3566,T3546: added a blurb in usage.rst for usage of flag -r 2018-08-31 11:20:15 +05:30
Ronny Pfannschmidt
019e33ee3f Merge pull request #3915 from nicoddemus/quickstart-book-docs
Add pytest Quick Start Guide to the books section in the docs
2018-08-31 07:40:13 +02:00
Bruno Oliveira
19fa01b91d Tweak changelog 2018-08-30 21:17:14 -03:00
Bruno Oliveira
96aad2983b Move code to get width of current line to a function 2018-08-30 21:16:35 -03:00
wim glenn
c18a5b5179 try to be backwards compat 2018-08-30 19:06:20 -05:00
wim glenn
ed4b94a180 add changelog entry 2018-08-30 18:59:58 -05:00
wim glenn
29c5ac71bc improve line width estimate 2018-08-30 18:59:58 -05:00
Bruno Oliveira
84a9f7a263 Add pytest Quick Start Guide to the books section in the docs 2018-08-30 20:18:51 -03:00
Bruno Oliveira
11e591e442 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-08-30 19:55:23 -03:00
Bruno Oliveira
64f00683f2 Merge pull request #3912 from dhirensr/needless_message
Needless message printed with --failed-first and no failed tests #3853
2018-08-30 19:51:49 -03:00
Bruno Oliveira
84a033fd97 Remove extra newline 2018-08-30 19:48:47 -03:00
Bruno Oliveira
0183d46275 Improve CHANGELOG a bit 2018-08-30 19:44:04 -03:00
Bruno Oliveira
9bd4b0a05e Merge pull request #3910 from hoefling/docfix
doc fix: raises accepts tuples instead of lists
2018-08-30 19:41:44 -03:00
Bruno Oliveira
f0e852b4db Merge pull request #2800 from blueyed/coverage
Travis: report coverage with all builds
2018-08-30 19:41:22 -03:00
dhirensr
ade01b1f5b T3853:Added changelog file 2018-08-30 16:03:18 +05:30
dhirensr
3035b2724d T3853:removed needless message printed with --failed-first,--last-failed and no failed tests 2018-08-30 16:01:42 +05:30
hoefling
8c96eea583 doc fix: raises accepts tuples instead of lists (fixes #3907) 2018-08-30 00:19:59 +02:00
Bruno Oliveira
338953a25d Merge pull request #3908 from nicoddemus/optimize-release
Skip the "test" stage when making a release
2018-08-29 18:53:36 -03:00
Anthony Sottile
f1bd46266b Merge pull request #3909 from asottile/update_release
Update release procedure
2018-08-29 14:37:52 -07:00
Anthony Sottile
77cad3c436 Update release procedure [ci skip] 2018-08-29 14:13:08 -07:00
Bruno Oliveira
3ca70692de Skip the "test" stage when making a release
Given that our guidelines demand that the CI have already passed, it seems
wasteful to run all those jobs again for the exact same commit.

As discussed in https://github.com/pytest-dev/pytest/pull/3906#issuecomment-417094481,
this will skip the "test" stage when building a tag for deployment.
2018-08-29 17:54:58 -03:00
Daniel Hahler
417516c378 squash! Travis: report coverage with all builds
doctesting: remove changedir

With coverage 5 we could use COVERAGE_RCFILE to make it find the
.coveragerc, or we could add `--rcfile` to _PYTEST_TOX_COVERAGE_RUN, but
I've thought that this should not be the job that has to test if
`--pyargs` actually works.
2018-08-29 22:53:20 +02:00
Daniel Hahler
f730291e67 Travis: report coverage with all builds
- Skips pypy for coverage, reports only py37 to coveralls
- tox: allow for TOXENV=py37-coverage
- tracks coverage in subprocesses, using coverage-enable-subprocess, and
  parallel=1
- removes usedevelop with doctesting to match `--source` being used with
  coverage
- keep coveralls for now, used with AppVeyor
2018-08-29 22:30:28 +02:00
Anthony Sottile
d76fb8345c Merge pull request #3906 from asottile/release-3.7.4
Preparing release version 3.7.4
2018-08-29 13:03:34 -07:00
Anthony Sottile
aea962dc21 Preparing release version 3.7.4 2018-08-29 08:57:54 -07:00
Bruno Oliveira
4345efaffc Merge pull request #3902 from stevepiercy/fix-pytest.org-links
Fix pytest.org links
2018-08-29 08:20:01 -03:00
Bruno Oliveira
bf47033169 Fix linting 2018-08-28 21:05:34 -03:00
Steve Piercy
37a65684d6 add changelog entry 2018-08-28 14:51:27 -07:00
Steve Piercy
eab5020e24 Fix hostname 2018-08-28 14:45:04 -07:00
Steve Piercy
8ef21f56d3 Fix 404 2018-08-28 14:42:16 -07:00
Steve Piercy
103d980b2d Use https, save a redirect 2018-08-28 14:41:13 -07:00
Steve Piercy
28c3ef1c77 Use https, save a redirect, fix hostname 2018-08-28 14:40:20 -07:00
Steve Piercy
67c3c28877 Use https, save a redirect 2018-08-28 14:39:32 -07:00
Steve Piercy
e040fd20a3 Use https, save a redirect 2018-08-28 14:38:55 -07:00
Steve Piercy
00e0b43010 Use https, save a redirect 2018-08-28 14:36:47 -07:00
Steve Piercy
f19cfbb825 Fix 404 to a somewhat better historical note 2018-08-28 14:35:08 -07:00
Steve Piercy
bde3d1a0cd Use https; save a redirect 2018-08-28 14:34:39 -07:00
Steve Piercy
2e090896d5 Use https 2018-08-28 14:34:22 -07:00
Steve Piercy
b0a32da0b5 Use https; save a redirect 2018-08-28 14:27:11 -07:00
Bruno Oliveira
10c1c7c41a Merge pull request #3895 from nicoddemus/issue-3506
Avoid possible infinite recursion when writing pyc files in assert rewrite
2018-08-28 18:16:10 -03:00
Daniel Hahler
16f452ef98 Merge pull request #3894 from blueyed/baseline
Travis: add baseline stage
2018-08-28 22:19:08 +02:00
Bruno Oliveira
b77e533693 Merge pull request #3893 from jirikuncar/3892-macos
travis: run tests on macOS
2018-08-28 17:06:17 -03:00
Bruno Oliveira
a605ad4d11 Merge pull request #3880 from jeffreyrack/3829-progress_display_mode
#3829 -- Add the ability to show test progress as number of tests completed instead of a percent.
2018-08-28 16:54:14 -03:00
Jeffrey Rackauckas
4b94760c8e Removed spacing in count display. 2018-08-27 20:23:17 -07:00
Bruno Oliveira
82a7ca9615 Avoid possible infinite recursion when writing pyc files in assert rewrite
What happens is that atomic_write on Python 2.7 on Windows will try
to convert the paths to unicode, but this triggers the import of
the encoding module for the file system codec, which in turn triggers
the rewrite, which in turn again tries to import the module, and so on.

This short-circuits the cases where we try to import another file when
writing a pyc file; I don't expect this to affect anything because
the only modules that could be affected are those imported by
atomic_writes.

Fix #3506
2018-08-27 21:29:45 -03:00
Bruno Oliveira
23295e1e98 Fix docs linting 2018-08-27 20:21:08 -03:00
Bruno Oliveira
32575f92c9 set TOXENV in test-macos template otherwise it will inherit "coveralls" 2018-08-27 20:07:51 -03:00
Bruno Oliveira
a260e58020 Drop 3.6 from OS-X to reduce build time 2018-08-27 20:03:12 -03:00
Bruno Oliveira
b2f7e02a02 Reorganize osx environments to avoid repetition as suggested in review 2018-08-27 20:02:16 -03:00
Bruno Oliveira
29e114b463 Try to fix test in MacOS-X 2018-08-27 19:27:51 -03:00
Bruno Oliveira
2a059b1c1b Merge pull request #3885 from nicoddemus/bad-output-classic
Fix bad console output when using console_output_style=classic
2018-08-27 19:07:02 -03:00
Daniel Hahler
cdc72bf5a3 Travis: add baseline stage
Fixes https://github.com/pytest-dev/pytest/issues/3876.
2018-08-27 23:46:24 +02:00
Jiri Kuncar
f786335dbb travis: run tests on macOS
closes #3892
2018-08-27 17:22:27 +02:00
Jiri Kuncar
ab5af524a4 Fix macOS specific code that uses capturemanager.
https://github.com/pytest-dev/pytest/issues/3888#issuecomment-416206606

closes #3888

Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2018-08-27 16:07:59 +02:00
Bruno Oliveira
9620b167d9 Merge pull request #3887 from asottile/improve_test_code
Improve the coverage of testing/code
2018-08-27 07:20:45 -03:00
Jeffrey Rackauckas
8f4685e024 Move count display style to be part of console_output_style, fixed test progress for count console output style. 2018-08-26 19:21:00 -07:00
Anthony Sottile
10544c4cb8 Merge pull request #3886 from nicoddemus/ff-quiet
Cache now obeys -q when showing summary for --lf and --ff
2018-08-26 18:32:22 -07:00
Anthony Sottile
1e8e17c01e Improve the coverage of testing/code 2018-08-26 16:13:22 -07:00
Bruno Oliveira
80eef29681 Merge pull request #3884 from nicoddemus/merge-master-into-features
Merge master into features
2018-08-26 19:41:30 -03:00
Bruno Oliveira
47bb53f5cb Cache now obeys -q when showing summary for --lf and --ff
Related to #3853
2018-08-26 18:08:19 -03:00
Bruno Oliveira
6991a16edb Fix bad console output when using console_output_style=classic
Fix #3883
2018-08-26 17:12:55 -03:00
Bruno Oliveira
2f2d5861bb Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-08-26 16:45:00 -03:00
Bruno Oliveira
a31967431f Merge pull request #3882 from nicoddemus/release-3.7.3
Release 3.7.3
2018-08-26 16:41:40 -03:00
Bruno Oliveira
e74ad4ff9b Fix typo in CHANGELOG 2018-08-26 12:27:02 -03:00
Bruno Oliveira
70bdacf01a Fix collection example docs 2018-08-26 12:58:47 +00:00
Bruno Oliveira
b69f853acb Tweak CHANGELOG for 3.7.3 2018-08-26 09:46:46 -03:00
Bruno Oliveira
c31018d9bc Preparing release version 3.7.3 2018-08-26 12:43:43 +00:00
Bruno Oliveira
7ae23901d3 Merge pull request #3881 from GandalfSaxe/patch-2
Code block: :: missing and 4 spaces instead of 5
2018-08-26 09:22:30 -03:00
Bruno Oliveira
4d19b94347 Merge pull request #3877 from blueyed/codecov-master
tox: coveralls: also report to codecov
2018-08-26 09:19:03 -03:00
Bruno Oliveira
c15b537e3d Merge pull request #3878 from asottile/skip_install_linting
Use skip_install for testing tox env
2018-08-26 09:17:40 -03:00
Bruno Oliveira
2577a6ce8a Merge pull request #3873 from nicoddemus/sys-path-fix
Remove dangerous sys.path manipulations in test_pluginmanager
2018-08-26 08:53:57 -03:00
Bruno Oliveira
dd5f5ca4cb Merge pull request #3872 from nicoddemus/tests-in-init-files
Collect tests from __init__.py files if they match 'python_files'
2018-08-26 08:50:17 -03:00
Gandalf Saxe
508774742e Code block: :: missing and 4 spaces instead of 5
I just noticed the newly committed code block doesn't format as a code block without `::` in the paragraph before. Perhaps doesn't make a difference, but also corrected 5 spaces to 4 which seems standard.
2018-08-26 11:54:08 +02:00
Jeffrey Rackauckas
2a917a582e Removing accidental change to test 2018-08-25 22:21:50 -07:00
Jeffrey Rackauckas
325319dc3b Fixing xdist test to properly configure an ini file. 2018-08-25 22:18:29 -07:00
Jeffrey Rackauckas
dda5e5ea32 Fixing backticks in changelog file. 2018-08-25 21:55:00 -07:00
Jeffrey Rackauckas
5e260c4d34 Fixing changelog file. 2018-08-25 21:50:19 -07:00
Daniel Hahler
d3f5324386 tox: coveralls: also report to codecov
This is meant to get base coverage on master for codecov.
2018-08-26 02:14:22 +02:00
Anthony Sottile
3da88d794f Use skip_install for testing tox env 2018-08-25 16:48:01 -07:00
Bruno Oliveira
71b4995775 Merge pull request #3874 from blueyed/improve-pre-commit
Travis: use TOXENV=linting for linting stage
2018-08-25 20:14:27 -03:00
Bruno Oliveira
b0541e9d31 Correctly restore sys.path in test and remove dead code in test_pytester
The code in test_pytester has been refactored into a class right
above the dead code, and the code has been left there by mistake
apparently.
2018-08-25 18:17:52 -03:00
Daniel Hahler
415fcb912b Travis: use TOXENV=linting for linting stage
This will run it with `--show-diff-on-failure` then, and helps to keep
it in line / in a central place.
2018-08-25 23:14:09 +02:00
Bruno Oliveira
f872fcb5d0 Remove dangerous sys.path manipulations in test_pluginmanager
Noticed these while working in something else
2018-08-25 17:33:29 -03:00
Bruno Oliveira
de6f2c0336 Collect tests from __init__.py files if they match 'python_files'
Fix #3773
2018-08-25 11:18:52 -03:00
Bruno Oliveira
be4b359c74 Merge pull request #3861 from jonozzz/fix-3854
Fix #3854
2018-08-25 10:44:08 -03:00
Bruno Oliveira
72a58bbafe Merge pull request #3871 from schmamps/cmdclass
Correct cmdclass for doc: Good Integration Practices
2018-08-24 22:09:35 -03:00
turturica
c336449729 Make linting happy. Argh. 2018-08-24 18:05:35 -07:00
turturica
1e4ecda884 Fix the package fixture ordering in Windows. 2018-08-24 18:01:38 -07:00
turturica
8cf0e46bbf test_package_ordering: Collect *.py, but keep a mix of case for filenames. The test doesn't make sense for Windows, because of its case-insensitivity. 2018-08-24 16:23:50 -07:00
Bruno Oliveira
f0226e9329 Fix test_package_ordering on Windows 2018-08-24 20:15:33 -03:00
turturica
dce8df45d5 Added changelog items. 2018-08-24 15:51:42 -07:00
Andrew Champion
f6948597e4 add to changelog 2018-08-24 12:29:18 -07:00
turturica
e3df1031ca Add encoding: utf8 for python 2.7 2018-08-24 12:26:18 -07:00
Andrew Champion
14ffadf004 correct cmdclass 2018-08-24 12:07:22 -07:00
turturica
459b040d21 Fix dedent after merge. 2018-08-24 11:54:04 -07:00
turturica
3396225f74 Merge branch 'master' of github.com:pytest-dev/pytest into fix-3854 2018-08-24 11:47:24 -07:00
Bruno Oliveira
c82906105c Merge pull request #3865 from GandalfSaxe/patch-1
Move information on `pip install -e` to the top
2018-08-24 07:28:51 -03:00
Anthony Sottile
4c14740798 Merge pull request #3868 from asottile/bytes_py26_plus
Use `bytes` directly instead of `binary_type`
2018-08-23 23:16:59 -07:00
Jeffrey Rackauckas
5fefc48f33 Fixing pre-commit hooks 2018-08-23 23:00:02 -07:00
turturica
72e6482994 Make linting happy. 2018-08-23 22:58:36 -07:00
Jeffrey Rackauckas
93f783228c Add the progress_display_mode ini option 2018-08-23 22:56:25 -07:00
turturica
5f8b50c094 Address #3796 and add a test for it. 2018-08-23 22:48:44 -07:00
Anthony Sottile
99e31f6fb1 Use bytes directly instead of binary_type
`bytes` is an alias for `str` in python2.6+
2018-08-23 18:55:21 -07: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
Bruno Oliveira
40b4fe64af Fix linting 2018-08-23 22:11:17 -03:00
Bruno Oliveira
d10d59c013 Merge pull request #3858 from mimi1vx/test_mock
Use unittest.mock if is only aviable
2018-08-23 19:02:39 -03:00
wim glenn
d54aa8ce13 Merge pull request #3848 from wimglenn/pytester_unicode_bugfixes
fixed a bunch of unicode bugs in pytester.py
2018-08-23 13:45:49 -05:00
Anthony Sottile
52fa8c98bb Merge pull request #3864 from asottile/source_to_dedent
Replace Source with dedent where possible
2018-08-23 10:45:11 -07:00
Gandalf Saxe
3f336869e2 Move information on pip install -e to the top
Should fix complaints in #2421.
2018-08-23 18:07:28 +02:00
Anthony Sottile
85482d575e Replace Source with dedent where possible 2018-08-23 09:06:17 -07:00
Bruno Oliveira
6f7365509d Merge pull request #3860 from asottile/purge_more_py
Purge more usage of `py` module
2018-08-23 06:05:32 -03:00
Anthony Sottile
7099ea9bb0 py.builtin._reraise -> six.reraise 2018-08-22 23:00:58 -07:00
Anthony Sottile
dccac69d82 py.builtin.text -> six.text_type 2018-08-22 23:00:06 -07:00
Anthony Sottile
c2cd337886 py.builtin.exec_ => six.exec_ 2018-08-22 23:00:06 -07:00
Anthony Sottile
0fc4a806e5 py.builtins._totext -> string literals or six.text_type 2018-08-22 23:00:04 -07:00
turturica
4d3c1ab4f0 Fixes #3854 2018-08-22 21:42:59 -07:00
turturica
e4f76f6350 Merge branch 'master' of github.com:pytest-dev/pytest into fix-3854 2018-08-22 20:36:52 -07:00
Anthony Sottile
0d65783dce Fix unicode errors when changing to .format(...) 2018-08-22 19:00:43 -07:00
Anthony Sottile
8bb8b91357 pyupgrade 1.4: tests 2018-08-22 18:47:21 -07:00
Bruno Oliveira
8804c7333a Fix CHANGELOG formatting 2018-08-22 20:06:13 -03:00
Bruno Oliveira
17eec5b97e Merge pull request #3856 from jennirinker/master
Resolving Issue #3824
2018-08-22 19:03:55 -03:00
Ondřej Súkup
cd07c4d4ff Use unittest.mock if is only aviable
from Python 3.3 is mock part of python standard library in unittest namespace
2018-08-22 23:49:40 +02:00
wim glenn
917b99e438 More unicode whack-a-mole
It seems pytest's very comprehensive CI sniffed out a few other places with similar bugs.  Ideally we should find all the places where args are not stringy and solve it at the source, but who knows how many people are relying on the implicit string conversion.  See [here](https://github.com/pytest-dev/pytest/blob/master/src/_pytest/config/__init__.py#L160-L166) for one such problem area (args with a single py.path.local instance is converted here, but a list or tuple containing some are not).
2018-08-22 13:40:21 -05:00
wim glenn
b08e156b79 strip trailing whitespace 2018-08-22 11:27:36 -05:00
wim glenn
8e2c7b4979 Add a failing testcase for PR #3848 2018-08-22 11:00:51 -05:00
Bruno Oliveira
5a7aa123ea Improve docs formatting 2018-08-22 11:22:30 -03:00
Jennifer Rinker
a12eadd9ef resolving Issue #3824 - expanding docs 2018-08-22 15:37:35 +02:00
Bruno Oliveira
2137e2b15b Merge pull request #3846 from nicoddemus/issue-3843
Fix collection error when tests is specified with --doctest-modules
2018-08-22 08:17:07 -03:00
wim glenn
89446af51e fixed a bunch of unicode bugs in pytester.py 2018-08-22 01:30:23 -05:00
Ronny Pfannschmidt
3b521bedf8 Merge pull request #3841 from sankt-petersbug/fix-3816
Fix '--show-capture=no' capture teardown logs
2018-08-22 07:16:53 +02:00
Ronny Pfannschmidt
5b2c8fa007 Merge pull request #3845 from natanlao/patch-1
Remove warning about #568 from documentation
2018-08-22 07:12:40 +02:00
Bruno Oliveira
eb8d145195 Add link to issue in the CHANGELOG entry 2018-08-21 21:08:21 -03:00
Natan Lao
80bea79512 Add changelog entry 2018-08-21 17:04:56 -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
Natan Lao
717775a1c6 Remove warning about #568 from documentation
The documentation (https://docs.pytest.org/en/latest/skipping.html) references
issue #568, which has since been fixed.
2018-08-21 16:57:33 -07:00
Bruno Oliveira
672f4bb5aa Improve CHANGELOG 2018-08-21 20:19:48 -03:00
Bruno Oliveira
f1079a8222 Merge pull request #3832 from Sup3rGeo/bugfix/capsys-with-cli-logging
Bugfix/capsys with cli logging (again)
2018-08-21 20:12:31 -03:00
Bruno Oliveira
044d2b8e6e Merge pull request #3838 from wimglenn/runresult_xfail
Support xfailed and xpassed outcomes in RunResult.
2018-08-20 20:01:51 -03:00
Sankt Petersbug
223eef6261 Fix '--show-capture=no' capture teardown logs
Add a check before printing teardown logs.

'print_teardown_sections' method does not check '--show-capture' option
value, and teardown logs are always printed.

Resolves: #3816
2018-08-20 15:01:21 -05:00
Bruno Oliveira
43657f252f Merge pull request #3830 from nicoddemus/capfd-fixture-capture
Fixtures during teardown can use capsys and capfd to get output from tests
2018-08-20 15:32:45 -03:00
Victor
70ebab3537 Renamed snap_global_capture to read_global_capture. 2018-08-20 17:48:14 +02:00
Ronny Pfannschmidt
d3bdfc704b Merge pull request #3839 from asottile/more_flexible
Use more flexible `language_version: python3`
2018-08-20 16:13:31 +02:00
Anthony Sottile
4de247cfa0 Use more flexible language_version: python3 2018-08-20 06:27:35 -07:00
Victor
d611b03589 Parametrized tests for capfd as well. Separated global capture test. 2018-08-20 12:23:59 +02:00
Anthony Sottile
308d789d92 Merge pull request #3835 from wimglenn/issue3833
more autodocs for pytester
2018-08-20 00:30:28 -07:00
wim glenn
539a22c750 Added support for xfailed and xpassed outcomes to the `pytester.RunResult.assert_outcomes` signature. 2018-08-20 01:24:19 -05:00
wim glenn
e4bea9068b end of line for this file, perhaps? 2018-08-19 23:39:10 -05:00
wim glenn
e620798d33 more autodocs for pytester 2018-08-19 23:21:45 -05:00
victor
7ea4992f16 Fixed linting. 2018-08-19 15:46:02 +02:00
victor
0564b52c0e Fixed integration with other modules/tests 2018-08-19 15:26:57 +02:00
victor
8b2c91836b Fixed activation and used just runtest_protocol hook 2018-08-19 14:30:50 +02:00
victor
9e382e8d29 Fixed test. 2018-08-19 14:29:57 +02:00
victor
2255892d65 Improved test to cover more cases. 2018-08-19 13:44:12 +02:00
victor
7d9b198f73 Refactoring: Separated suspend from snapping (stopped always snapping when suspending - solves bug but still missing tests), reorganized functions and context managers. 2018-08-19 02:32:36 +02:00
Bruno Oliveira
a6cdd0d9da Merge pull request #3831 from nicoddemus/merge-master-into-features
Merge master into features
2018-08-18 19:43:36 -03:00
Bruno Oliveira
c64a8c9c7f Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-08-18 15:54:53 -03:00
Bruno Oliveira
f4c5994d27 Fixtures during teardown can use capsys and capfd to get output from tests
Fix #3033
2018-08-18 14:46:24 -03:00
Tyler Richard
c24c7e75e2 Added regression test for capfd in a fixture 2018-08-18 14:11:04 -03:00
Tyler Richard
273670b2a2 Fixes capfd so data is available after teardown. 2018-08-18 14:11:04 -03:00
Bruno Oliveira
28aff051ab Merge pull request #3822 from Sup3rGeo/bugfix/capsys-with-cli-logging
Bugfix/capsys with cli logging
2018-08-18 14:06:27 -03:00
Bruno Oliveira
29975e5b37 Merge pull request #3827 from Vlad-Shcherbina/funcfixtureinfo-type-hints
Replace broken type annotations with type comments
2018-08-18 12:54:47 -03:00
Bruno Oliveira
5cf7d1dba2 "suspend" method of capture fixture private
Also change the context-manager to global_and_fixture_disabled to
better convey its meaning
2018-08-18 11:38:08 -03:00
Bruno Oliveira
2fe824b8c4 Merge pull request #3821 from nicoddemus/release-3.7.2
Preparing release version 3.7.2
2018-08-18 11:18:18 -03:00
Bruno Oliveira
f674217c43 Moved dummy_context_manager to compat module 2018-08-18 11:15:58 -03:00
Bruno Oliveira
9f7345d663 Avoid leaving a reference to the last item on CaptureManager 2018-08-18 11:08:03 -03:00
victor
eb2d074530 Black changes. 2018-08-18 14:27:09 +02:00
victor
9fa7745795 Refactor, tests passing. 2018-08-18 13:40:08 +02:00
victor
14db2f91ba Fixed global not called if no capsys fixture. Using now capsys context manager as well. 2018-08-18 12:16:47 +02:00
Vlad Shcherbina
c3e494f6cf Replace broken type annotations with type comments
Fixes #3826.
2018-08-18 01:05:30 +03:00
Victor
090f67a980 Refactored implementation and updated tests. 2018-08-17 13:41:26 +02:00
Victor
3059bfb1b3 Update test with another problem. 2018-08-17 13:00:27 +02:00
Victor
e391c47ed8 Update capture suspend test for logging. 2018-08-17 00:44:15 +02:00
Victor
f66764e1c0 Added changelog and updated AUTHORS. 2018-08-17 00:33:56 +02:00
Bruno Oliveira
e0b088b52e Changelog tweaks 2018-08-16 19:32:41 -03:00
Bruno Oliveira
e5a3c870b4 Preparing release version 3.7.2 2018-08-16 22:29:00 +00:00
Victor
2b71cb9c38 Added activation/deactivation of capture fixture in logging emit. 2018-08-17 00:26:12 +02:00
Victor
da9d814da4 Added test. 2018-08-17 00:20:51 +02:00
Ronny Pfannschmidt
7d4c4c66d4 Merge pull request #3805 from asottile/cause_cycles
Fix traceback reporting for exceptions with `__cause__` cycles.
2018-08-16 07:16:51 +02:00
Ronny Pfannschmidt
939a792c41 Merge pull request #3798 from jonozzz/fix-3751
Fix #3751
2018-08-16 06:52:16 +02:00
Anthony Sottile
17644ff285 Fix traceback reporting for exceptions with __cause__ cycles. 2018-08-15 18:15:07 -07:00
Bruno Oliveira
64faa41d06 Merge pull request #3802 from jonozzz/fix-3768
Fix test collection from packages mixed with directories. #3768 and #3789
2018-08-15 21:42:25 -03:00
Anthony Sottile
ca1bb9a3a1 Merge pull request #3815 from sankt-petersbug/fix-3671
Fix #3671 - `filterwarnings` Is an Unregistered Marker
2018-08-15 17:07:46 -07:00
Sankt Petersbug
78ef531420 corrected the position of myname 2018-08-14 20:33:55 -05:00
Sankt Petersbug
212ee450b7 simplified test function 2018-08-14 20:29:42 -05:00
Sankt Petersbug
c1c08852f9 lint checks 2018-08-14 19:54:51 -05:00
Sankt Petersbug
e06a077ac2 added changelog 2018-08-14 16:16:37 -05:00
Sankt Petersbug
cb77e65c97 updated AUTHORS 2018-08-14 16:16:25 -05:00
Sankt Petersbug
6367f0f5f1 fix filterwarnings mark not registered 2018-08-14 16:13:15 -05:00
Daniel Hahler
b88e09a697 Merge pull request #3548 from blueyed/fix-docs
tox: clean up docs target
2018-08-14 15:22:46 +02:00
Ronny Pfannschmidt
68bbd42213 Merge pull request #3795 from nicoddemus/changelog-3774
Add CHANGELOG for issue #3774, missing from PR #3780
2018-08-14 09:32:20 +02:00
Ronny Pfannschmidt
22ee2093b8 Merge pull request #3801 from nicoddemus/improve-warning-addoption
Improve warning messages when addoption is called with string as `type`
2018-08-14 09:30:17 +02:00
Anthony Sottile
87a99275fb Merge pull request #3807 from anowlcalledjosh/metafunc-config-doc
Unhide documentation for metafunc.config
2018-08-13 15:32:43 -07:00
Josh Holland
abbd7c30a4 Unhide documentation for metafunc.config
Fixes #3746.
2018-08-11 20:48:55 +01:00
Bruno Oliveira
abae60c8d0 Add CHANGELOG entries 2018-08-10 22:04:42 -03:00
turturica
e92893ed24 Add test for packages mixed with modules. 2018-08-10 17:29:30 -07:00
Bruno Oliveira
27b5435a40 Fix docs formatting and improve test a bit 2018-08-10 18:19:07 -03:00
turturica
50db718a6a Add a test description. 2018-08-10 13:57:29 -07:00
turturica
bfd0addaeb Fix test collection from packages mixed with directories. #3768 and #3789 2018-08-10 12:56:08 -07:00
Bruno Oliveira
be11d3e195 Improve warning messages when addoption is called with string as type
Encountered the warning myself and to me the message was not clear about
what should be done to fix the warning
2018-08-10 12:49:06 -03:00
turturica
266f05c4c4 Fix #3751 2018-08-09 18:28:22 -07:00
turturica
d0bd01beca Collect any tests from a package's __init__.py 2018-08-09 18:06:38 -07:00
Bruno Oliveira
220288ac77 Add CHANGELOG for issue #3774, missing from PR #3780 2018-08-09 12:33:02 -03:00
Bruno Oliveira
4d8903fd0b Merge pull request #3780 from nicoddemus/mock-integration-fix
Fix issue where fixtures would lose the decorated functionality
2018-08-09 12:26:09 -03:00
Bruno Oliveira
67106f056b Use a custom holder class so we can be sure __pytest_wrapper__ was set by us 2018-08-09 09:22:00 -03:00
Ronny Pfannschmidt
5d3c5123f8 Merge pull request #3792 from decisio/pr-3788-fix-teardown-exception
Pr 3788 fix teardown exception
2018-08-09 06:53:22 +02:00
Bruno Oliveira
5f97711377 Merge pull request #3787 from hsoft/no-plugin-autoload
Add option to disable plugin auto-loading
2018-08-08 21:30:50 -03:00
Bruno Oliveira
74d9f56d0f Improve CHANGELOG a bit 2018-08-08 21:24:14 -03:00
Wes Thomas
051db6a33d Trimming Trailing Whitespace 2018-08-08 18:18:18 -05:00
Wes Thomas
aa358433b0 Fix AttributeError bug in TestCaseFunction.teardown by creating TestCaseFunction._testcase as attribute of class with a None default. 2018-08-08 18:13:21 -05:00
Virgil Dupras
126896f69d Add option to disable plugin auto-loading
If `PYTEST_DISABLE_PLUGIN_AUTOLOAD` is set, disable auto-loading of
plugins through setuptools entrypoints. Only plugins that have been
explicitly specified are loaded.

ref #3784.
2018-08-07 13:16:28 -04:00
Bruno Oliveira
e723069165 Merge pull request #3771 from nicoddemus/package-infinite-recursion-bug
Fix infinite recursion collection bug with pytest_ignore_collect hook
2018-08-06 10:09:31 -03:00
Bruno Oliveira
855fd17014 Merge pull request #3779 from nicoddemus/changelog-title
Add a changelog blurb and title, similar to tox
2018-08-05 18:03:57 -03:00
Bruno Oliveira
d11781920b Merge pull request #3782 from nicoddemus/pytest-non-functions
Only consider actual functions when collecting hooks
2018-08-05 09:07:01 -03:00
Bruno Oliveira
2c0d2eef40 Only consider actual functions when considering hooks
Fix #3775
2018-08-04 16:37:07 -03:00
Bruno Oliveira
ef8ec01e39 Fix issue where fixtures would lose the decorated functionality
Fix #3774
2018-08-04 15:14:00 -03:00
Bruno Oliveira
0a1c2a7ca1 Add a changelog blurb and title, similar to tox 2018-08-04 13:15:20 -03:00
Bruno Oliveira
fe0a76e1a6 Fix recursion bug if a pytest_ignore_collect returns False instead of None 2018-08-03 15:40:33 -03:00
Bruno Oliveira
dcafb8c48c Add example for package recursion bug 2018-08-03 15:40:33 -03:00
Bruno Oliveira
a76cc8f8c4 Add changelog for #3742
This was missing from PR #3751
2018-08-02 15:28:26 -03:00
Bruno Oliveira
4d2fa581e1 Merge pull request #3769 from nicoddemus/release-3.7.1
Preparing release version 3.7.1
2018-08-02 15:21:48 -03:00
Bruno Oliveira
f7a3f45a18 Preparing release version 3.7.1 2018-08-02 12:04:39 +00:00
Daniel Hahler
dff7b203f7 tox: clean up docs target 2018-08-02 13:07:03 +02:00
Anthony Sottile
4705fd2bbe Merge pull request #3765 from asottile/require_changelog_rst
Enforce that changelog files are .rst
2018-08-01 23:47:09 -07:00
Ronny Pfannschmidt
ca0476953e Merge pull request #3751 from nicoddemus/collect-file-bug
Workaround for #3742
2018-08-02 07:35:46 +02:00
Ronny Pfannschmidt
7e92930fa9 Merge pull request #3764 from asottile/fix_3763
Fix `TypeError` when the assertion message is `bytes` in python 3.
2018-08-02 07:19:51 +02:00
Ronny Pfannschmidt
33769d0328 Merge pull request #3754 from nicoddemus/fix-function-call-warning
Refactor direct fixture call warning to avoid incompatibility with plugins
2018-08-02 07:17:15 +02:00
Bruno Oliveira
5db2e6c7a1 Merge pull request #3761 from nicoddemus/numpy-recursion-error
Fix recursion in pytest.approx() with arrays in numpy<1.13
2018-08-01 23:40:30 -03:00
Bruno Oliveira
804fc4063a Merge pull request #3741 from kalekundert/approx_misc_tweaks
Miscellaneous improvements to approx()
2018-08-01 23:40:21 -03:00
Bruno Oliveira
82a2174867 Fix typo in CHANGELOG 2018-08-01 20:11:16 -03:00
Anthony Sottile
a80e031c62 Enforce that changelog files are .rst 2018-08-01 15:22:43 -07:00
Anthony Sottile
452e5c1cf0 Fix TypeError when the assertion message is bytes in python 3. 2018-08-01 15:09:25 -07:00
Bruno Oliveira
c6b11b9f62 Refactor direct fixture call warning to avoid incompatibility with plugins
This refactors the code so we have the real function object right during
collection. This avoids having to unwrap it later and lose attached information
such as "async" functions.

Fix #3747
2018-08-01 16:38:43 -03:00
Kale Kundert
b8255308d6 Make the infinite-recusrion fix more explicit.
So we remember what happened and don't accidentally regress in the
future.
2018-08-01 12:11:03 -07:00
Bruno Oliveira
a5c0fb7f6b Rename recursive_map -> _recursive_list_map as requested in review 2018-08-01 15:17:58 -03:00
Bruno Oliveira
f25683354e Merge pull request #3760 from RonnyPfannschmidt/fix-3757-pin-pathlib
fix #3757 by pinning to pathlib2 that supports __fspath__
2018-08-01 09:44:30 -03:00
Bruno Oliveira
7d13599ba1 Fix recursion in pytest.approx() with arrays in numpy<1.13 2018-08-01 08:04:09 -03:00
Bruno Oliveira
43664d7841 Use ids for parametrized values in test_expected_value_type_error 2018-08-01 07:34:08 -03:00
Bruno Oliveira
2a2f888909 Move recursive_map from local to free function 2018-08-01 07:30:40 -03:00
Bruno Oliveira
ad5ddaf55a Simplify is_numpy_array as suggested in review 2018-08-01 07:28:39 -03:00
Bruno Oliveira
4588130c1e Merge pull request #3756 from RonnyPfannschmidt/fix-3745
fix #3745 - display absolute cache_dir if necessary
2018-08-01 07:09:19 -03:00
Bruno Oliveira
5003bae0de Fix 'at' string for non-numeric messages in approx() 2018-08-01 07:07:37 -03:00
Bruno Oliveira
6e32a1f73d Use parametrize in repr test for nd arrays 2018-08-01 07:04:25 -03:00
Bruno Oliveira
611d254ed5 Improve error checking messages: add position and use pprint 2018-08-01 07:01:00 -03:00
Ronny Pfannschmidt
57a8f208bc fix #3757 by pinning to pathlib2 that supports __fspath__ 2018-08-01 11:45:39 +02:00
Ronny Pfannschmidt
fcdc1d867e fix #3745 - display absolute cache_dir if necessary 2018-08-01 08:25:37 +02:00
Bruno Oliveira
098dca3a9f Use {!r} for a few other messages as well 2018-07-31 21:14:51 -03:00
Bruno Oliveira
8e2ed76227 Create appropriate CHANGELOG entries 2018-07-31 21:11:26 -03:00
Bruno Oliveira
bf7c188cc0 Improve error message for invalid types passed to pytest.approx()
* Hide the internal traceback
* Use !r representation instead of !s (the default for {} formatting)
2018-07-31 21:08:24 -03:00
Bruno Oliveira
8c9efd8608 Only call _collectfile on package instances
As discussed in #3751, this feels like a hack, pushing it only so we can
see how it fares on CI and if there are better solutions out there
2018-07-31 19:06:30 -03:00
Bruno Oliveira
e1ad1a14af Add example script and failure for #3742 2018-07-31 17:50:55 -03:00
Kale Kundert
327fe4cfcc Update the changelog. 2018-07-31 11:40:02 -07:00
Kale Kundert
d02491931a Fix the unused import. 2018-07-31 11:33:46 -07:00
Kale Kundert
032db159c9 Let black reformat the code... 2018-07-31 11:23:23 -07:00
Kale Kundert
cd2085ee71 approx(): Detect type errors earlier. 2018-07-31 00:26:35 -07:00
Kale Kundert
ad305e71d7 Improve docstrings for Approx classes. 2018-07-30 23:26:57 -07:00
Kale Kundert
7d8688d54b Reflect dimension in approx repr for numpy arrays. 2018-07-30 23:23:17 -07:00
Bruno Oliveira
253419316c Merge pull request #3738 from nicoddemus/release-3.7.0
Release 3.7.0
2018-07-30 20:38:22 -03:00
Bruno Oliveira
997ef59306 Fix typos in CHANGELOG 2018-07-30 18:31:35 -03:00
Bruno Oliveira
60b1913ba2 Preparing release version 3.7.0 2018-07-30 20:14:42 +00:00
Bruno Oliveira
2c09930b6d Use proper quotes for python 3.7 on travis.yml 2018-07-30 20:13:17 +00:00
Bruno Oliveira
d461e931dd Use python 3.6 for regendoc 2018-07-30 20:12:52 +00:00
Bruno Oliveira
eada0b1fd7 Merge remote-tracking branch 'upstream/master' into release-3.7.0 2018-07-30 20:12:30 +00:00
Bruno Oliveira
150535b6c1 Merge pull request #3696 from abrammer/approx_numpy_tolerance_bugfix
bugfix in ApproxNumpy initialisation, use keywords for arguments to fix
2018-07-30 17:09:18 -03:00
Ronny Pfannschmidt
f1ec02cdcd Merge pull request #3733 from nicoddemus/py37
Test with Python 3.7 on Travis and AppVeyor
2018-07-30 20:02:03 +02:00
Ronny Pfannschmidt
9f5d73d44a Merge pull request #3735 from nicoddemus/deprecate-pytest-namespace
Deprecate pytest namespace
2018-07-30 19:55:45 +02:00
Bruno Oliveira
8609f8d25a Move warning definition to deprecated module 2018-07-30 14:25:29 -03:00
Bruno Oliveira
953a618102 Update CHANGELOG entry about pytest_namespace deprecation 2018-07-30 12:18:37 -03:00
Bruno Oliveira
cf6d8e7e53 Fix test and update warning in pytest_namespace docs 2018-07-30 12:16:42 -03:00
Bruno Oliveira
8af78f417f Merge pull request #3732 from nicoddemus/merge-master-into-features
Merge master into features
2018-07-30 07:26:19 -03:00
abrammer
535fd1f311 may as well include inf test while we're at it 2018-07-29 23:12:04 -04:00
abrammer
762eaf443a update changelog to include the addition of tests 2018-07-29 22:57:39 -04:00
abrammer
330640eb96 update tests to check tolerance args and expecing nan in numpy arrays 2018-07-29 22:47:38 -04:00
Bruno Oliveira
e3d412d1f4 Warn when implementations exist for pytest_namespace hook
This hook has been deprecated and will be removed in the future.

Fix #2639
2018-07-29 22:20:23 -03:00
Bruno Oliveira
6f9a12a8a3 Merge pull request #3486 from ammarnajjar/last-failed-no-failures_docs_correction
--last-failed-no-failures docs correction
2018-07-29 21:26:03 -03:00
Bruno Oliveira
0e47599572 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-07-29 21:15:51 -03:00
Bruno Oliveira
c480223e88 Test with Python 3.7 on Travis and AppVeyor 2018-07-29 21:14:38 -03:00
Bruno Oliveira
0b522d40a7 Merge pull request #3734 from nicoddemus/fix-docs
Fix reference to _Result in docs
2018-07-29 21:14:09 -03:00
Bruno Oliveira
d900a6c8bd Merge pull request #3731 from asottile/pygrep_hooks
Use upstream rst-backticks hook
2018-07-29 20:52:28 -03:00
Bruno Oliveira
fe46fbb719 Fix reference to _Result in docs 2018-07-29 20:50:24 -03:00
Anthony Sottile
8d401cdb9d Use upstream rst-backticks hook 2018-07-29 15:46:06 -07:00
Bruno Oliveira
3f3f6f1be4 Merge pull request #3729 from nicoddemus/fix-changelog-titles
Fix "Pytest" to "pytest" in the CHANGELOG
2018-07-29 19:42:24 -03:00
Bruno Oliveira
b6da5cc54c Fix "Pytest" to "pytest" in the CHANGELOG
Now that we have fixed towncrier to render the proper title, seems fitting
to update the others
2018-07-28 12:57:18 -03:00
Bruno Oliveira
eaeeedc9c3 Merge pull request #3728 from nicoddemus/release-3.6.4
Release 3.6.4
2018-07-28 12:53:49 -03:00
Bruno Oliveira
317cd41215 Preparing release version 3.6.4 2018-07-28 12:59:04 +00:00
Bruno Oliveira
7f27512a48 Pin pluggy to <0.8 2018-07-28 09:46:35 -03:00
Kale Kundert
bf127a63b2 Need to iterate over the flattened array. 2018-07-27 11:24:42 -07:00
Bruno Oliveira
fe16f81da1 Merge pull request #3705 from nicoddemus/deprecate-call-fixture-func
Deprecate calling fixture functions directly
2018-07-27 15:09:09 -03:00
Bruno Oliveira
d0ba242c46 Implement change suggested by @kalekundert in PR 2018-07-27 15:07:20 -03:00
Bruno Oliveira
fe06be8590 Merge pull request #3723 from pytest-dev/nicoddemus-patch-1
Use "pytest" on the CHANGELOG
2018-07-27 10:23:11 -03:00
Bruno Oliveira
79b4ca92d8 Use "pytest" on the CHANGELOG 2018-07-27 09:21:18 -03:00
Bruno Oliveira
57b0c60cb4 Remove Testdir.run_example as recommended 2018-07-26 20:10:40 -03:00
Bruno Oliveira
6e57d123bb Mark test_idval_hypothesis as flaky on Windows (#3707) 2018-07-26 19:58:42 -03:00
Bruno Oliveira
011f88f7e7 Deprecate calling fixture functions directly
This will now issue a RemovedInPytest4Warning when the user calls
a fixture function directly, instead of requesting it from test
functions as is expected

Fix #3661
2018-07-26 19:58:42 -03:00
Bruno Oliveira
2eb9301ad5 Improve CHANGELOG 2018-07-25 08:09:31 -03:00
abrammer
f0db64ac2e drop the duplicate approx call
update test to include both np.array(actual) and np.array(expected)
2018-07-24 21:18:44 -04:00
abrammer
514ca6f4ad add test wrt #3695 checking numpy array tolerance args 2018-07-23 23:40:06 -04:00
Bruno Oliveira
b7419bd9bb Merge pull request #3710 from bmwiedemann/date
Do not claim copyright for future years
2018-07-23 11:14:39 -03:00
Bernhard M. Wiedemann
2e344d4d63 Do not claim copyright for future years
When building today's python-pytest-doc openSUSE package
in the year 2033, the documentation .html files state
Copyright 2015-2033 , holger krekel and pytest-dev team.

That cannot be correct, because nobody did anything copyright-worthy
for this file in 2033.

See also https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated

Additionally, this change makes the package build reproducible.
See https://reproducible-builds.org/ for why this is good.
2018-07-23 15:02:59 +02:00
Ronny Pfannschmidt
f8749eeb5c Merge pull request #3708 from nicoddemus/small-refactors
Small refactorings
2018-07-23 06:53:08 +02:00
Anthony Sottile
f76142508f Merge pull request #3694 from drewrisinger/patch-2
Fix mark.rst typos & grammar
2018-07-22 09:15:33 -07:00
Anthony Sottile
be2afb950a Merge pull request #3706 from ehershey/patch-1
typo - $PYTEST_ADDOTPS -> $PYTEST_ADDOPTS
2018-07-22 09:03:23 -07:00
E Hershey
19de1b7f29 typo - PYTEST_ADDOTPS -> PYTEST_ADDOPTS 2018-07-22 11:39:32 -04:00
Bruno Oliveira
f5165064ee Make yield_fixture just call fixture to do its work
Since fixture and yield_fixture are identical, they should call
the same code; as it was, the code inside them was already starting
to deviate.
2018-07-22 09:41:03 -03:00
Bruno Oliveira
c9a0881309 Isolate the code that resolves the fixturefunc to a separate function
pytest_fixture_setup was somewhat convoluted because it was trying
to do too many things.
2018-07-22 09:37:41 -03:00
Bruno Oliveira
5167933395 Move teardown code of yield fixtures to a partial to avoid leaks
As it were before, it was keeping a reference to fixturefunc and it
alive when an error occurred
2018-07-22 09:27:34 -03:00
Alan Brammer
75db608479 update changelog 2018-07-18 17:56:00 -04:00
Alan
7bff5866b1 bugfix in ApproxNumpy initialisation, use keywords for arguments now 2018-07-18 17:29:55 -04:00
Anthony Sottile
9720c3301a Merge pull request #3690 from drewrisinger/patch-1
Fix fixture.rst typos & grammar
2018-07-17 18:13:41 -07:00
Drew
254689ff83 Fix mark.rst typos & grammar
Fix minor typos
2018-07-17 11:19:40 -04:00
Drew
21f5222784 Fix fixture.rst spelling & grammar
Fix a few typos.
2018-07-17 10:53:57 -04:00
Bruno Oliveira
0bb29d5649 Merge pull request #3685 from nicoddemus/merge-master-into-features
Merge master into features
2018-07-15 16:53:39 -03:00
Bruno Oliveira
db33f03c15 Merge pull request #3681 from tadeoos/980-fix-truncated-locals-in-verbose
Fix truncated locals in verbose mode
2018-07-15 14:43:15 -03:00
Bruno Oliveira
ac9ceaacd8 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-07-15 11:54:14 -03:00
Bruno Oliveira
771d3e8f4f Merge pull request #3684 from Vlad-Shcherbina/type_comments
Replace broken type annotations with type comments
2018-07-15 11:52:12 -03:00
Bruno Oliveira
82a11e6207 Merge pull request #3680 from nicoddemus/labels
Manage GH labels using the new 'labels' tool
2018-07-15 11:34:20 -03:00
Bruno Oliveira
a1c3df1889 Merge pull request #3683 from caramelomartins/master
[#3402] CITATION
2018-07-15 11:33:06 -03:00
Bruno Oliveira
a821af6b1c Merge pull request #3682 from nicoddemus/tox-release
Revamp the release script: drop invoke and use tox directly
2018-07-15 11:32:20 -03:00
Tadek Teleżyński
d2fe619120 Fix truncated locals in verbose mode 2018-07-15 11:30:26 -03:00
Vlad Shcherbina
58e77f58bd Replace broken type annotations with type comments
Fixes #3635.
2018-07-15 16:58:39 +03:00
Hugo Martins
6a4fa4f485 Fix more linting issues 2018-07-14 16:44:47 +01:00
Hugo Martins
5be03bff61 Add changelog information 2018-07-14 16:37:55 +01:00
Hugo Martins
e9fd038aae Fix linting issues 2018-07-14 16:35:33 +01:00
Hugo Martins
a8464a95ce Add CITATION
Relates to #3402
2018-07-14 16:32:29 +01:00
Bruno Oliveira
a0b0c37feb Revamp the release script: drop invoke and use tox directly
Following the lead from tox, use a simple Python script instead of depending
on ``invoke``.

Other changes:

* Some colors using ``colorama``.
* Run ``pre-commit`` before the final commit to ensure everything is neatly
  formatted.
* Drop generating local tag: legacy from the time we used ``devpi`` as staging
  area, currently we no longer use it, and we should push a
  tag from the last HEAD of the PR always to ensure it is correct.
2018-07-14 11:35:37 -03:00
Bruno Oliveira
35ffd29404 Manage GH labels using the new 'labels' tool 2018-07-14 10:12:52 -03:00
Bruno Oliveira
0565a7a4e1 Merge pull request #3679 from nicoddemus/parametrized-internal-refactor
Refactor parametrize() code for readability
2018-07-12 21:31:06 -03:00
Bruno Oliveira
6c3713226c Merge pull request #3642 from caramelomartins/master
Fixes # 3592 - Clarify Fixtures' Documentation
2018-07-11 23:31:51 -03:00
Bruno Oliveira
f6ceedd15b Merge pull request #3636 from RonnyPfannschmidt/fixturetest-examples
[RFC] Fixturetest examples - move test contents to use example scripts for contents
2018-07-11 23:29:33 -03:00
Bruno Oliveira
3e599dc149 Check that param sets match number of args during _for_parametrize
It makes sense to validate them during creation of the parameter set
2018-07-11 22:57:53 -03:00
Bruno Oliveira
54fbc6f6e1 Refactor parametrize() code for readability
Extract the parametrize() block of code into methods for better
readability
2018-07-11 21:29:21 -03:00
Bruno Oliveira
aa47b64e2a Improve CHANGELOG entry 2018-07-11 21:07:21 -03:00
Bruno Oliveira
251adbf644 Merge with upstream/master 2018-07-11 20:46:14 -03:00
Bruno Oliveira
2c4759ce57 Run regendocs 2018-07-11 20:37:50 -03:00
Bruno Oliveira
4dfe2eee94 Fix finalize call 2018-07-11 20:24:39 -03:00
Bruno Oliveira
5226c7fac3 Merge pull request #3665 from nicoddemus/changelog-tweaks
Small tweaks to the changelog entries
2018-07-10 21:12:50 -03:00
Bruno Oliveira
593b451373 Merge pull request #3670 from asottile/remove_unused_fix_lint
Remove unused fix-lint tox environment
2018-07-10 19:08:31 -03:00
Anthony Sottile
898544e147 Merge pull request #3669 from asottile/yesqa
Remove some extraneous `# noqa` comments
2018-07-10 14:53:08 -07:00
Anthony Sottile
61301d934e Remove some extraneous # noqa comments
This was partially automated with https://github.com/asottile/yesqa

_with a few caveats_:
- it was run under python2 (chosen arbitrarily, when run under python3 other
  things were changed)
- I used `git checkout -p` to revert the removal of `noqa` comments from
  `cmp()` lines.
2018-07-08 17:05:52 -07:00
Anthony Sottile
af0059079c Remove unused fix-lint tox environment 2018-07-08 17:05:01 -07:00
Bruno Oliveira
9ef7878cbc Merge pull request #3668 from asottile/remove_obsolete_future_imports
Remove obsolete __future__ imports
2018-07-08 13:41:59 -03:00
Anthony Sottile
4ae93a7a07 Remove obsolete __future__ imports 2018-07-08 08:37:02 -07:00
Bruno Oliveira
d4faa4056b Merge pull request #3667 from asottile/avoid_sys_path_pollution_742
Use -mpytest when invoking pytest in pytester
2018-07-08 11:51:16 -03:00
Anthony Sottile
42bbb4fa8a Use -mpytest when invoking pytest in pytester 2018-07-07 17:18:44 -07:00
Bruno Oliveira
12c5b6104c Merge pull request #3666 from nicoddemus/deploy-on-tags
Skip deploy stage entirely unless we have a tag
2018-07-07 20:40:14 -03:00
Bruno Oliveira
aa9d1ad2eb Merge pull request #3663 from nicoddemus/usefixtures-reference
Add reference docs for pytest.mark.usefixtures
2018-07-07 12:12:31 -03:00
Bruno Oliveira
49e82a4be8 Skip deploy stage entirely unless we have a tag
Borrowed from https://github.com/tox-dev/tox/pull/877
2018-07-07 12:12:07 -03:00
Bruno Oliveira
803302e70c Fix end-of-line in 2220.bugfix.rst 2018-07-07 11:13:48 -03:00
Bruno Oliveira
05f1d0d3ef Update README for CHANGELOG about using multiple paragraphs 2018-07-07 11:07:13 -03:00
Bruno Oliveira
1cd62f8c38 Update CHANGELOG template to put issue links at the start of entries
This allows us to use the new multi-line entries available with
towncrier 18.6.0
2018-07-07 11:02:33 -03:00
Bruno Oliveira
a522fc745a Small tweaks to the changelog entries 2018-07-07 10:43:37 -03:00
Bruno Oliveira
303133f013 Merge pull request #3647 from jeffreyrack/3610-add-trace-option
3610 add trace option
2018-07-07 10:05:34 -03:00
Bruno Oliveira
d26a596072 Add a warning about usefixtures mark not working in fixtures
Fix #1014
2018-07-07 10:01:10 -03:00
Bruno Oliveira
f359b50fe5 Adjust copyright in README 2018-07-06 21:03:27 -03:00
Bruno Oliveira
18b2fc11ad Dummy change 2018-07-06 20:57:30 -03:00
Bruno Oliveira
d7b722e2ae Add reference docs for pytest.mark.usefixtures 2018-07-06 20:55:42 -03:00
Ronny Pfannschmidt
1e94ac784f Merge pull request #3389 from jonozzz/features
Add package scoped fixtures #2283
2018-07-06 11:42:36 +02:00
Bruno Oliveira
027d2336b8 Add minimal docs for package-scoped fixtures (experimental) 2018-07-05 21:56:31 -03:00
Bruno Oliveira
3c19370cec Merge remote-tracking branch 'upstream/features' into jonozzz/features 2018-07-05 18:15:17 -03:00
Bruno Oliveira
7e8f7bfa16 Merge pull request #3660 from asottile/code_highlight_fix
Correct code blocks in docs
2018-07-05 07:17:03 -03:00
Bruno Oliveira
3f5e06ecc4 Merge pull request #3659 from nicoddemus/merge-master-into-features
Merge master into features
2018-07-04 21:11:28 -03:00
Anthony Sottile
50f030d233 Correct code blocks in docs 2018-07-04 15:16:34 -07:00
Bruno Oliveira
7696d5371a Merge remote-tracking branch 'upstream/master' into features 2018-07-04 18:49:35 -03:00
Bruno Oliveira
b64c26674d Merge pull request #3656 from nicoddemus/release-3.6.3
Release 3.6.3
2018-07-04 18:45:45 -03:00
Bruno Oliveira
63b25304c3 Run pre-commit fixers 2018-07-03 22:20:29 -03:00
Bruno Oliveira
73d787df3a HOWTORELEASE: create branch first and run pre-commit after generate-release task
This makes more sense because we need to install from
tasks/requirements.txt
2018-07-03 22:15:23 -03:00
Bruno Oliveira
fa3161011a Improve CHANGELOG for 3.6.3 2018-07-03 22:07:51 -03:00
Bruno Oliveira
2921ca6e64 Run pre-commit on all doc files 2018-07-03 21:58:18 -03:00
Bruno Oliveira
43c0346d68 Preparing release version 3.6.3 2018-07-04 00:51:21 +00:00
Bruno Oliveira
3ed8e28ef3 Merge pull request #3654 from LeastAuthority/3653.deprecated-convert
Switch to new API
2018-07-03 21:46:26 -03:00
Bruno Oliveira
b84a646389 Add note to the changelog 2018-07-03 21:08:27 -03:00
Hugo Martins
8232fd1a2d Fix remaining "smtp" references 2018-07-03 23:24:59 +01:00
Hugo Martins
f52a5d3be2 Merge remote-tracking branch 'upstream/master' 2018-07-03 23:11:35 +01:00
Jean-Paul Calderone
b815f67e65 add changelog 2018-07-03 13:40:04 -04:00
Jean-Paul Calderone
55ebf261ce Switch to new API 2018-07-03 13:37:03 -04:00
Jeffrey Rackauckas
067de257e1 Fix test_pdb.py with pexpect 2018-07-02 21:03:21 -07:00
Jeffrey Rackauckas
4a925ef5e9 Fixing bug in test. 2018-07-02 20:29:59 -07:00
Jeffrey Rackauckas
4afb8c428b Fix python 2 issues 2018-07-02 20:20:42 -07:00
Jeffrey Rackauckas
2f1a2cf07f Fixing --trace test. 2018-07-02 19:55:08 -07:00
Jeffrey Rackauckas
6cc4fe2412 Fixing bad indentation 2018-07-02 19:53:46 -07:00
Jeffrey Rackauckas
10a8691eca Add support for yielded functions. 2018-07-02 19:46:26 -07:00
Jeffrey Rackauckas
b75320ba95 Fix --trace option with yield tests. 2018-07-02 19:08:41 -07:00
Bruno Oliveira
b50911285a Merge pull request #3648 from eelstork/patch-1
Fix monkeypatch doc
2018-07-02 10:34:05 -03:00
T.E.A de Souza
a43205b4bc Fix monkeypatch doc
`delenv` is incorrectly documented.
2018-07-02 21:01:41 +08:00
Jeffrey Rackauckas
bc268a58d1 Adding needed newline 2018-07-01 20:22:50 -07:00
Jeffrey Rackauckas
0b70477930 Fix linting issues. 2018-07-01 20:18:00 -07:00
Jeffrey Rackauckas
8801162275 Fixing tabbing in usage.rst. 2018-07-01 18:54:04 -07:00
Jeffrey Rackauckas
a604a71185 Fixing usage.rst title. 2018-07-01 18:53:18 -07:00
Jeffrey Rackauckas
66fa6bb42e Fix flake8 issues. 2018-07-01 18:50:57 -07:00
Jeffrey Rackauckas
713d32c4da Adding documentation for the --trace option. 2018-07-01 18:49:39 -07:00
Jeffrey Rackauckas
57198d477b Adding changelog entry for the --trace option. 2018-07-01 12:14:35 -07:00
Jeffrey Rackauckas
533f4cc10c Fix test to pass 2018-06-30 21:36:27 -07:00
Jeffrey Rackauckas
a46b94950c Properly set immediately_break value 2018-06-30 21:32:25 -07:00
Jeffrey Rackauckas
952bbefaac Add initial test. 2018-06-30 18:26:58 -07:00
Jeffrey Rackauckas
54d3cd587d Adding the --trace option. 2018-06-30 18:09:06 -07:00
Bruno Oliveira
2b75a311a7 Merge pull request #3637 from RonnyPfannschmidt/fix-3631
fix #3631 - don't store legacy markinfo when its impossible
2018-06-30 17:48:46 -03:00
Bruno Oliveira
26e1784e52 Merge pull request #3641 from Sup3rGeo/bugfix/logfile-unicode
Fixes #3630
2018-06-30 17:47:24 -03:00
victor
dad3e77319 Improve test readability. 2018-06-30 18:57:24 +02:00
Victor
3a1c15316b Updated test for python 2.7 2018-06-30 16:11:20 +02:00
Hugo Martins
f7c929c932 Fix linting errors in docs/fixtures.rst 2018-06-30 14:34:19 +01:00
Hugo Martins
b48f1d378b Clarify examples in fixtures' documentation 2018-06-30 02:01:49 +01:00
Victor
a6636fddcd Fixed open function with encoding in python 2.7 2018-06-29 17:04:30 +02:00
Victor
738933938a Added changelog. 2018-06-29 16:18:16 +02:00
Victor
342f2cdc17 Fixes #3630 2018-06-29 16:09:39 +02:00
Ronny Pfannschmidt
5bd5b8c68a fix #3631 - don't store legacy markinfo when its impossible 2018-06-29 14:01:20 +02:00
Ronny Pfannschmidt
0fd86ec8a8 move some fill fixture acceptance tests contents to the examples script folder 2018-06-29 10:58:33 +02:00
Ronny Pfannschmidt
4ae7e9788c fix quotes in scope order test 2018-06-29 07:13:18 +02:00
Ronny Pfannschmidt
5582ad0445 remove use of formatting in test_func_closure_module_auto
this makes it apparent that pytester should supply some kind of variable support
2018-06-29 07:07:03 +02:00
Ronny Pfannschmidt
982b614010 remove format calls for most fixture tests 2018-06-29 07:07:03 +02:00
Ronny Pfannschmidt
7845ab4bc3 remove test file formatting from TestContextManagerFixtureFuncs 2018-06-29 07:07:03 +02:00
Bruno Oliveira
8680dfc939 Merge pull request #3629 from egnartsms/issue-2220-param-breaks-dep
Make test parametrization override indirect fixtures
2018-06-28 21:43:21 -03:00
Serhii Mozghovyi
76ac670f7d Add changelog description 2018-06-28 23:42:18 +03:00
Bruno Oliveira
7b47dfb744 Merge pull request #3634 from RonnyPfannschmidt/merge-from-master
Merge from master
2018-06-28 14:05:18 -03:00
Ronny Pfannschmidt
3c73d6298a merge from master to features 2018-06-28 17:32:41 +02:00
Serhii Mozghovyi
c220fb235a Minor fix (code improvement) 2018-06-28 14:53:06 +03:00
Serhii Mozghovyi
1dc5e97ac2 Make test parametrization override indirect fixtures 2018-06-28 14:32:29 +03:00
Bruno Oliveira
e9371a58a0 Merge pull request #3622 from RonnyPfannschmidt/builtin-serialize
move report classes to own file to prepare for serialisazion
2018-06-27 15:17:09 -03:00
Bruno Oliveira
a48c47b53b Merge pull request #3624 from nicoddemus/skip-appveyor-tags
Skip AppVeyor builds on tag pushes
2018-06-27 12:12:21 -03:00
Bruno Oliveira
ea379ba10f Merge pull request #3623 from RonnyPfannschmidt/pytester-runexamples
Pytester runexamples
2018-06-27 09:13:29 -03:00
Bruno Oliveira
9a56bb05be Skip AppVeyor builds on tag pushes
We don't deploy anything on tags with AppVeyor, we use Travis instead, so we
might as well save resources
2018-06-27 08:28:34 -03:00
Ronny Pfannschmidt
17e01993d9 regendoc and invocation fixes 2018-06-27 08:28:21 +02:00
Ronny Pfannschmidt
8a6345515b regendoc 2018-06-27 06:52:54 +02:00
Ronny Pfannschmidt
581d49635e add docs and changelog 2018-06-27 06:52:36 +02:00
Bruno Oliveira
ef1b91ba87 Merge pull request #3606 from RonnyPfannschmidt/fix-3605
Fix 3605
2018-06-26 22:14:28 -03:00
Ronny Pfannschmidt
e860ff7299 port some acceptance tests over to copy_example 2018-06-26 22:59:40 +02:00
Ronny Pfannschmidt
0672bc633f enable pytester to run examples copied from the cwd 2018-06-26 22:48:33 +02:00
Ronny Pfannschmidt
2dfb52f7e0 fix rebase artifacts 2018-06-26 22:10:26 +02:00
Ronny Pfannschmidt
cc6eb9f83c move test reports to own file 2018-06-26 22:09:15 +02:00
Ronny Pfannschmidt
643e5a9c44 fix docs 2018-06-26 21:57:31 +02:00
Ronny Pfannschmidt
b8486037d3 fix #3605 - unpack markdecorators from parameterization 2018-06-26 21:57:31 +02:00
Ronny Pfannschmidt
78a82c05ef consistent failure on all python versions for test_markers_from_parametrize 2018-06-26 21:57:31 +02:00
Ronny Pfannschmidt
853975d93b add failing test for #3605 2018-06-26 21:57:31 +02:00
Ronny Pfannschmidt
6b239263da Merge pull request #3620 from RonnyPfannschmidt/merge-from-master
Merge from master
2018-06-26 21:56:09 +02:00
Ronny Pfannschmidt
89e0a3ec27 merge from master to features 2018-06-26 17:01:05 +02:00
Ronny Pfannschmidt
f93995e15c Merge pull request #3614 from asottile/upgrade_hooks
Upgrade hooks
2018-06-26 16:30:56 +02:00
Anthony Sottile
f940967e23 Fix test offset after black moved code 2018-06-26 06:35:48 -07:00
Anthony Sottile
cbaa7dd56a Upgrade pre-commit hooks except pyupgrade 2018-06-26 06:35:27 -07:00
Ronny Pfannschmidt
8133d1955e Merge pull request #3615 from marcelotrevisani/bug-3593-pytest-approx
Bug fix #3593 - approx repr in a 0-d numpy array
2018-06-26 13:04:23 +02:00
Bruno Oliveira
738b715655 Merge pull request #3619 from jdufresne/pypi
Update pypi.python.org URLs to pypi.org
2018-06-26 00:00:52 -03:00
Jon Dufresne
1d5316a28b Update pypi.python.org URLs to pypi.org
For details on the new PyPI, see the blog post:

https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
2018-06-25 18:08:49 -07:00
Marcelo Duarte Trevisani
0030ceb11c Bug fix #3593 - approx method in a single element of numpy array
If the user pass as a expected value a numpy array created like
numpy.array(5); it will creates an array with one element without shape,
when used with approx it will raise an error
'TypeError: iteration over a 0-d array'
2018-06-25 22:55:16 +02:00
Bruno Oliveira
5b186cd609 Merge pull request #3594 from pytest-dev/interal-pathlib
[WIP] port cache plugin internals to pathlib
2018-06-25 11:09:36 -03:00
Ronny Pfannschmidt
5a156b3645 disable pypy on windows until scandir works for it 2018-06-24 22:54:26 +02:00
Ronny Pfannschmidt
42b3125783 Merge pull request #3612 from mimi1vx/patch-1
Prefer unittest.mock before mock
2018-06-24 16:33:49 +02:00
Bruno Oliveira
50a0d4fa95 Merge pull request #3613 from asottile/module_spec_warnings
Fix `ImportWarning` triggered by explicit relative imports
2018-06-23 18:27:19 -03:00
Ondřej Súkup
deff54aae0 Try import mock, but on python 3.3+ can use also stdlib unittest.mock
From Python 3.3 is mock part of python standard library in unittest namespace
2018-06-23 23:27:07 +02:00
Anthony Sottile
22a2734d9a Merge pull request #3611 from AdamEr8/doc-fix-skipif
Doc Fix: skipif's example description
2018-06-23 14:06:30 -07:00
Anthony Sottile
17985b893d Remove warning filter as well 2018-06-23 10:22:09 -07:00
Anthony Sottile
1d55c49a9a Fix ImportWarning triggered by explicit relative imports 2018-06-23 07:55:49 -07:00
Ronny Pfannschmidt
95f00de0df use paths for config.cache.get key 2018-06-23 00:14:06 +02:00
Ronny Pfannschmidt
c4c666cbc4 use Pathlib instead of path splitting 2018-06-23 00:07:57 +02:00
Ronny Pfannschmidt
ee30bf45c9 rebase onto readme addition 2018-06-23 00:03:10 +02:00
Ronny Pfannschmidt
603df1ea1c whops, its supported starting with python 3.6, not python 3.5 2018-06-22 23:56:22 +02:00
Ronny Pfannschmidt
abbf73ad1a use pathlib2 up to python3.4 - damn the stdlib 2018-06-22 23:56:22 +02:00
Ronny Pfannschmidt
1226cdab47 fix warnings and json dumping of cacheprovider 2018-06-22 23:56:22 +02:00
Ronny Pfannschmidt
ab80e0fba0 sort compat flake8 mess correctly 2018-06-22 23:56:22 +02:00
Ronny Pfannschmidt
fb992a0c81 reorder attr.ib specs 2018-06-22 23:56:22 +02:00
Ronny Pfannschmidt
23581d44bd add missed file 2018-06-22 23:56:22 +02:00
Ronny Pfannschmidt
c7eb53317b port cache plugin internals to pathlib
warning logging got broken by detanglement from config
2018-06-22 23:56:22 +02:00
Bruno Oliveira
8cc210708c Improve changelog and change it to doc 2018-06-22 09:14:59 -03:00
Bruno Oliveira
4970f6d5c2 Improve reason in skipif example 2018-06-22 09:14:12 -03:00
AdamEr8
f883628939 Changelog mistake
Used pytest.fixture.skipif instead of pytest.mark.skipif
2018-06-22 08:51:26 +03:00
AdamEr8
40839b5a3a Rename prnum.trivial.rst to 3611.trivial.rst 2018-06-22 08:46:34 +03:00
AdamEr8
5e56d77542 Create prnum.trivial.rst
Added changelog file
2018-06-22 08:33:35 +03:00
Bruno Oliveira
de98939ebf Merge pull request #3608 from avirlrma/features
add reamde for .pytest_cache
2018-06-21 21:05:23 -03:00
Bruno Oliveira
0d3914b626 Remove extra '\' left at the end of a line in cache's readme contents 2018-06-21 20:12:50 -03:00
Bruno Oliveira
eb94bce3e2 Change 3519 to trivial 2018-06-21 20:11:22 -03:00
Bruno Oliveira
b897008887 Improve CHANGELOG grammar 2018-06-21 20:09:32 -03:00
Anthony Sottile
630428c611 Merge pull request #3609 from asottile/remove_warning_py2_functools_reduce
Silence usage of `reduce` warning in python 2
2018-06-21 15:08:31 -07:00
Anthony Sottile
8b4c59e606 Silence usage of reduce warning in python 2 2018-06-21 13:27:00 -07:00
avirlrma
998d540b73 fixed changelog entry 2018-06-21 17:56:26 +05:30
avirlrma
c672bfa32e added changelog entry
moved cache readme tests to test_cacheprovider.py
2018-06-21 17:43:10 +05:30
avirlrma
8f1d8ac970 fixed linting errors
ran black
removed unused imports and variables
2018-06-21 15:15:55 +05:30
AdamEr8
1ac1ee6fcb Fixed text description above skipif's example
@pytest.mark.skipif's example's description (above the code) was the opposite of the condition in the code,
fixed the description to match the code.
2018-06-21 12:09:56 +03:00
avirlrma
53d4710c62 added tests for .pytest_cache README
Helper class to check if readme exists in .pytest_cache directory
 Tests to check for readme when tests pass and when they fail
2018-06-21 14:25:00 +05:30
avirlrma
31f089db6a add reamde for .pytest_cache
method - `ensure_readme()`
2018-06-21 13:14:58 +05:30
Ronny Pfannschmidt
b7b9c54d27 Merge pull request #3603 from nicoddemus/fix-freeze-job
Fix reference to py36-freeze in travis and appveyor
2018-06-21 09:33:59 +02:00
Ronny Pfannschmidt
e86fe38144 Merge pull request #3598 from nicoddemus/small-callspec2-cleanup
Remove unused attribute and parameter in CallSpec2
2018-06-20 18:04:34 +02:00
Bruno Oliveira
5b26178397 Merge pull request #3602 from nicoddemus/release-3.6.2
Release 3.6.2
2018-06-20 08:12:43 -03:00
Bruno Oliveira
130100bba1 Fix reference to py36-freeze in travis and appveyor
Travis and AppVeyor were executing "py35-freeze", which does not actually
exist in tox.ini.
2018-06-20 07:53:41 -03:00
Bruno Oliveira
46aa18dfa7 Lint regendoc changes 2018-06-19 21:34:03 -03:00
Bruno Oliveira
617a5fcf98 Preparing release version 3.6.2 2018-06-20 00:29:58 +00:00
Bruno Oliveira
19ba243cae Merge pull request #3600 from RonnyPfannschmidt/pyproject-compliance
add build-system section to pyproject.toml
2018-06-19 06:58:28 -03:00
Ronny Pfannschmidt
af5d41fdfd add build-system section to pyproject.toml
this makes the file valid and prepares for https://github.com/pypa/pip/issues/5416 and https://github.com/pypa/pip/pull/5512
2018-06-19 10:41:04 +02:00
Bruno Oliveira
85be8bdf49 Merge pull request #3599 from pytest-dev/asottile-patch-1
Use --show-diff-on-failure for pre-commit CI invocation
2018-06-18 23:31:01 -03:00
Anthony Sottile
8e9f1d2417 Use --show-diff-on-failure for pre-commit CI invocation 2018-06-18 18:27:48 -07:00
Bruno Oliveira
93e55ad2fa Remove unused attribute and parameter in CallSpec2 2018-06-18 21:48:49 -03:00
Bruno Oliveira
2925f3057f Merge pull request #3584 from jwodder/fix-3583
Fix encoding error with `print` statements in doctests
2018-06-18 08:03:07 -03:00
Anthony Sottile
a93ad1fb77 Merge pull request #3590 from alexbarbato/3525_typo_fixture_docs
3525 typo fixture docs
2018-06-16 13:28:21 -07:00
Alex Barbato
561db95521 Add changelog file. 2018-06-16 12:44:19 -04:00
Alex Barbato
9408291c50 Fixing parens typo in fixture.rst 2018-06-16 12:40:25 -04:00
Ronny Pfannschmidt
4dc7b4ace6 Merge pull request #3589 from hynek/master
Fix 2 DeprecationWarnings about invalid escape seq
2018-06-16 11:56:35 +02:00
Hynek Schlawack
acb8f23311 Fix 2 DeprecationWarnings about invalid escape seq 2018-06-16 10:37:33 +02:00
Bruno Oliveira
9d60cf25c0 Merge pull request #2207 from RonnyPfannschmidt/fix/519
add example scripts for issue #519
2018-06-15 15:05:18 -03:00
Bruno Oliveira
9e32b6ae48 Small typo and grammar fix 2018-06-15 15:05:00 -03:00
Ronny Pfannschmidt
99402cf1c0 add a readme to the example scripts 2018-06-15 20:02:01 +02:00
Anthony Sottile
b285078db4 Merge pull request #3535 from RonnyPfannschmidt/config-split
begin to turn config into package
2018-06-15 10:28:06 -07:00
John T. Wodder II
d382f3e77f [#3583] Fix encoding error with print statements in doctests
This fix was suggested by Stack Overflow user phd in
<https://stackoverflow.com/a/50863820/744178>.
2018-06-15 17:23:54 +00:00
John T. Wodder II
5221a14764 Failing test case for #3583 2018-06-15 17:23:49 +00:00
Ronny Pfannschmidt
3ac2ae3c8c black 2018-06-15 18:13:45 +02:00
Ronny Pfannschmidt
ea906056fa add the actually expected fixtureorder for #519 2018-06-15 18:04:24 +02:00
Ronny Pfannschmidt
c081c5ee23 add example scripts for issue #519 2018-06-15 18:04:24 +02:00
Bruno Oliveira
3dcdaab103 Merge pull request #3585 from wcooley/feature/3579-caplog-messages
Add `messages` property to `caplog` fixture.
2018-06-15 12:41:33 -03:00
Wil Cooley
3615977608 Add messages property to caplog fixture. 2018-06-14 12:22:33 -07:00
Bruno Oliveira
94c41bec64 Merge pull request #3576 from RonnyPfannschmidt/addmarker-api
fix addmarker - extract mark from markdecorator
2018-06-13 18:36:40 -03:00
Ronny Pfannschmidt
8d072205e9 fix whitespace 2018-06-13 22:00:22 +02:00
Bruno Oliveira
b5102d03a6 Fix add_marker docs 2018-06-13 14:57:10 -03:00
Ronny Pfannschmidt
791bb3502c changelog 2018-06-13 17:29:42 +02:00
Ronny Pfannschmidt
eb0c6a8287 fix addmarker - extract mark from markdecorator 2018-06-13 17:27:00 +02:00
Bruno Oliveira
4d0297b413 Merge pull request #3577 from RonnyPfannschmidt/addmarker-fix
fix addmarker - extract mark from markdecorator
2018-06-13 07:30:22 -03:00
Bruno Oliveira
88ae21f2cc Add mock dependency to py27-nobyte 2018-06-12 18:07:40 -03:00
Ronny Pfannschmidt
321f66f711 mark test_wrapped_getfuncargnames_patching as xfail 2018-06-12 22:25:05 +02:00
Ronny Pfannschmidt
52c4279918 Merge pull request #3572 from nicoddemus/remove-unused-scripts
Remove unused scripts and old docs
2018-06-12 21:57:51 +02:00
Bruno Oliveira
077c44cf69 Merge pull request #3578 from BartoszCki/master
Fix three spaces instead of four in docs
2018-06-12 15:17:40 -03:00
Bartosz Cierocki
f786534173 Fix three spaces instead of four in docs 2018-06-12 19:39:51 +02:00
Ronny Pfannschmidt
b0ec442d24 rework Node.add_marker parameter list and docstring 2018-06-12 17:55:58 +02:00
Bruno Oliveira
9a7c3a65f4 Improve CHANGELOG formatting 2018-06-12 11:07:42 -03:00
Ronny Pfannschmidt
37793d4cdb fix addmarker - extract mark from markdecorator 2018-06-12 15:50:58 +02:00
Ronny Pfannschmidt
1b5322da1b Merge pull request #3571 from nicoddemus/pre-commit-contributors-guide
Improve contributing instructions regarding black/linting
2018-06-12 06:37:18 +02:00
Bruno Oliveira
d6e7b1a21b Remove obsolete doc/en/test directory
Apparently this was an old version of the docs, which has long been superseded
2018-06-11 23:33:09 -03:00
Bruno Oliveira
4983de60d3 Remove unused scripts from docs 2018-06-11 23:32:49 -03:00
Bruno Oliveira
e0a1da4eb9 Remove changelog for #3554
This entry was removed in #3562
2018-06-11 23:17:11 -03:00
Anthony Sottile
ef88251573 Merge pull request #3570 from sangongs/fix_stack_finalizer
Continue to call finalizers in the stack when a finalizer raises an exception
2018-06-11 19:07:59 -07:00
Bruno Oliveira
f300f7fa24 Improve contributing instructions regarding black/linting 2018-06-11 20:49:25 -03:00
Bruno Oliveira
41125968d9 Check the exception matches the message for completeness 2018-06-11 20:33:13 -03:00
Bruno Oliveira
4fd66e8a42 Run black on test file 2018-06-11 20:32:08 -03:00
Guoqiang Zhang
a888bf182e Continue to call finalizers in the stack when a finalizer in a former scope raises an exception 2018-06-11 18:01:18 -04:00
Bruno Oliveira
04b65cfba0 Merge pull request #3565 from nicoddemus/xfail-test-request-garbage
Attempt to fix test_request_garbage on Windows
2018-06-11 15:23:47 -03:00
Ronny Pfannschmidt
61471df8da Merge pull request #3562 from nicoddemus/revert-callinfo-result
Revert change of Callinfo.result default value
2018-06-11 19:03:01 +02:00
Ronny Pfannschmidt
1aba123ac5 fix doc build 2018-06-11 16:20:24 +02:00
Bruno Oliveira
efc9a0ecb5 Merge pull request #3567 from michael-k/doc-typo
Fix typo in documentation
2018-06-11 09:09:53 -03:00
Michael Käufl
4a78711067 Fix typo in documentation 2018-06-11 13:28:09 +02:00
Bruno Oliveira
5ea647a245 Attempt to fix flaky test_request_garbage on Windows
Fix #3564
2018-06-10 19:18:44 -03:00
Bruno Oliveira
11705040ac Merge pull request #3563 from asottile/undetermined_location_none
Print <undetermined location> instead of None for warnings
2018-06-10 16:19:50 -03:00
Anthony Sottile
fe81de6150 git mv changelog/3554.bugfix{,.rst} 2018-06-10 10:53:15 -07:00
Anthony Sottile
49f621de76 Print <undetermined location> instead of None for warnings 2018-06-10 10:51:36 -07:00
Bruno Oliveira
10b0b81346 Revert change of Callinfo.result default value
As discussed in #3560, this should not go to master because this breaks
the API.

Reverts commits:

1a7dcd73cf
198e993969
2018-06-10 11:47:58 -03:00
Alan Velasco
80f8a3ad7c Merge pull request #3560 from alanbato/fix_callinfo_rrp
Add a default value to CallInfo.result
2018-06-09 21:20:56 -07:00
Bruno Oliveira
198e993969 Format CHANGELOG 2018-06-09 21:31:32 -03:00
Alan Velasco
1a7dcd73cf Add a default value to CallInfo.result 2018-06-09 16:58:23 -07:00
Bruno Oliveira
7c8d072241 Merge pull request #3558 from nicoddemus/doc-strict
Add documentation blurb for --strict
2018-06-09 19:38:31 -03:00
Bruno Oliveira
c4f72e4d13 Apply code review changes 2018-06-09 12:40:39 -03:00
Bruno Oliveira
3667a52ba2 Remove Mark api from mark.rst
Feels out of place in there, plus the reference documentation
already contains the reference API to all mark-related classes
2018-06-09 12:02:28 -03:00
Bruno Oliveira
97d48ba60d Add documentation blurb for --strict
Fix #3549
2018-06-09 12:02:21 -03:00
Bruno Oliveira
55bbd3e3e2 Merge pull request #3553 from asottile/changelog_3552
Add changelog entry for #3552
2018-06-09 10:31:54 -03:00
Anthony Sottile
4c01dd651e Add changelog entry for #3552 2018-06-08 06:20:57 -07:00
Bruno Oliveira
472354c714 Merge pull request #3552 from asottile/remove_setup_py_test
Remove setup.py test now that it's broken
2018-06-08 08:28:18 -03:00
Anthony Sottile
c1d9ca81df Remove setup.py test now that it's broken 2018-06-07 22:01:14 -07:00
Bruno Oliveira
f389a4e91f Merge pull request #3545 from blueyed/int
Improve display of hint about --fulltrace with KeyboardInterrupt
2018-06-07 20:03:06 -03:00
Bruno Oliveira
942d363c03 Improve changelog formatting 2018-06-07 18:55:50 -03:00
Daniel Hahler
c30c137a95 Improve display of hint about --fulltrace with KeyboardInterrupt
- display the location first
- display hint about --fulltrace in parenthesis
2018-06-07 23:50:24 +02:00
Anthony Sottile
18157659ca Merge pull request #3544 from asottile/correct_changelot
Correct issue number in changelog
2018-06-06 14:06:13 -07:00
Anthony Sottile
60b34ec7ec Correct issue number in changelog 2018-06-06 13:27:59 -07:00
Bruno Oliveira
60273d7e99 Merge pull request #3541 from samueldg/docs/fix-plugin-list
Fix typo in plugin list example
2018-06-05 20:28:24 -03:00
Samuel Dion-Girardeau
d694290626 Fix typo in plugin list example 2018-06-05 18:27:59 -04:00
Bruno Oliveira
56b3a9eb8f Merge pull request #3534 from nicoddemus/release-3.6.1
Release 3.6.1
2018-06-05 14:45:00 -03:00
Ronny Pfannschmidt
464117b472 fix imports in tests 2018-06-05 10:20:36 +02:00
Ronny Pfannschmidt
1459cbe01f put config path finding and exceptions into own modules 2018-06-05 10:07:02 +02:00
Ronny Pfannschmidt
c9df77cbd6 move argument parser to own file 2018-06-05 09:55:28 +02:00
Ronny Pfannschmidt
026cd36237 make builtin plugins a list 2018-06-05 09:40:50 +02:00
Ronny Pfannschmidt
bc2247219f turn config into package
this prepares the splitting
2018-06-05 09:08:53 +02:00
Bruno Oliveira
2a79f58ba3 Fix linting 2018-06-04 22:14:04 -03:00
Bruno Oliveira
66ec0a50b6 Preparing release version 3.6.1 2018-06-05 01:11:27 +00:00
Bruno Oliveira
c58b67c540 Configure towncrier to use src directory 2018-06-05 01:10:36 +00:00
Bruno Oliveira
cc793a8575 Merge pull request #3522 from NiklasMM/fix/3461_factory-fixture-doc
Add factory fixture example to documentation.
2018-06-04 22:09:50 -03:00
Ronny Pfannschmidt
7f5cb46835 Merge pull request #3531 from hroncok/370b5
Module docstrings in 3.7 are not part of Module node anymore
2018-06-05 01:16:14 +02:00
Ronny Pfannschmidt
a7f9e8382b Merge pull request #3529 from asottile/unpy25
Remove some python2.5 compatibility code
2018-06-04 16:25:00 +02:00
Miro Hrončok
39ebdab1bc DRY in TestAssertionRewrite 2018-06-04 14:03:13 +02:00
Miro Hrončok
9a6fa33c69 Module docstrings in 3.7 are not part of Module node anymore
Fixes https://github.com/pytest-dev/pytest/issues/3530
2018-06-04 13:58:35 +02:00
Anthony Sottile
2f6555dfd3 Add changelog entry 2018-06-03 13:12:49 -07:00
Anthony Sottile
ff19f273a9 Use six to import queue instead of py.builtin._tryimport 2018-06-03 13:12:49 -07:00
Anthony Sottile
04f08b67a4 __code__ and __self__ are attributes in python2.6+ 2018-06-03 13:12:46 -07:00
Anthony Sottile
3d0717813a bytes() is a builtin in python2.6+ 2018-06-03 11:54:36 -07:00
Ronny Pfannschmidt
d609b635f4 Merge pull request #3528 from asottile/blacken_docs
blacken docs
2018-06-03 18:40:11 +02:00
Anthony Sottile
0f2d7dc73c blacken docs 2018-06-03 07:58:46 -07:00
Anthony Sottile
5c878001ea Manual docs changes so syntax is parseable 2018-06-02 20:19:17 -07:00
Bruno Oliveira
4dc5f7897d Fix typo in marks.rst 2018-05-31 12:43:48 -03:00
Niklas Meinzer
08de3dad33 Add factory fixture example to documentation.
Close https://github.com/pytest-dev/pytest/issues/3461
2018-05-31 11:21:10 +02:00
Bruno Oliveira
5748c5ce8f Fix default cache directory to .pytest_cache 2018-05-30 08:24:10 -03:00
Bruno Oliveira
b6a302d0a8 Merge pull request #3516 from RonnyPfannschmidt/travis-optimize
enable pip/pre-commit caching on travis and appveyor
2018-05-27 12:51:51 -03:00
Ronny Pfannschmidt
130f76f66e enable pip/pre-commit caching on travis and appveyor 2018-05-27 13:05:10 +02:00
Bruno Oliveira
075faa5e2b Merge pull request #3513 from RonnyPfannschmidt/src-layout
switch to src layout
2018-05-26 10:36:23 -03:00
Ronny Pfannschmidt
eaa882f3d5 switch to src layout 2018-05-26 09:10:38 +02:00
Ronny Pfannschmidt
ee6c54904b Merge pull request #3512 from asottile/rst_via_pre_commit
Call rst-lint directly with pre-commit
2018-05-26 08:09:11 +02:00
Anthony Sottile
2a8463c745 Call rst-lint directly with pre-commit 2018-05-25 18:16:54 -07:00
Bruno Oliveira
1d451c786d Merge pull request #3509 from nicoddemus/marshal-3503
Write rewritten code using file.write(marshal.dumps())
2018-05-25 21:24:45 -03:00
Bruno Oliveira
a36bab448f Merge pull request #3485 from RonnyPfannschmidt/pre-commit-hook
adapt Pre commit hook and black
2018-05-25 19:03:45 -03:00
Bruno Oliveira
437a6fb224 Add "black code-style" badge 2018-05-25 18:23:59 -03:00
Bruno Oliveira
1b16d649f9 Fix formatting of merged files 2018-05-25 18:21:48 -03:00
Bruno Oliveira
6f8547cc1a Merge branch 'master' into pre-commit-hook 2018-05-25 18:14:43 -03:00
Bruno Oliveira
b5a94d8e6c Write rewritten code using file.write(marshal.dumps())
This works around the fact that some libraries might monkey patch
the file object, so the previous approach of marshal.dump(co, file)
breaks because file is not a built-in file object anymore.

Fix #3503
2018-05-25 17:24:23 -03:00
Bruno Oliveira
65bc43dc56 Merge pull request #3505 from Avira/tox-lowercase
Fix tox spelling (all lower case).
2018-05-25 17:07:12 -03:00
Oliver Bestwalter
c55635d42a Fix tox spelling (all lower case). 2018-05-25 09:54:03 +02:00
Bruno Oliveira
93fdad28aa Merge pull request #3499 from jeffreyrack/3491-junit-logging
3491 - Fixed a bug where stdout and stderr were logged twice by junitxml for xfail tests.
2018-05-24 20:50:16 -03:00
Bruno Oliveira
48215fdcb9 Merge pull request #3500 from RonnyPfannschmidt/fix-3498-unittest-marks
fix #3498 - correctly consider marks on unittest classes
2018-05-24 13:51:17 -03:00
Ronny Pfannschmidt
5a6a580765 clean env for the linting stage 2018-05-24 14:18:34 +02:00
Ronny Pfannschmidt
df17bb2bd3 switch linting tox env to use pre-commit, clean out travis linting env as unneeded 2018-05-24 14:17:09 +02:00
Ronny Pfannschmidt
6eb7af5a4e experimentally add pre-commit for linting in travis 2018-05-24 13:51:15 +02:00
Bruno Oliveira
bc25d51b2f Re-word changelog 2018-05-24 07:27:40 -03:00
Ronny Pfannschmidt
9ed1289b01 run black on test_source_multiline_block.py 2018-05-24 12:12:12 +02:00
Ronny Pfannschmidt
5a0c9aca63 correctly instantiate fixtureinfo for unittest tests, fixes #3498 2018-05-24 10:29:42 +02:00
Ronny Pfannschmidt
da2c2e8492 more debugging for #3498 2018-05-24 09:58:36 +02:00
Ronny Pfannschmidt
74cfdc5feb add failing test for #3498 2018-05-24 07:30:38 +02:00
Jeffrey Rackauckas
b4e0265622 Removed whitespace from empty line. 2018-05-23 20:15:28 -07:00
Jeffrey Rackauckas
210ad22dbe Updating changelog text 2018-05-23 19:43:06 -07:00
Jeffrey Rackauckas
6c519b1280 Fixed a bug where stdout and stderr were logged twice by junitxml. 2018-05-23 19:34:45 -07:00
Ronny Pfannschmidt
57a55cd0a3 restore formatting of test_source_multiline_block 2018-05-23 20:26:13 +02:00
Ronny Pfannschmidt
d4bf2ff8f5 fix test_source 2018-05-23 18:22:18 +02:00
Ronny Pfannschmidt
3e08c4ee64 sort out flake8 issues and unicode name usage 2018-05-23 18:12:04 +02:00
Ronny Pfannschmidt
703e4b11ba run black 2018-05-23 16:48:46 +02:00
Ronny Pfannschmidt
3e1590bcfc sort out pyupgrade fallout 2018-05-23 16:45:58 +02:00
Ronny Pfannschmidt
86fc31db8d apply most other hooks and opt out of black reformating 2018-05-23 16:45:58 +02:00
Ronny Pfannschmidt
b60376dc28 add pre-commit to CONTRIBUTING.txt 2018-05-23 16:45:23 +02:00
Ronny Pfannschmidt
3b9e063fe8 fix line endings 2018-05-23 16:45:23 +02:00
Ronny Pfannschmidt
9aacb4635e run pyupgrade 2018-05-23 16:45:09 +02:00
Ronny Pfannschmidt
d41119ed04 add the config 2018-05-23 16:45:09 +02:00
Bruno Oliveira
afde9f07f7 Update number of tests in email template 2018-05-23 08:06:27 -03:00
Bruno Oliveira
b4cd010d71 Merge pull request #3495 from nicoddemus/release-3.6.0
Release 3.6.0
2018-05-23 07:51:30 -03:00
Bruno Oliveira
45e7703133 Move mark revamp note to the top of the CHANGELOG 2018-05-22 21:12:51 -03:00
Bruno Oliveira
d70e910b65 Preparing release version 3.6.0 2018-05-23 00:07:48 +00:00
Bruno Oliveira
c55db1faac Merge remote-tracking branch 'upstream/master' into release-3.6.0 2018-05-23 00:03:58 +00:00
Bruno Oliveira
16583a6d43 Add missing libs to tasks/requirements.txt 2018-05-23 00:03:47 +00:00
Bruno Oliveira
7985eff5b4 Merge pull request #3497 from hroncok/approx_compat_import
Import Mapping and Sequence from compat in python_api::approx
2018-05-22 20:57:29 -03:00
Miro Hrončok
5072226f69 Import Mapping and Sequence from compat in python_api::approx
Related to https://github.com/pytest-dev/pytest/issues/3339

Fixes a DeprecationWarning on Python 3.7

Adds Mapping to compat
2018-05-22 22:25:15 +02:00
Ronny Pfannschmidt
6c8d46d8ea Merge pull request #3487 from tgoodlet/detect_pytest_hook_prefix
Detect `pytest_` prefixed hooks
2018-05-22 21:36:58 +02:00
Bruno Oliveira
7d0c9837ce Merge pull request #3459 from RonnyPfannschmidt/mark-iter-name-filter
introduce name filtering for marker iteration again
2018-05-21 13:24:39 -03:00
Bruno Oliveira
8e17e32253 Merge pull request #3492 from timhughes/patch-1
fix typo in docs
2018-05-20 15:51:03 -03:00
Tim Hughes
f0b855369c fix typo 2018-05-20 19:14:06 +01:00
Ronny Pfannschmidt
4aa7ebaf52 Merge pull request #3490 from nicoddemus/merge-master-into-features
Merge master into features
2018-05-19 11:36:11 +02:00
Tyler Goodlet
486b786cb2 Add trivial changelog entry 2018-05-18 12:02:50 -04:00
Bruno Oliveira
674879976f Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-05-18 12:30:08 -03:00
Tyler Goodlet
d4065a9166 Detect pytest_ prefixed hooks
`pluggy` is deprecating the `implprefix` argument in the next major
release so implement this detection in our derived plugin manager.

Relates to pytest-dev/pluggy#145
2018-05-17 20:38:54 -04:00
Bruno Oliveira
e7f75f69f2 Small grammar fix in CHANGELOG 2018-05-17 21:20:43 -03:00
Bruno Oliveira
5be85a1f55 Merge changelog marks refactoring changelog entries as discussed in review 2018-05-17 21:18:12 -03:00
Ammar Najjar
9ddd573774 Issue #3295: add changelog doc entry for adding a missing argument in
the examples
2018-05-17 23:11:37 +02:00
Ammar Najjar
f99da9058f Issue #3295: Correct the usage of --last-failed-no-failures documentation
- add the missing --last-failed argument in the presented examples, for they are missleading and lead to think that the missing argument is not needed.
2018-05-17 23:07:55 +02:00
Bruno Oliveira
bb626fe8a7 Fix typo in mark.rst 2018-05-17 16:06:00 -03:00
Ronny Pfannschmidt
45faaeca7a Merge pull request #3480 from nicoddemus/deprecated-deadlne-hypothesis
Attempt to fix CI problems related to Hypothesis
2018-05-17 20:18:27 +02:00
Bruno Oliveira
11fb384efb Fix link to skipif tutorial in ref docs 2018-05-17 10:15:47 -03:00
Bruno Oliveira
5edad01d4e Merge pull request #3476 from avirlrma/master
change doc copyright year to range and auto update year
2018-05-16 17:53:23 -03:00
Bruno Oliveira
f5361a302c Use a more recent hypothesis version on CI 2018-05-16 07:35:02 -03:00
Bruno Oliveira
94e62dfc50 Increase hypothesis deadline
The value is pretty close to the new default that will come out in
future hypothesis versions, which is generating a deprecation error
on CI.

Using a loose deadline because CI boxes are not reliable in how much
CPU power they have available
2018-05-16 07:34:53 -03:00
Bruno Oliveira
afe4800daf Fix deprecation notice in Node.get_marker 2018-05-15 21:47:40 -03:00
Bruno Oliveira
2cd159e8c5 Add section on how to update marks and add ref to the deprecation notice 2018-05-15 21:35:27 -03:00
Bruno Oliveira
718ba83600 Small adjustment to the CHANGELOG 2018-05-15 21:02:05 -03:00
Bruno Oliveira
1b2f4f4483 Small rewording to the CHANGELOG 2018-05-15 21:01:37 -03:00
Bruno Oliveira
f68bab06b4 Reword the changelog 2018-05-15 18:24:14 -03:00
Bruno Oliveira
a4425cb4af Merge pull request #3469 from scop/dropthedot
#dropthedot
2018-05-15 08:00:28 -03:00
Bruno Oliveira
01d2d81d1f Merge pull request #3468 from scop/spelling
Spelling and grammar fixes
2018-05-15 07:59:56 -03:00
aviral1701
f14e097635 added changelog and added my name to the authors 2018-05-15 12:54:48 +05:30
aviral1701
a59f677d93 change doc copyright year to range and auto update year 2018-05-15 12:48:04 +05:30
Bruno Oliveira
36614b0a3d Fix formatting in CHANGELOG entry 2018-05-14 09:56:36 -03:00
Ville Skyttä
b4370c08b9 #dropthedot 2018-05-13 12:09:47 +02:00
Ville Skyttä
aa51fcb2b6 Spelling and grammar fixes 2018-05-13 12:06:09 +02:00
Ronny Pfannschmidt
4914135fdf introduce name filtering for marker iteration again 2018-05-11 21:48:15 +02:00
Ronny Pfannschmidt
84b37e1b57 Merge pull request #3452 from nicoddemus/fix-flaky-xdist-test
Attempt to fix flaky test on Python 2
2018-05-05 20:18:06 +02:00
Bruno Oliveira
fa76a5c8fe Attempt to fix flaky test on Python 2
This test sometimes fails on AppVeyor with:

```
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <listiterator object at 0x0549DC50>
    leaked_types = sum(1 for _ in gc.garbage
>                   if 'PseudoFixtureDef' in str(_))
E   UnicodeEncodeError: 'ascii' codec can't encode character u'\u263a' in position 23: ordinal not in range(128)
test_request_garbage.py:19: UnicodeEncodeError
====================== 1 passed, 1 error in 1.39 seconds ======================
```

Use our internal "safe_repr" function to handle Encode errors: who knows
what objects are in garbage after all.
2018-05-04 17:56:51 -03:00
Ronny Pfannschmidt
27651f4032 Merge pull request #3444 from nicoddemus/escape-whitespace-diffs
Escape whitespace only strings when diffing them on failed assertions
2018-05-04 18:14:35 +02:00
Bruno Oliveira
413b1aa4e9 Rename internal function as suggested during review 2018-05-04 11:08:35 -03:00
Bruno Oliveira
dca77b2273 Escape whitespace only strings when diffing them on failed assertions
Fix #3443
2018-05-03 20:38:00 -03:00
Bruno Oliveira
35f53a7353 Merge pull request #3442 from RonnyPfannschmidt/fix-3441-markexpr-markstorage
Fix #3441 let mark expressions be populated from the modern marker storage
2018-05-03 19:27:07 -03:00
Ronny Pfannschmidt
e6a86e0f4c add tests for #3441 2018-05-03 17:33:59 +02:00
Bruno Oliveira
b03b387861 Merge pull request #3436 from brianmaissy/feature/enter_pdb_on_keyboard_interrupt
--pdb treats KeyboardInterrupt as exception
2018-05-03 12:20:43 -03:00
Ronny Pfannschmidt
a5cf55dd4a fix test_mark_option_custom - it used the legacy keyword storage for addign markers 2018-05-03 16:33:16 +02:00
Ronny Pfannschmidt
63ef46dd91 fix #3441 - use iter-marks to populate markexpr namespace 2018-05-03 16:28:47 +02:00
Ronny Pfannschmidt
7834b45002 Merge pull request #3437 from nicoddemus/mark-changelog
Improve changelog note about markers
2018-05-02 06:45:39 +02:00
Bruno Oliveira
ccaa979f27 Improve changelog note about markers
Also changed the title in the docs because the previous title had
the same level as the title, making it appear in a separate entry
in `contents.rst`
2018-05-01 19:27:53 -03:00
Bruno Oliveira
1a880be85b Remove unused import to fix linting 2018-05-01 19:08:29 -03:00
Brian Maissy
c258fe1459 --pdb treats KeyboardInterrupt as exception 2018-05-02 00:58:35 +03:00
turturica
7d0dba18de Removed _CompatProperty("Package") 2018-04-27 10:23:15 -07:00
Ronny Pfannschmidt
08aed1a6bf Merge pull request #3433 from nicoddemus/conda-forge-badge
Use conda-forge badge instead of anaconda's
2018-04-27 16:11:58 +02:00
Bruno Oliveira
b49e9191ac Use conda-forge badge instead of anaconda's
Just noticed that conda-forge has its own badge so let's use that
2018-04-27 10:23:28 -03:00
turturica
6fc7f07a80 Workaround for py36-xdist failure. 2018-04-26 23:05:03 -07:00
Bruno Oliveira
febccae037 Merge pull request #3431 from jdufresne/pypi
Update all pypi.python.org URLs to pypi.org
2018-04-26 13:15:46 -03:00
Jon Dufresne
d2bf0bf9bb Update all pypi.python.org URLs to pypi.org
For details on the new PyPI, see the blog post:

https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
2018-04-26 06:49:33 -07:00
turturica
05b5b64379 Merge remote-tracking branch 'upstream/features' into features 2018-04-25 21:20:39 -07:00
turturica
229c8e551d Fix parametrized fixtures reordering. 2018-04-25 18:44:54 -07:00
Ronny Pfannschmidt
5ba0663827 Merge pull request #3428 from nicoddemus/merge-master-into-features
Merge master into features
2018-04-25 14:04:41 +02:00
Bruno Oliveira
63368e07ea Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-04-24 21:26:45 -03:00
Bruno Oliveira
0b2b73c36a Remove CHANGELOG entries left by old bug in towncrier 2018-04-24 21:25:13 -03:00
Bruno Oliveira
69b1c2d4f6 Merge pull request #3424 from nicoddemus/release-3.5.1
Preparing release version 3.5.1
2018-04-24 19:30:54 -03:00
turturica
d483b401ee Merge remote-tracking branch 'upstream/features' into features 2018-04-24 13:45:10 -07:00
turturica
acacf75f49 Added another package-scoped fixture test.
Changed existing complex tests to use package fixtures.
2018-04-24 13:32:58 -07:00
Bruno Oliveira
4a92011e6e Fix note about importing from collections.abc 2018-04-24 07:06:52 -03:00
Ronny Pfannschmidt
6e62fc98ff Merge pull request #2849 from ApaDoctor/disable-repeated-fixture
provide error fixture applied to the same func
2018-04-24 06:36:54 +02:00
Bruno Oliveira
132fb61eba Merge remote-tracking branch 'upstream/features' into ApaDoctor/disable-repeated-fixture 2018-04-23 22:24:53 -03:00
Bruno Oliveira
03850cf962 Add test for applying fixture twice
Fix #2334
2018-04-23 22:17:46 -03:00
Bruno Oliveira
f05230c679 Move #3221 to trivial section in the CHANGELOG 2018-04-23 19:27:07 -03:00
Bruno Oliveira
d61a7670a1 Merge pull request #3422 from rachel1792/master
updated doc to delete deprecated hook: Issue #3417
2018-04-23 19:24:52 -03:00
Bruno Oliveira
8d56641590 Preparing release version 3.5.1 2018-04-23 22:24:21 +00:00
Bruno Oliveira
2a480c59ae Merge pull request #3367 from brianmaissy/feature/indicative_error_for_parametrize_with_default_argument
added indicative error when parametrizing an argument with a default …
2018-04-23 11:04:36 -03:00
Rachel Kogan
6ea4c12da7 updated doc to delete deprecated hook 2018-04-22 21:56:18 -04:00
turturica
f8350c6304 Fix an issue that popped up only on Windows. 2018-04-21 19:51:33 -07:00
turturica
fedc78522b Build a stack of all previous packages instead of just the one closest to the initial argument(s).
Address #3358 by caching nodes in a session dict.
2018-04-21 18:39:42 -07:00
turturica
b0474398ec Fix a formatting error. 2018-04-20 18:18:44 -07:00
turturica
dc90c9108f Collapse all parent nested package fixtures when pointing to a sub-node.
Example:
Given this hierarchy: p1.s1.s2.s3
I want to run pytest p1/s1/s2/s3/foo.py

If there are any package fixtures defined at p1..s2 levels, they should also be executed.
2018-04-20 17:15:09 -07:00
turturica
69031d0033 Forgot one file from previous commit. 2018-04-20 15:54:21 -07:00
turturica
e44d4e6508 Merge remote-tracking branch 'upstream/features' into features 2018-04-20 15:21:24 -07:00
turturica
c416b1d935 Don't stop at the first package when looking up package-scoped fixtures.
Example:
package1.subpackage1
package1.subpackage2

package1's setup/teardown were executed again when exiting subpackage1 and entering subpackage2.
2018-04-20 15:04:58 -07:00
Bruno Oliveira
f0084608cc Merge pull request #3407 from rachel1792/master
Fix typo in caplog fixture documentation: Issue #3406
2018-04-20 17:41:04 -03:00
Bruno Oliveira
cefeba33ef Update changelog formatting 2018-04-20 17:40:19 -03:00
Bruno Oliveira
3318e53d01 Merge pull request #3382 from feuillemorte/3290-improve-monkeypatch
#3290 improve monkeypatch
2018-04-19 17:05:52 -03:00
Ronny Pfannschmidt
1cc79ffc10 Merge pull request #3408 from MarSoft/patch-2
Fix typo in the comment
2018-04-19 09:21:11 +02:00
Семён Марьясин
d8015764e6 Fix typo in the comment 2018-04-18 12:47:52 +03:00
turturica
7d923c389e Merge remote-tracking branch 'upstream/features' into features 2018-04-18 00:11:03 -07:00
Rachel Kogan
48c99f62e3 add changelog 2018-04-17 16:24:32 -04:00
Rachel Kogan
8ff8a82c51 Merge branch 'master' of github.com:pytest-dev/pytest 2018-04-17 16:21:04 -04:00
Rachel Kogan
bb8984f5ed fix error in caplog docs. 2018-04-17 16:17:29 -04:00
turturica
c02e8d8b0d Fix test collection when tests are passed as IDs at the command line. Note this is still broken due to #3358. 2018-04-16 11:44:05 -07:00
Bruno Oliveira
159cd39777 Merge pull request #3401 from kohr-h/underscore_fixtures
Mention omission of fixtures with leading '_', closes #3398
2018-04-16 13:25:10 -03:00
Brian Maissy
857098fe0f added indicative error when parametrizing an argument with a default value 2018-04-15 20:52:57 +03:00
feuillemorte
283ac8bbf4 #3290 Fix doc 2018-04-14 21:06:58 +03:00
Holger Kohr
6626d2aef9 Mention omission of fixtures with leading '_', closes #3398 2018-04-14 11:04:00 +02:00
feuillemorte
ba7cad3962 #3290 Fix comments 2018-04-13 16:00:07 +03:00
Ronny Pfannschmidt
36f6687b70 Merge pull request #3397 from darrenburns/patch-2
Fix some mistakes in contributing.rst
2018-04-13 13:20:31 +02:00
Darren Burns
86def48b25 Fix some mistakes in contributing.rst 2018-04-13 11:33:58 +01:00
Bruno Oliveira
0024b71f1c Merge pull request #3395 from darrenburns/patch-1
Update CONTRIBUTING.rst
2018-04-12 18:42:33 -03:00
Ronny Pfannschmidt
17a43dc4a5 firther enhance the links in contributing.rst 2018-04-12 22:06:06 +02:00
Darren Burns
958f146125 Update CONTRIBUTING.rst
Fixes a broken link in CONTRIBUTING.rst
2018-04-12 20:54:32 +01:00
Ronny Pfannschmidt
13a6f63cd9 Merge pull request #3390 from nicoddemus/atomic-pyc-writes
Attempt to solve race-condition which corrupts .pyc files on Windows
2018-04-12 13:57:39 +02:00
Bruno Oliveira
aa95a425d7 Attempt to solve race-condition which corrupts .pyc files on Windows
This uses of the `atomicwrites` library.

This is very hard to create a reliable test for.

Fix #3008
2018-04-12 08:19:28 -03:00
Bruno Oliveira
015626ce69 Merge pull request #3384 from nicoddemus/leak-frame
Reset reference to failed test frame before each test executes
2018-04-12 07:53:34 -03:00
Ronny Pfannschmidt
f9a908abb8 Merge pull request #3388 from nicoddemus/simplify-tox
Simplify tox to avoid repetition
2018-04-12 11:32:48 +02:00
Ronny Pfannschmidt
160c309371 Merge pull request #3391 from nicoddemus/project-urls
Add additional project urls to setup.py
2018-04-12 08:54:12 +02:00
Ronny Pfannschmidt
f79b0324fe Merge pull request #3387 from nicoddemus/merge-master-into-features
Merge master into features
2018-04-12 08:39:22 +02:00
Bruno Oliveira
37ee4fbc48 Add additional project urls to setup.py
According to:

https://packaging.python.org/tutorials/distributing-packages/#project-urls

Those URLs are displayed in the project page in Warehouse (new PyPI).
2018-04-11 23:46:17 -03:00
turturica
35df2cdbee Fix linting error. 2018-04-11 15:45:43 -07:00
turturica
2b1410895e Add package scoped fixtures #2283 2018-04-11 15:39:42 -07:00
Bruno Oliveira
888fcbc4b4 Simplify tox to avoid repetition
Also took the opportunity to:

* Use more cores for py*-xdist environments
* Update freeze test to use py36
2018-04-11 18:30:15 -03:00
Bruno Oliveira
10a7160549 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2018-04-11 18:07:47 -03:00
feuillemorte
a4daac7eb0 #3290 Fix doc 2018-04-11 12:46:02 +03:00
feuillemorte
97be076f29 #3290 Added changelog file 2018-04-11 12:45:46 +03:00
feuillemorte
3d60f955f0 #3290 Added test 2018-04-11 12:45:37 +03:00
feuillemorte
659c044372 #3290 Improved monkeypatch to support some form of with statement 2018-04-11 12:45:26 +03:00
Bruno Oliveira
6e8e3c967a Add changelog entry for #2798 2018-04-10 21:09:57 -03:00
Bruno Oliveira
78c900448e Add acceptance test for #2798 2018-04-10 21:04:30 -03:00
Ronny Pfannschmidt
372bcdba0c Merge pull request #3380 from nicoddemus/marks-fixes
Add the list of issues fixed by the new marker implementation to the docs
2018-04-10 14:33:58 +02:00
Bruno Oliveira
d1ba19acad Add the list of issues fixed by the new marker implementation to the docs
This will help make users more understanding if their code breaks under the
new implementation.
2018-04-10 08:00:32 -03:00
Ronny Pfannschmidt
2241c98b18 Merge pull request #3331 from tonybaloney/breakpoint_support
Support for the new builtin breakpoint function in Python 3.7
2018-04-10 07:15:29 +02:00
Bruno Oliveira
715337011b Merge pull request #3317 from RonnyPfannschmidt/marker-pristine-node-storage
introduce a distinct searchable non-broken storage for markers
2018-04-09 19:40:12 -03:00
Bruno Oliveira
e012dbe346 Merge pull request #3373 from backbord/master
Fix issue #3372
2018-04-06 22:10:57 -03:00
Tim Strazny
5bd8561016 linting: unfortunate dedent be gone. 2018-04-06 17:36:35 +02:00
Tim Strazny
846d91fb95 Follow Ronny's advice and use `type in base_type`. 2018-04-06 16:23:04 +02:00
Tim Strazny
0cd74dc324 Ensure object is class before calling issubclass. 2018-04-06 14:40:30 +02:00
Tim Strazny
ec2d8223cf Fix issue #3372 2018-04-06 14:16:12 +02:00
Ronny Pfannschmidt
4df8f2b153 fix doc build, use noindex on the mark reference 2018-04-06 08:13:28 +02:00
Ronny Pfannschmidt
5d4fe87b72 Merge pull request #3371 from nicoddemus/remove-labels-descriptions
Remove label descriptions from development guide
2018-04-06 07:39:15 +02:00
Bruno Oliveira
f17dfa4292 Remove label descriptions from development guide
The descriptions have been moved directly to GitHub's new label description
slot.
2018-04-05 20:55:08 -03:00
Bruno Oliveira
ab91771efc Merge pull request #3370 from dchudz/patch-1
no-capture in sample code demo'ing plugin
2018-04-05 20:25:04 -03:00
Bruno Oliveira
ef34de960c Merge pull request #3360 from RonnyPfannschmidt/xml_property_yay
record_property is no longer experimental
2018-04-05 20:03:22 -03:00
David Chudzicki
db24723b61 no-capture in sample code demo'ing plugin 2018-04-05 20:34:26 +02:00
Bruno Oliveira
e534cc81a3 Fix typos in docs 2018-04-05 14:45:30 -03:00
Ronny Pfannschmidt
3582e1f6be include more detail on the marker api issues 2018-04-05 18:46:33 +02:00
Ronny Pfannschmidt
a8ad89cdb3 fix documentation references 2018-04-05 18:39:57 +02:00
Bruno Oliveira
48bcc3419f Reword the docs on markers a bit 2018-04-05 12:39:21 -03:00
Ronny Pfannschmidt
1fcadeb2ce extend marker docs with reasons on marker iteration 2018-04-05 15:30:31 +02:00
Ronny Pfannschmidt
2018cf12b1 fix the record_property test 2018-04-05 14:05:26 +02:00
Bruno Oliveira
ba407b5eb6 Clear sys.last_* attributes before running an item
Otherwise we will keep the last failed exception around forever

Related to #2798
2018-04-04 20:36:07 -03:00
Ronny Pfannschmidt
ad0b4330e7 Merge pull request #3364 from sscherfke/more-itertools
Use correct spelling for "more-itertools"
2018-04-03 21:30:42 +02:00
Stefan Scherfke
9aa2a83785 Use correct spelling for "more-itertools" 2018-04-03 16:48:32 +02:00
Bruno Oliveira
0762666bd1 Remove unused pytestPDB import 2018-04-03 08:58:40 -03:00
Ronny Pfannschmidt
7c0c91a7a2 fix record_property test 2018-04-03 08:00:57 +02:00
Ronny Pfannschmidt
9326759a63 Merge pull request #3357 from nicoddemus/session-hooks-ref
Add reference docs for pytest_sessionstart/finish and update their docstrings
2018-04-03 07:08:47 +02:00
Anthony Shaw
4d847593b3 remove a test that would fail because pytest is being used to test itself 2018-04-03 10:40:56 +10:00
Bruno Oliveira
9a62ebf490 Merge pull request #3355 from irmen/py37deprfixes
change collections.abc import to fix deprecation warnings on python 3.7
2018-04-02 20:31:26 -03:00
Ronny Pfannschmidt
211f3c47b5 record_property is no longer experimental 2018-04-01 15:39:43 +02:00
Ronny Pfannschmidt
a2974dd067 fix doc building 2018-03-30 16:48:27 +02:00
Floris Bruynooghe
77128ee2dc Merge pull request #3356 from nicoddemus/remove-stale-changelog-entries
Remove stale CHANGELOG entries
2018-03-30 14:19:38 +02:00
Ronny Pfannschmidt
7454a381e2 update configuration examples to new mark api 2018-03-30 08:36:58 +02:00
Ronny Pfannschmidt
e4a52c1795 prevent doubleing of function level marks 2018-03-30 08:19:45 +02:00
Ronny Pfannschmidt
802da781c6 fix method reference to iter_markers in warning 2018-03-30 07:50:12 +02:00
Bruno Oliveira
3fc2c94b5e Switch imports based on python versions, my bad 2018-03-29 23:15:03 -03:00
Bruno Oliveira
daf1de0fed Add reference docs for pytest_sessionstart/finish and update their docstrings 2018-03-29 19:48:48 -03:00
Bruno Oliveira
e5eba8419a Remove stale CHANGELOG entries
Those were not removed in the last release because of a bug in
towncrier; I was about to fallback to don't use the .rst extension
for entries but just noticed that this was fixed in towncrier 17.8.0
so it should no longer be a problem.
2018-03-29 19:21:59 -03:00
Bruno Oliveira
6a81aae4f2 Move compatibility imports to compat.py and fix linting 2018-03-29 19:05:15 -03:00
Bruno Oliveira
8ca9321940 Move compatibility imports to compat.py and fix linting 2018-03-29 19:02:35 -03:00
Irmen de Jong
faded25ee8 chage collections.abc import to fix deprecation warnings on python 3.7 2018-03-29 20:02:00 +02:00
Ronny Pfannschmidt
dbb1b5a227 remove NodeMarkers, turn own_markers into a list and use iter_markers api exclusively 2018-03-29 18:24:10 +02:00
Ronny Pfannschmidt
8805036fd8 add node iteration apis
TODO: add tests
2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
ee51fa5881 add api to iterate over all marerks of a node 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
2cb7e725ce document the hack used to avoid duplicate markers due Instance collectors 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
02315c0489 remove unnecessary of in the code figuring the fixture names 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
a92a51b01b clarify find_markers return value 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
159ea9b7c0 turn Markinfo into atts clsas, and return correct instances of it from node.get_marker 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
775fb96ac3 first changelog entry 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
ced1316bc8 add docstrings for nodemarkers 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
5e56e9b4f6 refactor node markers, remove need to be aware of nodes 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
2d06ae0f65 base metafunc fixtureinfo on the functiondefinition to caputure its marks 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
99015bfc86 fix most of metafunc tests by mocking 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
180ae09202 deprecate markinfo and fix up most marker scoping access while completely breaking metafunc testing 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
e8feee0612 fix up the mark evaluator validity check 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
f1a1695aaa enable deep merging test - new structure fixed it 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
2707221559 port mark evaluation to the new storage and fix a bug in evaluation 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
360d608da4 introduce a own storage for markers 2018-03-29 17:52:01 +02:00
Ronny Pfannschmidt
f1c9efc358 Merge pull request #3353 from nicoddemus/fixture-param-marks-docs
Add docs about using pytest.param in parametrized fixtures
2018-03-29 10:57:28 +02:00
Bruno Oliveira
804392e5f2 Fix tests that check that breakpoint function is configured/restored
* Execute pytest in a subprocess in cases of tests which change global
  state
* Parametrize with --pdb and without the flag
2018-03-28 20:19:28 -03:00
Bruno Oliveira
0a3cd881f6 Add docs about using pytest.param in parametrized fixtures 2018-03-28 19:35:10 -03:00
Anthony Shaw
09e5a226dc add broken test 2018-03-29 09:03:20 +11:00
Ronny Pfannschmidt
2efaf39ed8 Merge pull request #3349 from jeffreyrack/3348-unknown-argument
3348: raise error on unknown arguments to raises
2018-03-28 21:45:59 +02:00
Bruno Oliveira
7656581302 Update changelog formatting 2018-03-28 07:31:26 -03:00
Bruno Oliveira
bfe773bfc8 Use shorter 'if kwargs' check as requested during review 2018-03-28 07:30:14 -03:00
Jeffrey Rackauckas
a5d9fbe2b0 Change pytest.raises to use match instead of matches 2018-03-27 20:24:15 -07:00
Jeffrey Rackauckas
34afded06d Update pytest.raises to raise a TypeError when an invalid keyword argument is passed. 2018-03-27 19:57:15 -07:00
Anthony Shaw
3998b70ff6 add test for custom environment variable 2018-03-28 09:02:37 +11:00
Bruno Oliveira
060f047a7e Use full link in CHANGELOG
Our rst-linter unfortunately doesn't accept `ref` directives in the CHANGELOG files
2018-03-27 18:35:47 -03:00
Bruno Oliveira
2962c7367c Merge pull request #3307 from KKoukiou/rhv-qe-fix
logging.py: Don't change log level of the root logger to bigger numeric value
2018-03-27 18:03:22 -03:00
Bruno Oliveira
0a4200bbb3 Improve docs formatting 2018-03-27 07:40:52 -03:00
Anthony Shaw
b45006e9a3 fix syntax 2018-03-27 21:26:55 +11:00
Anthony Shaw
671ab5a36c update documentation for new feature 2018-03-27 21:02:43 +11:00
Anthony Shaw
f1f4c8c104 updates for code review recommendations 2018-03-27 17:38:17 +11:00
Bruno Oliveira
6cfed00a61 Tweak changelog entry 2018-03-26 20:48:05 -03:00
Bruno Oliveira
ff3d13ed0e Update typo in fixture.rst 2018-03-26 11:20:33 -03:00
Katerina Koukiou
d895f5d6fc logging.py: Don't change log level of the root logger to bigger numeric value 2018-03-26 10:11:49 +02:00
Anthony Shaw
e97bd87ee2 fix assertion when hypothesis is installed (which is should be for developing in pytest) 2018-03-23 16:24:15 +11:00
Anthony Shaw
242fb7852b linting and removed double test 2018-03-23 15:39:34 +11:00
Anthony Shaw
1ec99132e6 add myself to authors 2018-03-23 15:31:57 +11:00
Anthony Shaw
dcbba381d4 add changelog entry 2018-03-23 15:31:16 +11:00
Anthony Shaw
db581eabcb add tests to validate that --pdbcls custom debugger classes will be called when breakpoint() is used 2018-03-23 15:30:05 +11:00
Anthony Shaw
0e83e4f292 conditional for resetting of sys.breakpointhook for cleanup where breakpoint() not supported 2018-03-23 14:26:16 +11:00
Anthony Shaw
21ada0fa23 add check for support of breakpoint() and use Custom Pdb class when system default is set 2018-03-23 14:20:10 +11:00
Anthony Shaw
a1ff758d0d "Added acceptance tests for configuration of sys.breakpointhook and resetting back when system default (pdb) is used"" 2018-03-23 14:18:56 +11:00
Bruno Oliveira
ed118d7f20 Merge remote-tracking branch 'upstream/features' 2018-03-22 21:06:09 -03:00
Bruno Oliveira
5ecff65285 Merge pull request #3327 from nicoddemus/release-3.5.0
Release 3.5.0
2018-03-22 20:58:15 -03:00
Ronny Pfannschmidt
fc4f769888 Merge pull request #3336 from nicoddemus/filter-warnings-ref-doc
Add missing reference doc for filterwarnings mark
2018-03-22 18:43:17 +01:00
Bruno Oliveira
f78953fd81 Add missing reference doc for filterwarnings mark 2018-03-22 13:02:30 -03:00
Ronny Pfannschmidt
d7d4afea17 Merge pull request #3330 from nicoddemus/remove-custom-flatten
Remove terminal.flatten function in favor of collapse from more_itertools
2018-03-22 14:22:47 +01:00
Anthony Shaw
5a53b9aabb move tests to test_pdb 2018-03-22 20:40:35 +11:00
Anthony Shaw
91d99affb7 assert that custom PDB class is used as breakpoint hook where supported 2018-03-22 17:40:14 +11:00
Anthony Shaw
3bca983a95 add a module global for whether the current runtime supports the builtin breakpoint function 2018-03-22 17:27:28 +11:00
Anthony Shaw
9edcb7edc6 start acceptance testing 2018-03-22 17:25:27 +11:00
Bruno Oliveira
6c2739d1e6 Add CHANGELOG for #3330 2018-03-21 20:23:17 -03:00
Bruno Oliveira
4e717eb626 Remove terminal.flatten function in favor of collapse from more_itertools 2018-03-21 20:20:46 -03:00
Bruno Oliveira
a7a39f1364 Update CHANGELOG formatting 2017-10-18 19:26:10 -02:00
ApaDoctor
cfd16d0dac provide error fixture applied to the same func
provide error fixture applied to the same func

provide error fixture applied to the same func
2017-10-18 12:01:08 +02:00
395 changed files with 29580 additions and 16460 deletions

View File

@@ -1,4 +1,9 @@
[run]
omit =
# standlonetemplate is read dynamically and tested by test_genscript
*standalonetemplate.py
source = pytest,_pytest,testing/
parallel = 1
branch = 1
[paths]
source = src/
.tox/*/lib/python*/site-packages/
.tox\*\Lib\site-packages\

2
.gitattributes vendored
View File

@@ -1 +1 @@
CHANGELOG merge=union
*.bat text eol=crlf

View File

@@ -3,7 +3,7 @@ Thanks for submitting a PR, your contribution is really appreciated!
Here's a quick checklist that should be present in PRs (you can delete this text from the final description, this is
just a guideline):
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](/changelog/README.rst) for details.
- [ ] Create a new changelog file in the `changelog` folder, with a name like `<ISSUE NUMBER>.<TYPE>.rst`. See [changelog/README.rst](https://github.com/pytest-dev/pytest/blob/master/changelog/README.rst) for details.
- [ ] Target the `master` branch for bug fixes, documentation updates and trivial changes.
- [ ] Target the `features` branch for new features and removals/deprecations.
- [ ] Include documentation when adding new features.

149
.github/labels.toml vendored Normal file
View File

@@ -0,0 +1,149 @@
["os: cygwin"]
color = "006b75"
description = "cygwin platform-specific problem"
name = "os: cygwin"
["os: linux"]
color = "1d76db"
description = "linux platform-specific problem"
name = "os: linux"
["os: mac"]
color = "bfdadc"
description = "mac platform-specific problem"
name = "os: mac"
["os: windows"]
color = "fbca04"
description = "windows platform-specific problem"
name = "os: windows"
["plugin: argcomplete"]
color = "d4c5f9"
description = "related to the argcomplete builtin plugin"
name = "plugin: argcomplete"
["plugin: cache"]
color = "c7def8"
description = "related to the cache builtin plugin"
name = "plugin: cache"
["plugin: capture"]
color = "1d76db"
description = "related to the capture builtin plugin"
name = "plugin: capture"
["plugin: debugging"]
color = "dd52a8"
description = "related to the debugging builtin plugin"
name = "plugin: debugging"
["plugin: doctests"]
color = "fad8c7"
description = "related to the doctests builtin plugin"
name = "plugin: doctests"
["plugin: junitxml"]
color = "c5def5"
description = "related to the junitxml builtin plugin"
name = "plugin: junitxml"
["plugin: logging"]
color = "ff5432"
description = "related to the logging builtin plugin"
name = "plugin: logging"
["plugin: monkeypatch"]
color = "0e8a16"
description = "related to the monkeypatch builtin plugin"
name = "plugin: monkeypatch"
["plugin: nose"]
color = "bfdadc"
description = "related to the nose integration builtin plugin"
name = "plugin: nose"
["plugin: pastebin"]
color = "bfd4f2"
description = "related to the pastebin builtin plugin"
name = "plugin: pastebin"
["plugin: pytester"]
color = "c5def5"
description = "related to the pytester builtin plugin"
name = "plugin: pytester"
["plugin: tmpdir"]
color = "bfd4f2"
description = "related to the tmpdir builtin plugin"
name = "plugin: tmpdir"
["plugin: unittest"]
color = "006b75"
description = "related to the unittest integration builtin plugin"
name = "plugin: unittest"
["plugin: warnings"]
color = "fef2c0"
description = "related to the warnings builtin plugin"
name = "plugin: warnings"
["plugin: xdist"]
color = "5319e7"
description = "related to the xdist external plugin"
name = "plugin: xdist"
["status: critical"]
color = "e11d21"
description = "grave problem or usability issue that affects lots of users"
name = "status: critical"
["status: easy"]
color = "bfe5bf"
description = "easy issue that is friendly to new contributor"
name = "status: easy"
["status: help wanted"]
color = "159818"
description = "developers would like help from experts on this topic"
name = "status: help wanted"
["status: needs information"]
color = "5319e7"
description = "reporter needs to provide more information; can be closed after 2 or more weeks of inactivity"
name = "status: needs information"
["topic: collection"]
color = "006b75"
description = "related to the collection phase"
name = "topic: collection"
["topic: config"]
color = "006b75"
description = "related to config handling, argument parsing and config file"
name = "topic: config"
["topic: fixtures"]
color = "5319e7"
description = "anything involving fixtures directly or indirectly"
name = "topic: fixtures"
["topic: marks"]
color = "b60205"
description = "related to marks, either the general marks or builtin"
name = "topic: marks"
["topic: parametrize"]
color = "fbca04"
description = "related to @pytest.mark.parametrize"
name = "topic: parametrize"
["topic: reporting"]
color = "fef2c0"
description = "related to terminal output and user-facing messages and errors"
name = "topic: reporting"
["topic: rewrite"]
color = "0e8a16"
description = "related to the assertion rewrite mechanism"
name = "topic: rewrite"

8
.gitignore vendored
View File

@@ -19,11 +19,12 @@ include/
.hypothesis/
# autogenerated
_pytest/_version.py
src/_pytest/_version.py
# setuptools
.eggs/
doc/*/_build
doc/*/.doctrees
build/
dist/
*.egg-info
@@ -35,6 +36,11 @@ env/
.cache
.pytest_cache
.coverage
.coverage.*
coverage.xml
.ropeproject
.idea
.hypothesis
.pydevproject
.project
.settings

53
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,53 @@
exclude: doc/en/example/py2py3/test_py2.py
repos:
- repo: https://github.com/ambv/black
rev: 18.6b4
hooks:
- id: black
args: [--safe, --quiet]
language_version: python3
- repo: https://github.com/asottile/blacken-docs
rev: v0.3.0
hooks:
- id: blacken-docs
additional_dependencies: [black==18.9b0]
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: debug-statements
exclude: _pytest/debugging.py
language_version: python3
- id: flake8
language_version: python3
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.3.3
hooks:
- id: reorder-python-imports
args: ['--application-directories=.:src']
- repo: https://github.com/asottile/pyupgrade
rev: v1.10.1
hooks:
- id: pyupgrade
args: [--keep-percent-format]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.1.0
hooks:
- id: rst-backticks
- repo: local
hooks:
- id: rst
name: rst
entry: rst-lint --encoding utf-8
files: ^(CHANGELOG.rst|HOWTORELEASE.rst|README.rst|changelog/.*)$
language: python
additional_dependencies: [pygments, restructuredtext_lint]
- id: changelogs-rst
name: changelog filenames
language: fail
entry: 'changelog files must be named ####.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst'
exclude: changelog/(\d+\.(feature|bugfix|doc|deprecation|removal|vendor|trivial).rst|README.rst|_template.rst)
files: ^changelog/

View File

@@ -1,46 +1,66 @@
sudo: false
language: python
dist: xenial
stages:
- baseline
- name: test
if: repo = pytest-dev/pytest AND tag IS NOT present
- name: deploy
if: repo = pytest-dev/pytest AND tag IS present
python:
- '3.6'
- '3.7'
install:
- pip install --upgrade --pre tox
env:
matrix:
# coveralls is not listed in tox's envlist, but should run in travis
- TOXENV=coveralls
# note: please use "tox --listenvs" to populate the build matrix below
- TOXENV=linting
- TOXENV=py27
- TOXENV=py34
- TOXENV=py36
- TOXENV=py27-pexpect
- TOXENV=py27-xdist
- TOXENV=py27-trial
- TOXENV=py27-numpy
- TOXENV=py27-pluggymaster
- TOXENV=py36-pexpect
- TOXENV=py36-xdist
- TOXENV=py36-trial
- TOXENV=py36-numpy
- TOXENV=py36-pluggymaster
# Specialized factors for py27.
- TOXENV=py27-nobyte
- TOXENV=doctesting
- TOXENV=docs
- TOXENV=py27-xdist
- TOXENV=py27-pluggymaster PYTEST_NO_COVERAGE=1
# Specialized factors for py37.
- TOXENV=py37-pexpect,py37-trial,py37-numpy
- TOXENV=py37-pluggymaster PYTEST_NO_COVERAGE=1
- TOXENV=py37-freeze PYTEST_NO_COVERAGE=1
jobs:
include:
- env: TOXENV=pypy
# Coverage tracking is slow with pypy, skip it.
- env: TOXENV=pypy PYTEST_NO_COVERAGE=1
python: 'pypy-5.4'
dist: trusty
- env: TOXENV=py34
python: '3.4'
- env: TOXENV=py35
python: '3.5'
- env: TOXENV=py35-freeze
python: '3.5'
- env: TOXENV=py36
python: '3.6'
- env: TOXENV=py37
python: 'nightly'
- &test-macos
language: generic
os: osx
osx_image: xcode9.4
sudo: required
install:
- python -m pip install --pre tox
env: TOXENV=py27
- <<: *test-macos
env: TOXENV=py37
before_install:
- brew update
- brew upgrade python
- brew unlink python
- brew link python
- stage: baseline
env: TOXENV=py27-pexpect,py27-trial,py27-numpy
- env: TOXENV=py37-xdist
- env: TOXENV=linting,docs,doctesting
python: '3.7'
- stage: deploy
python: '3.6'
env:
env: PYTEST_NO_COVERAGE=1
install: pip install -U setuptools setuptools_scm
script: skip
deploy:
@@ -54,8 +74,29 @@ jobs:
tags: true
repo: pytest-dev/pytest
before_script:
- |
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
export COVERAGE_FILE="$PWD/.coverage"
export COVERAGE_PROCESS_START="$PWD/.coveragerc"
export _PYTEST_TOX_COVERAGE_RUN="coverage run -m"
export _PYTEST_TOX_EXTRA_DEP=coverage-enable-subprocess
fi
script: tox --recreate
after_success:
- |
if [[ "$PYTEST_NO_COVERAGE" != 1 ]]; then
set -e
# Add last TOXENV to $PATH.
PATH="$PWD/.tox/${TOXENV##*,}/bin:$PATH"
coverage combine
coverage xml --ignore-errors
coverage report -m --ignore-errors
bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -F "${TOXENV//-/,},linux"
fi
notifications:
irc:
channels:
@@ -65,3 +106,7 @@ notifications:
skip_join: true
email:
- pytest-commit@python.org
cache:
directories:
- $HOME/.cache/pip
- $HOME/.cache/pre-commit

34
AUTHORS
View File

@@ -10,18 +10,22 @@ Ahn Ki-Wook
Alan Velasco
Alexander Johnson
Alexei Kozlenok
Allan Feldman
Anatoly Bubenkoff
Anders Hovmöller
Andras Tim
Andrea Cimatoribus
Andreas Zeidler
Andrzej Ostrowski
Andy Freeland
Anthon van der Neut
Anthony Shaw
Anthony Sottile
Antony Lee
Armin Rigo
Aron Coyle
Aron Curzon
Aviral Verma
Aviv Palivoda
Barney Gale
Ben Webb
@@ -44,7 +48,9 @@ Christian Boelsen
Christian Theunert
Christian Tismer
Christopher Gilling
CrazyMerlyn
Cyrus Maden
Dhiren Serai
Daniel Grana
Daniel Hahler
Daniel Nuri
@@ -53,6 +59,7 @@ Danielle Jenkins
Dave Hunt
David Díaz-Barquero
David Mohr
David Szotten
David Vierra
Daw-Ran Liou
Denis Kirisov
@@ -69,6 +76,8 @@ Endre Galaczi
Eric Hunsberger
Eric Siegerman
Erik M. Bray
Fabien Zarifian
Fabio Zadrozny
Feng Ma
Florian Bruhin
Floris Bruynooghe
@@ -80,12 +89,15 @@ Greg Price
Grig Gheorghiu
Grigorii Eremeev (budulianin)
Guido Wesdorp
Guoqiang Zhang
Harald Armin Massa
Henk-Jaap Wagenaar
Hugo van Kemenade
Hui Wang (coldnight)
Ian Bicking
Ian Lesperance
Ionuț Turturică
Iwan Briquemont
Jaap Broekhuizen
Jan Balster
Janne Vanhala
@@ -94,6 +106,7 @@ Javier Domingo Cansino
Javier Romero
Jeff Rackauckas
Jeff Widman
Jenni Rinker
John Eddie Ayson
John Towler
Jon Sonesen
@@ -106,9 +119,11 @@ Jurko Gospodnetić
Justyna Janczyszyn
Kale Kundert
Katarzyna Jachim
Katerina Koukiou
Kevin Cox
Kodi B. Arfer
Kostis Anagnostopoulos
Kyle Altendorf
Lawrence Mitchell
Lee Kamentsky
Lev Maximov
@@ -122,6 +137,7 @@ Maik Figura
Mandeep Bhutani
Manuel Krebber
Marc Schlaich
Marcelo Duarte Trevisani
Marcin Bachry
Mark Abramowitz
Markus Unterwaditzer
@@ -142,16 +158,20 @@ Michael Droettboom
Michael Seifert
Michal Wajszczuk
Mihai Capotă
Mike Hoyle (hoylemd)
Mike Lundy
Miro Hrončok
Nathaniel Waisbrot
Ned Batchelder
Neven Mundar
Niclas Olofsson
Nicolas Delaby
Oleg Pidsadnyi
Oleg Sushchenko
Oliver Bestwalter
Omar Kohl
Omer Hadari
Ondřej Súkup
Patrick Hayes
Paweł Adamczak
Pedro Algarvio
@@ -166,6 +186,7 @@ Raphael Pierzina
Raquel Alegre
Ravi Chandra
Roberto Polli
Roland Puntaier
Romain Dorgueil
Roman Bolshakov
Ronny Pfannschmidt
@@ -174,7 +195,9 @@ Russel Winder
Ryan Wooden
Samuel Dion-Girardeau
Samuele Pedroni
Sankt Petersbug
Segev Finer
Serhii Mozghovyi
Simon Gomizelj
Skylar Downes
Srinivas Reddy Thatiparthy
@@ -183,25 +206,32 @@ Stefan Zimmermann
Stefano Taschini
Steffen Allner
Stephan Obermann
Sven-Hendrik Haase
Tadek Teleżyński
Tarcisio Fischer
Tareq Alayan
Ted Xiao
Thomas Grainger
Thomas Hisch
Tim Strazny
Tom Dalton
Tom Viner
Tomer Keren
Trevor Bekolay
Tyler Goodlet
Tzu-ping Chung
Vasily Kuznetsov
Victor Maryama
Victor Uriarte
Vidar T. Fauske
Virgil Dupras
Vitaly Lashmanov
Vlad Dragos
Wil Cooley
William Lee
Wim Glenn
Wouter van Ackooy
Xuan Luong
Xuecong Liao
Zac Hatfield-Dodds
Zoltán Máté
Roland Puntaier
Allan Feldman

File diff suppressed because it is too large Load Diff

16
CITATION Normal file
View File

@@ -0,0 +1,16 @@
NOTE: Change "x.y" by the version you use. If you are unsure about which version
you are using run: `pip show pytest`.
Text:
[pytest] pytest x.y, 2004
Krekel et al., https://github.com/pytest-dev/pytest
BibTeX:
@misc{pytestx.y,
title = {pytest x.y},
author = {Krekel, Holger and Oliveira, Bruno and Pfannschmidt, Ronny and Bruynooghe, Floris and Laugher, Brianna and Bruhin, Florian},
year = {2004},
url = {https://github.com/pytest-dev/pytest},
}

View File

@@ -48,8 +48,7 @@ fix the bug itself.
Fix bugs
--------
Look through the GitHub issues for bugs. Here is a filter you can use:
https://github.com/pytest-dev/pytest/labels/type%3A%20bug
Look through the `GitHub issues for bugs <https://github.com/pytest-dev/pytest/labels/type:%20bug>`_.
:ref:`Talk <contact>` to developers to find out how you can fix specific bugs.
@@ -60,8 +59,7 @@ Don't forget to check the issue trackers of your favourite plugins, too!
Implement features
------------------
Look through the GitHub issues for enhancements. Here is a filter you can use:
https://github.com/pytest-dev/pytest/labels/enhancement
Look through the `GitHub issues for enhancements <https://github.com/pytest-dev/pytest/labels/type:%20enhancement>`_.
:ref:`Talk <contact>` to developers to find out how you can implement specific
features.
@@ -141,7 +139,7 @@ Here's a rundown of how a repository transfer usually proceeds
* ``joedoe`` transfers repository ownership to ``pytest-dev`` administrator ``calvin``.
* ``calvin`` creates ``pytest-xyz-admin`` and ``pytest-xyz-developers`` teams, inviting ``joedoe`` to both as **maintainer**.
* ``calvin`` transfers repository to ``pytest-dev`` and configures team access:
- ``pytest-xyz-admin`` **admin** access;
- ``pytest-xyz-developers`` **write** access;
@@ -164,13 +162,14 @@ Preparing Pull Requests
Short version
~~~~~~~~~~~~~
#. Fork the repository;
#. Target ``master`` for bugfixes and doc changes;
#. Fork the repository.
#. Enable and install `pre-commit <https://pre-commit.com>`_ to ensure style-guides and code checks are followed.
#. Target ``master`` for bugfixes and doc changes.
#. Target ``features`` for new features or functionality changes.
#. Follow **PEP-8**. There's a ``tox`` command to help fixing it: ``tox -e fix-lint``.
#. Follow **PEP-8** for naming and `black <https://github.com/ambv/black>`_ for formatting.
#. Tests are run using ``tox``::
tox -e linting,py27,py36
tox -e linting,py27,py37
The test environments above are usually enough to cover most cases locally.
@@ -178,7 +177,7 @@ Short version
and one of ``bugfix``, ``removal``, ``feature``, ``vendor``, ``doc`` or
``trivial`` for the issue type.
#. Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please
add yourself to the ``AUTHORS`` file, in alphabetical order;
add yourself to the ``AUTHORS`` file, in alphabetical order.
Long version
@@ -204,20 +203,30 @@ Here is a simple overview, with pytest-specific bits:
$ git clone git@github.com:YOUR_GITHUB_USERNAME/pytest.git
$ cd pytest
# now, to fix a bug create your own branch off "master":
$ git checkout -b your-bugfix-branch-name master
# or to instead add a feature create your own branch off "features":
$ git checkout -b your-feature-branch-name features
Given we have "major.minor.micro" version numbers, bugfixes will usually
be released in micro releases whereas features will be released in
Given we have "major.minor.micro" version numbers, bugfixes will usually
be released in micro releases whereas features will be released in
minor releases and incompatible changes in major releases.
If you need some help with Git, follow this quick start
guide: https://git.wiki.kernel.org/index.php/QuickStart
#. Install `pre-commit <https://pre-commit.com>`_ and its hook on the pytest repo::
$ pip install --user pre-commit
$ pre-commit install
Afterwards ``pre-commit`` will run whenever you commit.
https://pre-commit.com/ is a framework for managing and maintaining multi-language pre-commit hooks
to ensure code-style and code formatting is consistent.
#. Install tox
Tox is used to run all the tests and will automatically setup virtualenvs
@@ -228,32 +237,27 @@ Here is a simple overview, with pytest-specific bits:
#. Run all the tests
You need to have Python 2.7 and 3.6 available in your system. Now
You need to have Python 2.7 and 3.7 available in your system. Now
running tests is as simple as issuing this command::
$ tox -e linting,py27,py36
$ tox -e linting,py27,py37
This command will run tests via the "tox" tool against Python 2.7 and 3.6
This command will run tests via the "tox" tool against Python 2.7 and 3.7
and also perform "lint" coding-style checks.
#. You can now edit your local working copy. Please follow PEP-8.
You can now make the changes you want and run the tests again as necessary.
If you have too much linting errors, try running::
$ tox -e fix-lint
To fix pep8 related errors.
#. You can now edit your local working copy and run the tests again as necessary. Please follow PEP-8 for naming.
You can pass different options to ``tox``. For example, to run tests on Python 2.7 and pass options to pytest
(e.g. enter pdb on failure) to pytest you can do::
$ tox -e py27 -- --pdb
Or to only run tests in a particular test module on Python 3.6::
Or to only run tests in a particular test module on Python 3.7::
$ tox -e py36 -- testing/test_config.py
$ tox -e py37 -- testing/test_config.py
When committing, ``pre-commit`` will re-format the files if necessary.
#. Commit and push once your tests pass and you are happy with your change(s)::
@@ -276,6 +280,47 @@ Here is a simple overview, with pytest-specific bits:
base: features # if it's a feature
Writing Tests
----------------------------
Writing tests for plugins or for pytest itself is often done using the `testdir fixture <https://docs.pytest.org/en/latest/reference.html#testdir>`_, as a "black-box" test.
For example, to ensure a simple test passes you can write:
.. code-block:: python
def test_true_assertion(testdir):
testdir.makepyfile(
"""
def test_foo():
assert True
"""
)
result = testdir.runpytest()
result.assert_outcomes(failed=0, passed=1)
Alternatively, it is possible to make checks based on the actual output of the termal using
*glob-like* expressions:
.. code-block:: python
def test_true_assertion(testdir):
testdir.makepyfile(
"""
def test_foo():
assert False
"""
)
result = testdir.runpytest()
result.stdout.fnmatch_lines(["*assert False*", "*1 failed*"])
When choosing a file where to write a new test, take a look at the existing files and see if there's
one file which looks like a good fit. For example, a regression test about a bug in the ``--lf`` option
should go into ``test_cacheprovider.py``, given that this option is implemented in ``cacheprovider.py``.
If in doubt, go ahead and open a PR with your best guess and we can discuss this over the code.
Joining the Development Team
----------------------------

View File

@@ -10,10 +10,6 @@ taking a lot of time to make a new one.
pytest releases must be prepared on **Linux** because the docs and examples expect
to be executed in that platform.
#. Install development dependencies in a virtual environment with::
pip3 install -U -r tasks/requirements.txt
#. Create a branch ``release-X.Y.Z`` with the version for the release.
* **patch releases**: from the latest ``master``;
@@ -22,18 +18,23 @@ taking a lot of time to make a new one.
Ensure your are in a clean work tree.
#. Generate docs, changelog, announcements and a **local** tag::
#. Using ``tox``, generate docs, changelog, announcements::
invoke generate.pre-release <VERSION>
$ tox -e release -- <VERSION>
This will generate a commit with all the changes ready for pushing.
#. Open a PR for this branch targeting ``master``.
#. After all tests pass and the PR has been approved, publish to PyPI by pushing the tag::
git tag <VERSION>
git push git@github.com:pytest-dev/pytest.git <VERSION>
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
#. Merge the PR into ``master``.
#. Send an email announcement with the contents from::
doc/en/announce/release-<VERSION>.rst
@@ -45,5 +46,3 @@ taking a lot of time to make a new one.
* testing-in-python@lists.idyll.org (only major/minor releases)
And announce it on `Twitter <https://twitter.com/>`_ with the ``#pytest`` hashtag.
#. After a minor/major release, merge ``release-X.Y.Z`` into ``master`` and push (or open a PR).

View File

@@ -1,21 +1,23 @@
.. image:: http://docs.pytest.org/en/latest/_static/pytest1.png
:target: http://docs.pytest.org
.. image:: https://docs.pytest.org/en/latest/_static/pytest1.png
:target: https://docs.pytest.org/en/latest/
:align: center
:alt: pytest
------
.. image:: https://img.shields.io/pypi/v/pytest.svg
:target: https://pypi.python.org/pypi/pytest
:target: https://pypi.org/project/pytest/
.. image:: https://anaconda.org/conda-forge/pytest/badges/version.svg
.. image:: https://img.shields.io/conda/vn/conda-forge/pytest.svg
:target: https://anaconda.org/conda-forge/pytest
.. image:: https://img.shields.io/pypi/pyversions/pytest.svg
:target: https://pypi.python.org/pypi/pytest
:target: https://pypi.org/project/pytest/
.. image:: https://img.shields.io/coveralls/pytest-dev/pytest/master.svg
:target: https://coveralls.io/r/pytest-dev/pytest
.. image:: https://codecov.io/gh/pytest-dev/pytest/branch/master/graph/badge.svg
:target: https://codecov.io/gh/pytest-dev/pytest
:alt: Code coverage Status
.. image:: https://travis-ci.org/pytest-dev/pytest.svg?branch=master
:target: https://travis-ci.org/pytest-dev/pytest
@@ -23,6 +25,9 @@
.. image:: https://ci.appveyor.com/api/projects/status/mrgbjaua7t33pg6b?svg=true
:target: https://ci.appveyor.com/project/pytestbot/pytest
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
.. image:: https://www.codetriage.com/pytest-dev/pytest/badges/users.svg
:target: https://www.codetriage.com/pytest-dev/pytest
@@ -37,6 +42,7 @@ An example of a simple test:
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5
@@ -61,23 +67,23 @@ To execute it::
========================== 1 failed in 0.04 seconds ===========================
Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <http://docs.pytest.org/en/latest/getting-started.html#our-first-test-run>`_ for more examples.
Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <https://docs.pytest.org/en/latest/getting-started.html#our-first-test-run>`_ for more examples.
Features
--------
- Detailed info on failing `assert statements <http://docs.pytest.org/en/latest/assert.html>`_ (no need to remember ``self.assert*`` names);
- Detailed info on failing `assert statements <https://docs.pytest.org/en/latest/assert.html>`_ (no need to remember ``self.assert*`` names);
- `Auto-discovery
<http://docs.pytest.org/en/latest/goodpractices.html#python-test-discovery>`_
<https://docs.pytest.org/en/latest/goodpractices.html#python-test-discovery>`_
of test modules and functions;
- `Modular fixtures <http://docs.pytest.org/en/latest/fixture.html>`_ for
- `Modular fixtures <https://docs.pytest.org/en/latest/fixture.html>`_ for
managing small or parametrized long-lived test resources;
- Can run `unittest <http://docs.pytest.org/en/latest/unittest.html>`_ (or trial),
`nose <http://docs.pytest.org/en/latest/nose.html>`_ test suites out of the box;
- Can run `unittest <https://docs.pytest.org/en/latest/unittest.html>`_ (or trial),
`nose <https://docs.pytest.org/en/latest/nose.html>`_ test suites out of the box;
- Python 2.7, Python 3.4+, PyPy 2.3, Jython 2.5 (untested);
@@ -87,7 +93,7 @@ Features
Documentation
-------------
For full documentation, including installation, tutorials and PDF documents, please see http://docs.pytest.org.
For full documentation, including installation, tutorials and PDF documents, please see https://docs.pytest.org/en/latest/.
Bugs/Requests
@@ -99,13 +105,13 @@ Please use the `GitHub issue tracker <https://github.com/pytest-dev/pytest/issue
Changelog
---------
Consult the `Changelog <http://docs.pytest.org/en/latest/changelog.html>`__ page for fixes and enhancements of each version.
Consult the `Changelog <https://docs.pytest.org/en/latest/changelog.html>`__ page for fixes and enhancements of each version.
License
-------
Copyright Holger Krekel and others, 2004-2017.
Copyright Holger Krekel and others, 2004-2018.
Distributed under the terms of the `MIT`_ license, pytest is free and open source software.

File diff suppressed because it is too large Load Diff

View File

@@ -1,135 +0,0 @@
""" interactive debugging with PDB, the Python Debugger. """
from __future__ import absolute_import, division, print_function
import pdb
import sys
from doctest import UnexpectedException
def pytest_addoption(parser):
group = parser.getgroup("general")
group._addoption(
'--pdb', dest="usepdb", action="store_true",
help="start the interactive Python debugger on errors.")
group._addoption(
'--pdbcls', dest="usepdb_cls", metavar="modulename:classname",
help="start a custom interactive Python debugger on errors. "
"For example: --pdbcls=IPython.terminal.debugger:TerminalPdb")
def pytest_configure(config):
if config.getvalue("usepdb_cls"):
modname, classname = config.getvalue("usepdb_cls").split(":")
__import__(modname)
pdb_cls = getattr(sys.modules[modname], classname)
else:
pdb_cls = pdb.Pdb
if config.getvalue("usepdb"):
config.pluginmanager.register(PdbInvoke(), 'pdbinvoke')
old = (pdb.set_trace, pytestPDB._pluginmanager)
def fin():
pdb.set_trace, pytestPDB._pluginmanager = old
pytestPDB._config = None
pytestPDB._pdb_cls = pdb.Pdb
pdb.set_trace = pytestPDB.set_trace
pytestPDB._pluginmanager = config.pluginmanager
pytestPDB._config = config
pytestPDB._pdb_cls = pdb_cls
config._cleanup.append(fin)
class pytestPDB(object):
""" Pseudo PDB that defers to the real pdb. """
_pluginmanager = None
_config = None
_pdb_cls = pdb.Pdb
@classmethod
def set_trace(cls):
""" invoke PDB set_trace debugging, dropping any IO capturing. """
import _pytest.config
frame = sys._getframe().f_back
if cls._pluginmanager is not None:
capman = cls._pluginmanager.getplugin("capturemanager")
if capman:
capman.suspend_global_capture(in_=True)
tw = _pytest.config.create_terminal_writer(cls._config)
tw.line()
tw.sep(">", "PDB set_trace (IO-capturing turned off)")
cls._pluginmanager.hook.pytest_enter_pdb(config=cls._config)
cls._pdb_cls().set_trace(frame)
class PdbInvoke(object):
def pytest_exception_interact(self, node, call, report):
capman = node.config.pluginmanager.getplugin("capturemanager")
if capman:
out, err = capman.suspend_global_capture(in_=True)
sys.stdout.write(out)
sys.stdout.write(err)
_enter_pdb(node, call.excinfo, report)
def pytest_internalerror(self, excrepr, excinfo):
for line in str(excrepr).split("\n"):
sys.stderr.write("INTERNALERROR> %s\n" % line)
sys.stderr.flush()
tb = _postmortem_traceback(excinfo)
post_mortem(tb)
def _enter_pdb(node, excinfo, rep):
# XXX we re-use the TerminalReporter's terminalwriter
# because this seems to avoid some encoding related troubles
# for not completely clear reasons.
tw = node.config.pluginmanager.getplugin("terminalreporter")._tw
tw.line()
showcapture = node.config.option.showcapture
for sectionname, content in (('stdout', rep.capstdout),
('stderr', rep.capstderr),
('log', rep.caplog)):
if showcapture in (sectionname, 'all') and content:
tw.sep(">", "captured " + sectionname)
if content[-1:] == "\n":
content = content[:-1]
tw.line(content)
tw.sep(">", "traceback")
rep.toterminal(tw)
tw.sep(">", "entering PDB")
tb = _postmortem_traceback(excinfo)
post_mortem(tb)
rep._pdbshown = True
return rep
def _postmortem_traceback(excinfo):
if isinstance(excinfo.value, UnexpectedException):
# A doctest.UnexpectedException is not useful for post_mortem.
# Use the underlying exception instead:
return excinfo.value.exc_info[2]
else:
return excinfo._excinfo[2]
def _find_last_non_hidden_frame(stack):
i = max(0, len(stack) - 1)
while i and stack[i][0].f_locals.get("__tracebackhide__", False):
i -= 1
return i
def post_mortem(t):
class Pdb(pytestPDB._pdb_cls):
def get_stack(self, f, t):
stack, i = pdb.Pdb.get_stack(self, f, t)
if f is None:
i = _find_last_non_hidden_frame(stack)
return stack, i
p = Pdb()
p.reset()
p.interaction(None, t)

View File

@@ -1,64 +0,0 @@
"""
This module contains deprecation messages and bits of code used elsewhere in the codebase
that is planned to be removed in the next pytest release.
Keeping it in a central location makes it easy to track what is deprecated and should
be removed when the time comes.
"""
from __future__ import absolute_import, division, print_function
class RemovedInPytest4Warning(DeprecationWarning):
"""warning class for features removed in pytest 4.0"""
MAIN_STR_ARGS = 'passing a string to pytest.main() is deprecated, ' \
'pass a list of arguments instead.'
YIELD_TESTS = 'yield tests are deprecated, and scheduled to be removed in pytest 4.0'
FUNCARG_PREFIX = (
'{name}: declaring fixtures using "pytest_funcarg__" prefix is deprecated '
'and scheduled to be removed in pytest 4.0. '
'Please remove the prefix and use the @pytest.fixture decorator instead.')
CFG_PYTEST_SECTION = '[pytest] section in {filename} files is deprecated, use [tool:pytest] instead.'
GETFUNCARGVALUE = "use of getfuncargvalue is deprecated, use getfixturevalue"
RESULT_LOG = (
'--result-log is deprecated and scheduled for removal in pytest 4.0.\n'
'See https://docs.pytest.org/en/latest/usage.html#creating-resultlog-format-files for more information.'
)
MARK_INFO_ATTRIBUTE = RemovedInPytest4Warning(
"MarkInfo objects are deprecated as they contain the merged marks"
)
MARK_PARAMETERSET_UNPACKING = RemovedInPytest4Warning(
"Applying marks directly to parameters is deprecated,"
" please use pytest.param(..., marks=...) instead.\n"
"For more details, see: https://docs.pytest.org/en/latest/parametrize.html"
)
RECORD_XML_PROPERTY = (
'Fixture renamed from "record_xml_property" to "record_property" as user '
'properties are now available to all reporters.\n'
'"record_xml_property" is now deprecated.'
)
COLLECTOR_MAKEITEM = RemovedInPytest4Warning(
"pycollector makeitem was removed "
"as it is an accidentially leaked internal api"
)
METAFUNC_ADD_CALL = (
"Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0.\n"
"Please use Metafunc.parametrize instead."
)
PYTEST_PLUGINS_FROM_NON_TOP_LEVEL_CONFTEST = RemovedInPytest4Warning(
"Defining pytest_plugins in a non-top-level conftest is deprecated, "
"because it affects the entire directory tree in a non-explicit way.\n"
"Please move it to the top level conftest file instead."
)

View File

@@ -1,128 +0,0 @@
""" support for providing temporary directories to test functions. """
from __future__ import absolute_import, division, print_function
import re
import pytest
import py
from _pytest.monkeypatch import MonkeyPatch
class TempdirFactory(object):
"""Factory for temporary directories under the common base temp directory.
The base directory can be configured using the ``--basetemp`` option.
"""
def __init__(self, config):
self.config = config
self.trace = config.trace.get("tmpdir")
def ensuretemp(self, string, dir=1):
""" (deprecated) return temporary directory path with
the given string as the trailing part. It is usually
better to use the 'tmpdir' function argument which
provides an empty unique-per-test-invocation directory
and is guaranteed to be empty.
"""
# py.log._apiwarn(">1.1", "use tmpdir function argument")
return self.getbasetemp().ensure(string, dir=dir)
def mktemp(self, basename, numbered=True):
"""Create a subdirectory of the base temporary directory and return it.
If ``numbered``, ensure the directory is unique by adding a number
prefix greater than any existing one.
"""
basetemp = self.getbasetemp()
if not numbered:
p = basetemp.mkdir(basename)
else:
p = py.path.local.make_numbered_dir(prefix=basename,
keep=0, rootdir=basetemp, lock_timeout=None)
self.trace("mktemp", p)
return p
def getbasetemp(self):
""" return base temporary directory. """
try:
return self._basetemp
except AttributeError:
basetemp = self.config.option.basetemp
if basetemp:
basetemp = py.path.local(basetemp)
if basetemp.check():
basetemp.remove()
basetemp.mkdir()
else:
temproot = py.path.local.get_temproot()
user = get_user()
if user:
# use a sub-directory in the temproot to speed-up
# make_numbered_dir() call
rootdir = temproot.join('pytest-of-%s' % user)
else:
rootdir = temproot
rootdir.ensure(dir=1)
basetemp = py.path.local.make_numbered_dir(prefix='pytest-',
rootdir=rootdir)
self._basetemp = t = basetemp.realpath()
self.trace("new basetemp", t)
return t
def finish(self):
self.trace("finish")
def get_user():
"""Return the current user name, or None if getuser() does not work
in the current environment (see #1010).
"""
import getpass
try:
return getpass.getuser()
except (ImportError, KeyError):
return None
# backward compatibility
TempdirHandler = TempdirFactory
def pytest_configure(config):
"""Create a TempdirFactory and attach it to the config object.
This is to comply with existing plugins which expect the handler to be
available at pytest_configure time, but ideally should be moved entirely
to the tmpdir_factory session fixture.
"""
mp = MonkeyPatch()
t = TempdirFactory(config)
config._cleanup.extend([mp.undo, t.finish])
mp.setattr(config, '_tmpdirhandler', t, raising=False)
mp.setattr(pytest, 'ensuretemp', t.ensuretemp, raising=False)
@pytest.fixture(scope='session')
def tmpdir_factory(request):
"""Return a TempdirFactory instance for the test session.
"""
return request.config._tmpdirhandler
@pytest.fixture
def tmpdir(request, tmpdir_factory):
"""Return a temporary directory path object
which is unique to each test function invocation,
created as a sub directory of the base temporary
directory. The returned object is a `py.path.local`_
path object.
.. _`py.path.local`: https://py.readthedocs.io/en/latest/path.html
"""
name = request.node.name
name = re.sub(r"[\W]", "_", name)
MAXVAL = 30
if len(name) > MAXVAL:
name = name[:MAXVAL]
x = tmpdir_factory.mktemp(name, numbered=True)
return x

View File

@@ -1,96 +0,0 @@
from __future__ import absolute_import, division, print_function
import warnings
from contextlib import contextmanager
import pytest
from _pytest import compat
def _setoption(wmod, arg):
"""
Copy of the warning._setoption function but does not escape arguments.
"""
parts = arg.split(':')
if len(parts) > 5:
raise wmod._OptionError("too many fields (max 5): %r" % (arg,))
while len(parts) < 5:
parts.append('')
action, message, category, module, lineno = [s.strip()
for s in parts]
action = wmod._getaction(action)
category = wmod._getcategory(category)
if lineno:
try:
lineno = int(lineno)
if lineno < 0:
raise ValueError
except (ValueError, OverflowError):
raise wmod._OptionError("invalid lineno %r" % (lineno,))
else:
lineno = 0
wmod.filterwarnings(action, message, category, module, lineno)
def pytest_addoption(parser):
group = parser.getgroup("pytest-warnings")
group.addoption(
'-W', '--pythonwarnings', action='append',
help="set which warnings to report, see -W option of python itself.")
parser.addini("filterwarnings", type="linelist",
help="Each line specifies a pattern for "
"warnings.filterwarnings. "
"Processed after -W and --pythonwarnings.")
@contextmanager
def catch_warnings_for_item(item):
"""
catches the warnings generated during setup/call/teardown execution
of the given item and after it is done posts them as warnings to this
item.
"""
args = item.config.getoption('pythonwarnings') or []
inifilters = item.config.getini("filterwarnings")
with warnings.catch_warnings(record=True) as log:
for arg in args:
warnings._setoption(arg)
for arg in inifilters:
_setoption(warnings, arg)
mark = item.get_marker('filterwarnings')
if mark:
for arg in mark.args:
warnings._setoption(arg)
yield
for warning in log:
warn_msg = warning.message
unicode_warning = False
if compat._PY2 and any(isinstance(m, compat.UNICODE_TYPES) for m in warn_msg.args):
new_args = []
for m in warn_msg.args:
new_args.append(compat.ascii_escaped(m) if isinstance(m, compat.UNICODE_TYPES) else m)
unicode_warning = list(warn_msg.args) != new_args
warn_msg.args = new_args
msg = warnings.formatwarning(
warn_msg, warning.category,
warning.filename, warning.lineno, warning.line)
item.warn("unused", msg)
if unicode_warning:
warnings.warn(
"Warning is using unicode non convertible to ascii, "
"converting to a safe representation:\n %s" % msg,
UnicodeWarning)
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_protocol(item):
with catch_warnings_for_item(item):
yield

View File

@@ -1,34 +1,28 @@
environment:
COVERALLS_REPO_TOKEN:
secure: 2NJ5Ct55cHJ9WEg3xbSqCuv0rdgzzb6pnzOIG5OkMbTndw3wOBrXntWFoQrXiMFi
# this is pytest's token in coveralls.io, encrypted
# using pytestbot account as detailed here:
# https://www.appveyor.com/docs/build-configuration#secure-variables
matrix:
# coveralls is not in the default env list
- TOXENV: "coveralls"
# note: please use "tox --listenvs" to populate the build matrix below
- TOXENV: "linting"
- TOXENV: "py27"
- TOXENV: "py34"
- TOXENV: "py35"
- TOXENV: "py36"
- TOXENV: "pypy"
- TOXENV: "py27-pexpect"
- TOXENV: "py37-xdist"
- TOXENV: "py27-xdist"
- TOXENV: "py27-trial"
- TOXENV: "py27-numpy"
- TOXENV: "py27"
- TOXENV: "py37"
- TOXENV: "linting,docs,doctesting"
- TOXENV: "py36"
- TOXENV: "py35"
- TOXENV: "py34"
- TOXENV: "pypy"
PYTEST_NO_COVERAGE: "1"
# Specialized factors for py27.
- TOXENV: "py27-trial,py27-numpy,py27-nobyte"
- TOXENV: "py27-pluggymaster"
- TOXENV: "py36-pexpect"
- TOXENV: "py36-xdist"
- TOXENV: "py36-trial"
- TOXENV: "py36-numpy"
- TOXENV: "py36-pluggymaster"
- TOXENV: "py27-nobyte"
- TOXENV: "doctesting"
- TOXENV: "py35-freeze"
- TOXENV: "docs"
PYTEST_NO_COVERAGE: "1"
# Specialized factors for py37.
- TOXENV: "py37-trial,py37-numpy"
- TOXENV: "py37-pluggymaster"
PYTEST_NO_COVERAGE: "1"
- TOXENV: "py37-freeze"
PYTEST_NO_COVERAGE: "1"
matrix:
fast_finish: true
install:
- echo Installed Pythons
@@ -36,9 +30,24 @@ install:
- if "%TOXENV%" == "pypy" call scripts\install-pypy.bat
- C:\Python36\python -m pip install --upgrade pip
- C:\Python36\python -m pip install --upgrade --pre tox
build: false # Not a C# project, build stuff at the test step instead.
before_test:
- call scripts\prepare-coverage.bat
test_script:
- call scripts\call-tox.bat
- C:\Python36\python -m tox
on_success:
- call scripts\upload-coverage.bat
cache:
- '%LOCALAPPDATA%\pip\cache'
- '%USERPROFILE%\.cache\pre-commit'
# We don't deploy anything on tags with AppVeyor, we use Travis instead, so we
# might as well save resources
skip_tags: true

View File

@@ -1,12 +1,13 @@
import sys
if __name__ == '__main__':
if __name__ == "__main__":
import cProfile
import pytest
import pytest # NOQA
import pstats
script = sys.argv[1:] if len(sys.argv) > 1 else "empty.py"
stats = cProfile.run('pytest.cmdline.main(%r)' % script, 'prof')
stats = cProfile.run("pytest.cmdline.main(%r)" % script, "prof")
p = pstats.Stats("prof")
p.strip_dirs()
p.sort_stats('cumulative')
p.sort_stats("cumulative")
print(p.print_stats(500))

View File

@@ -1,19 +1,19 @@
# 10000 iterations, just for relative comparison
# 2.7.5 3.3.2
# FilesCompleter 75.1109 69.2116
# FastFilesCompleter 0.7383 1.0760
import timeit
imports = [
"from argcomplete.completers import FilesCompleter as completer",
"from _pytest._argcomplete import FastFilesCompleter as completer",
]
count = 1000 # only a few seconds
setup = "%s\nfc = completer()"
run = 'fc("/d")'
if __name__ == '__main__':
import sys
import timeit
from argcomplete.completers import FilesCompleter
from _pytest._argcomplete import FastFilesCompleter
count = 1000 # only a few seconds
setup = 'from __main__ import FastFilesCompleter\nfc = FastFilesCompleter()'
run = 'fc("/d")'
sys.stdout.write('%s\n' % (timeit.timeit(run,
setup=setup.replace('Fast', ''), number=count)))
sys.stdout.write('%s\n' % (timeit.timeit(run, setup=setup, number=count)))
if __name__ == "__main__":
print(timeit.timeit(run, setup=setup % imports[0], number=count))
print((timeit.timeit(run, setup=setup % imports[1], number=count)))

View File

@@ -1,3 +1,4 @@
import py
import six
for i in range(1000):
py.builtin.exec_("def test_func_%d(): pass" % i)
six.exec_("def test_func_%d(): pass" % i)

View File

@@ -1,12 +1,14 @@
import pytest
@pytest.fixture(scope='module', params=range(966))
@pytest.fixture(scope="module", params=range(966))
def foo(request):
return request.param
def test_it(foo):
pass
def test_it2(foo):
pass

View File

@@ -1,10 +1,12 @@
from six.moves import range
import pytest
SKIP = True
@pytest.mark.parametrize("x", xrange(5000))
@pytest.mark.parametrize("x", range(5000))
def test_foo(x):
if SKIP:
pytest.skip("heh")

View File

@@ -1 +0,0 @@
New ``--show-capture`` command-line option that allows to specify how to display captured output when tests fail: ``no``, ``stdout``, ``stderr``, ``log`` or ``all`` (the default).

View File

@@ -1 +0,0 @@
New ``--rootdir`` command-line option to override the rules for discovering the root directory. See `customize <https://docs.pytest.org/en/latest/customize.html>`_ in the documentation for details.

View File

@@ -1 +0,0 @@
Added a `reference <https://docs.pytest.org/en/latest/reference.html>`_ page to the docs.

View File

@@ -1 +0,0 @@
Suppress ``IOError`` when closing the temporary file used for capturing streams in Python 2.7.

View File

@@ -1 +0,0 @@
Fixtures are now instantiated based on their scopes, with higher-scoped fixtures (such as ``session``) being instantiated first than lower-scoped fixtures (such as ``function``). The relative order of fixtures of the same scope is kept unchanged, based in their declaration order and their dependencies.

View File

@@ -1,2 +0,0 @@
``record_xml_property`` renamed to ``record_property`` and is now compatible with xdist, markers and any reporter.
``record_xml_property`` name is now deprecated.

View File

@@ -1 +0,0 @@
``record_xml_property`` fixture is now deprecated in favor of the more generic ``record_property``.

View File

@@ -1 +0,0 @@
New ``--nf``, ``--new-first`` options: run new tests first followed by the rest of the tests, in both cases tests are also sorted by the file modified time, with more recent files coming first.

View File

@@ -1 +0,0 @@
Defining ``pytest_plugins`` is now deprecated in non-top-level conftest.py files, because they "leak" to the entire directory tree.

View File

@@ -1 +0,0 @@
New ``--last-failed-no-failures`` command-line option that allows to specify the behavior of the cache plugin's ```--last-failed`` feature when no tests failed in the last run (or no cache was found): ``none`` or ``all`` (the default).

View File

@@ -1 +0,0 @@
New ``--doctest-continue-on-failure`` command-line option to enable doctests to show multiple failures for each snippet, instead of stopping at the first failure.

View File

@@ -1 +0,0 @@
Captured log messages are added to the ``<system-out>`` tag in the generated junit xml file if the ``junit_logging`` ini option is set to ``system-out``. If the value of this ini option is ``system-err`, the logs are written to ``<system-err>``. The default value for ``junit_logging`` is ``no``, meaning captured logs are not written to the output file.

View File

@@ -1 +0,0 @@
Allow the logging plugin to handle ``pytest_runtest_logstart`` and ``pytest_runtest_logfinish`` hooks when live logs are enabled.

View File

@@ -1 +0,0 @@
Passing `--log-cli-level` in the command-line now automatically activates live logging.

View File

@@ -1 +0,0 @@
Add command line option ``--deselect`` to allow deselection of individual tests at collection time.

View File

@@ -1 +0,0 @@
Captured logs are printed before entering pdb.

View File

@@ -1 +0,0 @@
Deselected item count is now shown before tests are run, e.g. ``collected X items / Y deselected``.

View File

@@ -1 +0,0 @@
Change minimum requirement of ``attrs`` to ``17.4.0``.

View File

@@ -1 +0,0 @@
The builtin module ``platform`` is now available for use in expressions in ``pytest.mark``.

View File

@@ -1 +0,0 @@
Renamed example directories so all tests pass when ran from the base directory.

View File

@@ -1 +0,0 @@
Remove usage of deprecated ``metafunc.addcall`` in our own tests.

View File

@@ -1 +0,0 @@
Internal ``mark.py`` module has been turned into a package.

View File

@@ -1 +0,0 @@
The *short test summary info* section now is displayed after tracebacks and warnings in the terminal.

View File

@@ -1 +0,0 @@
``pytest`` now depends on the `more_itertools <https://github.com/erikrose/more-itertools>`_ package.

View File

@@ -1 +0,0 @@
Added warning when ``[pytest]`` section is used in a ``.cfg`` file passed with ``-c``

View File

@@ -1 +0,0 @@
``nodeids`` can now be passed explicitly to ``FSCollector`` and ``Node`` constructors.

View File

@@ -1 +0,0 @@
Internal refactoring of ``FormattedExcinfo`` to use ``attrs`` facilities and remove old support code for legacy Python versions.

View File

@@ -1 +0,0 @@
New ``--verbosity`` flag to set verbosity level explicitly.

View File

@@ -1 +0,0 @@
Refactoring to unify how verbosity is handled internally.

View File

@@ -1,2 +0,0 @@
Fixed ``clear()`` method on ``caplog`` fixture which cleared ``records``,
but not the ``text`` property.

View File

@@ -1 +0,0 @@
Internal refactoring to better integrate with argparse.

View File

@@ -1 +0,0 @@
Fix a python example when calling a fixture in doc/en/usage.rst

View File

@@ -1 +0,0 @@
``pytest.approx`` now accepts comparing a numpy array with a scalar.

View File

@@ -1,3 +0,0 @@
During test collection, when stdin is not allowed to be read, the
``DontReadFromStdin`` object still allow itself to be iterable and
resolved to an iterator without crashing.

View File

@@ -4,7 +4,7 @@ text that will be added to the next ``CHANGELOG``.
The ``CHANGELOG`` will be read by users, so this description should be aimed to pytest users
instead of describing internal changes which are only relevant to the developers.
Make sure to use full sentences with correct case and punctuation, for example::
Make sure to use full sentences with correct case and punctuation, for example::
Fix issue with non-ascii messages from the ``warnings`` module.
@@ -14,7 +14,8 @@ Each file should be named like ``<ISSUE>.<TYPE>.rst``, where
* ``feature``: new user facing features, like new command-line options and new behavior.
* ``bugfix``: fixes a reported bug.
* ``doc``: documentation improvement, like rewording an entire session or adding missing docs.
* ``removal``: feature deprecation or removal.
* ``deprecation``: feature deprecation.
* ``removal``: feature removal.
* ``vendor``: changes in packages vendored in pytest.
* ``trivial``: fixing a small typo or internal change that might be noteworthy.
@@ -26,7 +27,7 @@ changelog using that instead.
If you are not sure what issue type to use, don't hesitate to ask in your PR.
Note that the ``towncrier`` tool will automatically
reflow your text, so it will work best if you stick to a single paragraph, but multiple sentences and links are OK
and encouraged. You can install ``towncrier`` and then run ``towncrier --draft``
``towncrier`` preserves multiple paragraphs and formatting (code blocks, lists, and so on), but for entries
other than ``features`` it is usually better to stick to a single paragraph to keep it concise. You can install
``towncrier`` and then run ``towncrier --draft``
if you want to get a preview of how your change will look in the final release notes.

View File

@@ -14,7 +14,7 @@
{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category]|dictsort(by='value') %}
{% set issue_joiner = joiner(', ') %}
- {{ text }}{% if category != 'vendor' %} ({% for value in values|sort %}{{ issue_joiner() }}`{{ value }} <https://github.com/pytest-dev/pytest/issues/{{ value[1:] }}>`_{% endfor %}){% endif %}
- {% for value in values|sort %}{{ issue_joiner() }}`{{ value }} <https://github.com/pytest-dev/pytest/issues/{{ value[1:] }}>`_{% endfor %}: {{ text }}
{% endfor %}

View File

@@ -1,9 +1,8 @@
<h3>Useful Links</h3>
<ul>
<li><a href="https://pypi.python.org/pypi/pytest">pytest @ PyPI</a></li>
<li><a href="https://pypi.org/project/pytest/">pytest @ PyPI</a></li>
<li><a href="https://github.com/pytest-dev/pytest/">pytest @ GitHub</a></li>
<li><a href="http://plugincompat.herokuapp.com/">3rd party plugins</a></li>
<li><a href="https://github.com/pytest-dev/pytest/issues">Issue Tracker</a></li>
<li><a href="https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf">PDF Documentation</a>
</ul>

View File

@@ -6,4 +6,4 @@ pygments_style = flask_theme_support.FlaskyStyle
[options]
index_logo = ''
index_logo_height = 120px
touch_icon =
touch_icon =

View File

@@ -1,7 +1,17 @@
# flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
from pygments.token import Comment
from pygments.token import Error
from pygments.token import Generic
from pygments.token import Keyword
from pygments.token import Literal
from pygments.token import Name
from pygments.token import Number
from pygments.token import Operator
from pygments.token import Other
from pygments.token import Punctuation
from pygments.token import String
from pygments.token import Whitespace
class FlaskyStyle(Style):
@@ -10,77 +20,68 @@ class FlaskyStyle(Style):
styles = {
# No corresponding class for the following:
#Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'
Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'
Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'
Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords
Punctuation: "bold #000000", # class: 'p'
# Text: "", # class: ''
Whitespace: "underline #f8f8f8", # class: 'w'
Error: "#a40000 border:#ef2929", # class: 'err'
Other: "#000000", # class 'x'
Comment: "italic #8f5902", # class: 'c'
Comment.Preproc: "noitalic", # class: 'cp'
Keyword: "bold #004461", # class: 'k'
Keyword.Constant: "bold #004461", # class: 'kc'
Keyword.Declaration: "bold #004461", # class: 'kd'
Keyword.Namespace: "bold #004461", # class: 'kn'
Keyword.Pseudo: "bold #004461", # class: 'kp'
Keyword.Reserved: "bold #004461", # class: 'kr'
Keyword.Type: "bold #004461", # class: 'kt'
Operator: "#582800", # class: 'o'
Operator.Word: "bold #004461", # class: 'ow' - like keywords
Punctuation: "bold #000000", # class: 'p'
# because special names such as Name.Class, Name.Function, etc.
# are not recognized as such later in the parsing, we choose them
# to look the same as ordinary variables.
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
Number: "#990000", # class: 'm'
Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'
String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'
Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
Name: "#000000", # class: 'n'
Name.Attribute: "#c4a000", # class: 'na' - to be revised
Name.Builtin: "#004461", # class: 'nb'
Name.Builtin.Pseudo: "#3465a4", # class: 'bp'
Name.Class: "#000000", # class: 'nc' - to be revised
Name.Constant: "#000000", # class: 'no' - to be revised
Name.Decorator: "#888", # class: 'nd' - to be revised
Name.Entity: "#ce5c00", # class: 'ni'
Name.Exception: "bold #cc0000", # class: 'ne'
Name.Function: "#000000", # class: 'nf'
Name.Property: "#000000", # class: 'py'
Name.Label: "#f57900", # class: 'nl'
Name.Namespace: "#000000", # class: 'nn' - to be revised
Name.Other: "#000000", # class: 'nx'
Name.Tag: "bold #004461", # class: 'nt' - like a keyword
Name.Variable: "#000000", # class: 'nv' - to be revised
Name.Variable.Class: "#000000", # class: 'vc' - to be revised
Name.Variable.Global: "#000000", # class: 'vg' - to be revised
Name.Variable.Instance: "#000000", # class: 'vi' - to be revised
Number: "#990000", # class: 'm'
Literal: "#000000", # class: 'l'
Literal.Date: "#000000", # class: 'ld'
String: "#4e9a06", # class: 's'
String.Backtick: "#4e9a06", # class: 'sb'
String.Char: "#4e9a06", # class: 'sc'
String.Doc: "italic #8f5902", # class: 'sd' - like a comment
String.Double: "#4e9a06", # class: 's2'
String.Escape: "#4e9a06", # class: 'se'
String.Heredoc: "#4e9a06", # class: 'sh'
String.Interpol: "#4e9a06", # class: 'si'
String.Other: "#4e9a06", # class: 'sx'
String.Regex: "#4e9a06", # class: 'sr'
String.Single: "#4e9a06", # class: 's1'
String.Symbol: "#4e9a06", # class: 'ss'
Generic: "#000000", # class: 'g'
Generic.Deleted: "#a40000", # class: 'gd'
Generic.Emph: "italic #000000", # class: 'ge'
Generic.Error: "#ef2929", # class: 'gr'
Generic.Heading: "bold #000080", # class: 'gh'
Generic.Inserted: "#00A000", # class: 'gi'
Generic.Output: "#888", # class: 'go'
Generic.Prompt: "#745334", # class: 'gp'
Generic.Strong: "bold #000000", # class: 'gs'
Generic.Subheading: "bold #800080", # class: 'gu'
Generic.Traceback: "bold #a40000", # class: 'gt'
}

View File

@@ -5,7 +5,30 @@ Release announcements
.. toctree::
:maxdepth: 2
release-4.0.2
release-4.0.1
release-4.0.0
release-3.10.1
release-3.10.0
release-3.9.3
release-3.9.2
release-3.9.1
release-3.9.0
release-3.8.2
release-3.8.1
release-3.8.0
release-3.7.4
release-3.7.3
release-3.7.2
release-3.7.1
release-3.7.0
release-3.6.4
release-3.6.3
release-3.6.2
release-3.6.1
release-3.6.0
release-3.5.1
release-3.5.0
release-3.4.2
release-3.4.1

View File

@@ -1,4 +1,4 @@
py.test 2.0.3: bug fixes and speed ups
py.test 2.0.3: bug fixes and speed ups
===========================================================================
Welcome to pytest-2.0.3, a maintenance and bug fix release of pytest,
@@ -37,4 +37,3 @@ Changes between 2.0.2 and 2.0.3
internally)
- fix issue37: avoid invalid characters in junitxml's output

View File

@@ -34,4 +34,3 @@ Changes between 2.1.0 and 2.1.1
- fix issue59: provide system-out/err tags for junitxml output
- fix issue61: assertion rewriting on boolean operations with 3 or more operands
- you can now build a man page with "cd doc ; make man"

View File

@@ -30,4 +30,3 @@ Changes between 2.1.1 and 2.1.2
- fix issue68 / packages now work with assertion rewriting
- fix issue66: use different assertion rewriting caches when the -O option is passed
- don't try assertion rewriting on Jython, use reinterp

View File

@@ -9,7 +9,7 @@ and integration testing. See extensive docs with examples here:
The release contains another fix to the perfected assertions introduced
with the 2.1 series as well as the new possibility to customize reporting
for assertion expressions on a per-directory level.
for assertion expressions on a per-directory level.
If you want to install or upgrade pytest, just type one of::

View File

@@ -27,7 +27,7 @@ Changes between 2.2.0 and 2.2.1
----------------------------------------
- fix issue99 (in pytest and py) internallerrors with resultlog now
produce better output - fixed by normalizing pytest_internalerror
produce better output - fixed by normalizing pytest_internalerror
input arguments.
- fix issue97 / traceback issues (in pytest and py) improve traceback output
in conjunction with jinja2 and cython which hack tracebacks
@@ -35,7 +35,7 @@ Changes between 2.2.0 and 2.2.1
the final test in a test node will now run its teardown directly
instead of waiting for the end of the session. Thanks Dave Hunt for
the good reporting and feedback. The pytest_runtest_protocol as well
as the pytest_runtest_teardown hooks now have "nextitem" available
as the pytest_runtest_teardown hooks now have "nextitem" available
which will be None indicating the end of the test run.
- fix collection crash due to unknown-source collected items, thanks
to Ralf Schmitt (fixed by depending on a more recent pylib)

View File

@@ -4,7 +4,7 @@ pytest-2.2.2: bug fixes
pytest-2.2.2 (updated to 2.2.3 to fix packaging issues) is a minor
backward-compatible release of the versatile py.test testing tool. It
contains bug fixes and a few refinements particularly to reporting with
"--collectonly", see below for betails.
"--collectonly", see below for betails.
For general information see here:
@@ -27,7 +27,7 @@ Changes between 2.2.1 and 2.2.2
- fix issue101: wrong args to unittest.TestCase test function now
produce better output
- fix issue102: report more useful errors and hints for when a
- fix issue102: report more useful errors and hints for when a
test directory was renamed and some pyc/__pycache__ remain
- fix issue106: allow parametrize to be applied multiple times
e.g. from module, class and at function level.
@@ -38,6 +38,6 @@ Changes between 2.2.1 and 2.2.2
- fix issue115: make --collectonly robust against early failure
(missing files/directories)
- "-qq --collectonly" now shows only files and the number of tests in them
- "-q --collectonly" now shows test ids
- "-q --collectonly" now shows test ids
- allow adding of attributes to test reports such that it also works
with distributed testing (no upgrade of pytest-xdist needed)

View File

@@ -36,4 +36,3 @@ Changes between 2.2.3 and 2.2.4
configure/sessionstart where called
- fix issue #144: better mangle test ids to junitxml classnames
- upgrade distribute_setup.py to 0.6.27

View File

@@ -1,7 +1,7 @@
pytest-2.3: improved fixtures / better unittest integration
=============================================================================
pytest-2.3 comes with many major improvements for fixture/funcarg management
pytest-2.3 comes with many major improvements for fixture/funcarg management
and parametrized testing in Python. It is now easier, more efficient and
more predicatable to re-run the same tests with different fixture
instances. Also, you can directly declare the caching "scope" of
@@ -9,7 +9,7 @@ fixtures so that dependent tests throughout your whole test suite can
re-use database or other expensive fixture objects with ease. Lastly,
it's possible for fixture functions (formerly known as funcarg
factories) to use other fixtures, allowing for a completely modular and
re-useable fixture design.
re-useable fixture design.
For detailed info and tutorial-style examples, see:
@@ -27,7 +27,7 @@ All changes are backward compatible and you should be able to continue
to run your test suites and 3rd party plugins that worked with
pytest-2.2.4.
If you are interested in the precise reasoning (including examples) of the
If you are interested in the precise reasoning (including examples) of the
pytest-2.3 fixture evolution, please consult
http://pytest.org/latest/funcarg_compare.html
@@ -43,7 +43,7 @@ and more details for those already in the knowing of pytest can be found
in the CHANGELOG below.
Particular thanks for this release go to Floris Bruynooghe, Alex Okrushko
Carl Meyer, Ronny Pfannschmidt, Benjamin Peterson and Alex Gaynor for helping
Carl Meyer, Ronny Pfannschmidt, Benjamin Peterson and Alex Gaynor for helping
to get the new features right and well integrated. Ronny and Floris
also helped to fix a number of bugs and yet more people helped by
providing bug reports.
@@ -94,7 +94,7 @@ Changes between 2.2.4 and 2.3.0
- pluginmanager.register(...) now raises ValueError if the
plugin has been already registered or the name is taken
- fix issue159: improve http://pytest.org/latest/faq.html
- fix issue159: improve http://pytest.org/latest/faq.html
especially with respect to the "magic" history, also mention
pytest-django, trial and unittest integration.
@@ -125,10 +125,9 @@ Changes between 2.2.4 and 2.3.0
you can use startdir.bestrelpath(yourpath) to show
nice relative path
- allow plugins to implement both pytest_report_header and
- allow plugins to implement both pytest_report_header and
pytest_sessionstart (sessionstart is invoked first).
- don't show deselected reason line if there is none
- py.test -vv will show all of assert comparisons instead of truncating

View File

@@ -3,16 +3,16 @@ pytest-2.3.1: fix regression with factory functions
pytest-2.3.1 is a quick follow-up release:
- fix issue202 - regression with fixture functions/funcarg factories:
using "self" is now safe again and works as in 2.2.4. Thanks
- fix issue202 - regression with fixture functions/funcarg factories:
using "self" is now safe again and works as in 2.2.4. Thanks
to Eduard Schettino for the quick bug report.
- disable pexpect pytest self tests on Freebsd - thanks Koob for the
- disable pexpect pytest self tests on Freebsd - thanks Koob for the
quick reporting
- fix/improve interactive docs with --markers
See
See
http://pytest.org/

View File

@@ -8,9 +8,9 @@ pytest-2.3.2 is another stabilization release:
- fix teardown-ordering for parametrized setups
- fix unittest and trial compat behaviour with respect to runTest() methods
- issue 206 and others: some improvements to packaging
- fix issue127 and others: improve some docs
- fix issue127 and others: improve some docs
See
See
http://pytest.org/
@@ -26,7 +26,7 @@ holger krekel
Changes between 2.3.1 and 2.3.2
-----------------------------------
- fix issue208 and fix issue29 use new py version to avoid long pauses
- fix issue208 and fix issue29 use new py version to avoid long pauses
when printing tracebacks in long modules
- fix issue205 - conftests in subdirs customizing

View File

@@ -6,7 +6,7 @@ which offers uebersimple assertions, scalable fixture mechanisms
and deep customization for testing with Python. Particularly,
this release provides:
- integration fixes and improvements related to flask, numpy, nose,
- integration fixes and improvements related to flask, numpy, nose,
unittest, mock
- makes pytest work on py24 again (yes, people sometimes still need to use it)
@@ -16,7 +16,7 @@ this release provides:
Thanks to Manuel Jacob, Thomas Waldmann, Ronny Pfannschmidt, Pavel Repin
and Andreas Taumoefolau for providing patches and all for the issues.
See
See
http://pytest.org/
@@ -59,4 +59,3 @@ Changes between 2.3.2 and 2.3.3
- fix issue127 - improve documentation for pytest_addoption() and
add a ``config.getoption(name)`` helper function for consistency.

View File

@@ -10,15 +10,15 @@ comes with the following fixes and features:
can write: -k "name1 or name2" etc. This is a slight usage incompatibility
if you used special syntax like "TestClass.test_method" which you now
need to write as -k "TestClass and test_method" to match a certain
method in a certain test class.
method in a certain test class.
- allow to dynamically define markers via
item.keywords[...]=assignment integrating with "-m" option
- yielded test functions will now have autouse-fixtures active but
- yielded test functions will now have autouse-fixtures active but
cannot accept fixtures as funcargs - it's anyway recommended to
rather use the post-2.0 parametrize features instead of yield, see:
http://pytest.org/latest/example/parametrize.html
- fix autouse-issue where autouse-fixtures would not be discovered
if defined in a a/conftest.py file and tests in a/tests/test_some.py
if defined in an a/conftest.py file and tests in a/tests/test_some.py
- fix issue226 - LIFO ordering for fixture teardowns
- fix issue224 - invocations with >256 char arguments now work
- fix issue91 - add/discuss package/directory level setups in example
@@ -26,7 +26,7 @@ comes with the following fixes and features:
Thanks in particular to Thomas Waldmann for spotting and reporting issues.
See
See
http://pytest.org/

View File

@@ -13,8 +13,8 @@ few interesting new plugins saw the light last month:
- pytest-random: randomize test ordering
And several others like pytest-django saw maintenance releases.
For a more complete list, check out
https://pypi.python.org/pypi?%3Aaction=search&term=pytest&submit=search.
For a more complete list, check out
https://pypi.org/search/?q=pytest
For general information see:
@@ -81,7 +81,7 @@ Changes between 2.3.4 and 2.3.5
- fix bug where using capsys with pytest.set_trace() in a test
function would break when looking at capsys.readouterr()
- allow to specify prefixes starting with "_" when
- allow to specify prefixes starting with "_" when
customizing python_functions test discovery. (thanks Graham Horler)
- improve PYTEST_DEBUG tracing output by putting
@@ -94,4 +94,3 @@ Changes between 2.3.4 and 2.3.5
- fix issue134 - print the collect errors that prevent running specified test items
- fix issue266 - accept unicode in MarkEvaluator expressions

View File

@@ -1,9 +1,9 @@
pytest-2.4.0: new fixture features/hooks and bug fixes
===========================================================================
The just released pytest-2.4.0 brings many improvements and numerous
The just released pytest-2.4.0 brings many improvements and numerous
bug fixes while remaining plugin- and test-suite compatible apart
from a few supposedly very minor incompatibilities. See below for
from a few supposedly very minor incompatibilities. See below for
a full list of details. A few feature highlights:
- new yield-style fixtures `pytest.yield_fixture
@@ -13,7 +13,7 @@ a full list of details. A few feature highlights:
- improved pdb support: ``import pdb ; pdb.set_trace()`` now works
without requiring prior disabling of stdout/stderr capturing.
Also the ``--pdb`` options works now on collection and internal errors
and we introduced a new experimental hook for IDEs/plugins to
and we introduced a new experimental hook for IDEs/plugins to
intercept debugging: ``pytest_exception_interact(node, call, report)``.
- shorter monkeypatch variant to allow specifying an import path as
@@ -23,21 +23,21 @@ a full list of details. A few feature highlights:
called if the corresponding setup method succeeded.
- integrate tab-completion on command line options if you
have `argcomplete <http://pypi.python.org/pypi/argcomplete>`_
have `argcomplete <https://pypi.org/project/argcomplete/>`_
configured.
- allow boolean expression directly with skipif/xfail
if a "reason" is also specified.
- a new hook ``pytest_load_initial_conftests`` allows plugins like
`pytest-django <http://pypi.python.org/pypi/pytest-django>`_ to
`pytest-django <https://pypi.org/project/pytest-django/>`_ to
influence the environment before conftest files import ``django``.
- reporting: color the last line red or green depending if
failures/errors occurred or everything passed.
The documentation has been updated to accommodate the changes,
see `http://pytest.org <http://pytest.org>`_
The documentation has been updated to accommodate the changes,
see `http://pytest.org <http://pytest.org>`_
To install or upgrade pytest::
@@ -45,8 +45,8 @@ To install or upgrade pytest::
easy_install -U pytest
**Many thanks to all who helped, including Floris Bruynooghe,
Brianna Laugher, Andreas Pelme, Anthon van der Neut, Anatoly Bubenkoff,
**Many thanks to all who helped, including Floris Bruynooghe,
Brianna Laugher, Andreas Pelme, Anthon van der Neut, Anatoly Bubenkoff,
Vladimir Keleshev, Mathieu Agopian, Ronny Pfannschmidt, Christian
Theunert and many others.**
@@ -101,12 +101,12 @@ new features:
- make "import pdb ; pdb.set_trace()" work natively wrt capturing (no
"-s" needed anymore), making ``pytest.set_trace()`` a mere shortcut.
- fix issue181: --pdb now also works on collect errors (and
on internal errors) . This was implemented by a slight internal
refactoring and the introduction of a new hook
- fix issue181: --pdb now also works on collect errors (and
on internal errors) . This was implemented by a slight internal
refactoring and the introduction of a new hook
``pytest_exception_interact`` hook (see next item).
- fix issue341: introduce new experimental hook for IDEs/terminals to
- fix issue341: introduce new experimental hook for IDEs/terminals to
intercept debugging: ``pytest_exception_interact(node, call, report)``.
- new monkeypatch.setattr() variant to provide a shorter
@@ -124,7 +124,7 @@ new features:
phase of a node.
- simplify pytest.mark.parametrize() signature: allow to pass a
CSV-separated string to specify argnames. For example:
CSV-separated string to specify argnames. For example:
``pytest.mark.parametrize("input,expected", [(1,2), (2,3)])``
works as well as the previous:
``pytest.mark.parametrize(("input", "expected"), ...)``.
@@ -149,10 +149,10 @@ new features:
Bug fixes:
- fix issue358 - capturing options are now parsed more properly
- fix issue358 - capturing options are now parsed more properly
by using a new parser.parse_known_args method.
- pytest now uses argparse instead of optparse (thanks Anthon) which
- pytest now uses argparse instead of optparse (thanks Anthon) which
means that "argparse" is added as a dependency if installing into python2.6
environments or below.
@@ -193,7 +193,7 @@ Bug fixes:
- fix issue323 - sorting of many module-scoped arg parametrizations
- make sessionfinish hooks execute with the same cwd-context as at
session start (helps fix plugin behaviour which write output files
session start (helps fix plugin behaviour which write output files
with relative path such as pytest-cov)
- fix issue316 - properly reference collection hooks in docs
@@ -201,7 +201,7 @@ Bug fixes:
- fix issue 306 - cleanup of -k/-m options to only match markers/test
names/keywords respectively. Thanks Wouter van Ackooy.
- improved doctest counting for doctests in python modules --
- improved doctest counting for doctests in python modules --
files without any doctest items will not show up anymore
and doctest examples are counted as separate test items.
thanks Danilo Bellini.
@@ -211,7 +211,7 @@ Bug fixes:
mode. Thanks Jason R. Coombs.
- fix junitxml generation when test output contains control characters,
addressing issue267, thanks Jaap Broekhuizen
addressing issue267, thanks Jaap Broekhuizen
- fix issue338: honor --tb style for setup/teardown errors as well. Thanks Maho.
@@ -220,6 +220,5 @@ Bug fixes:
- better parametrize error messages, thanks Brianna Laugher
- pytest_terminal_summary(terminalreporter) hooks can now use
".section(title)" and ".line(msg)" methods to print extra
".section(title)" and ".line(msg)" methods to print extra
information at the end of a test run.

View File

@@ -8,7 +8,7 @@ compared to 2.3.5 before they hit more people:
"type" keyword should also be converted to the respective types.
thanks Floris Bruynooghe, @dnozay. (fixes issue360 and issue362)
- fix dotted filename completion when using argcomplete
- fix dotted filename completion when using argcomplete
thanks Anthon van der Neuth. (fixes issue361)
- fix regression when a 1-tuple ("arg",) is used for specifying

View File

@@ -26,9 +26,9 @@ pytest-2.4.2 is another bug-fixing release:
- remove attempt to "dup" stdout at startup as it's icky.
the normal capturing should catch enough possibilities
of tests messing up standard FDs.
of tests messing up standard FDs.
- add pluginmanager.do_configure(config) as a link to
- add pluginmanager.do_configure(config) as a link to
config.do_configure() for plugin-compatibility
as usual, docs at http://pytest.org and upgrades via::

View File

@@ -4,7 +4,7 @@ pytest-2.5.0: now down to ZERO reported bugs!
pytest-2.5.0 is a big fixing release, the result of two community bug
fixing days plus numerous additional works from many people and
reporters. The release should be fully compatible to 2.4.2, existing
plugins and test suites. We aim at maintaining this level of ZERO reported
plugins and test suites. We aim at maintaining this level of ZERO reported
bugs because it's no fun if your testing tool has bugs, is it? Under a
condition, though: when submitting a bug report please provide
clear information about the circumstances and a simple example which
@@ -17,12 +17,12 @@ help.
For those who use older Python versions, please note that pytest is not
automatically tested on python2.5 due to virtualenv, setuptools and tox
not supporting it anymore. Manual verification shows that it mostly
works fine but it's not going to be part of the automated release
works fine but it's not going to be part of the automated release
process and thus likely to break in the future.
As usual, current docs are at
As usual, current docs are at
http://pytest.org
http://pytest.org
and you can upgrade from pypi via::
@@ -40,28 +40,28 @@ holger krekel
2.5.0
-----------------------------------
- dropped python2.5 from automated release testing of pytest itself
which means it's probably going to break soon (but still works
- dropped python2.5 from automated release testing of pytest itself
which means it's probably going to break soon (but still works
with this release we believe).
- simplified and fixed implementation for calling finalizers when
parametrized fixtures or function arguments are involved. finalization
parametrized fixtures or function arguments are involved. finalization
is now performed lazily at setup time instead of in the "teardown phase".
While this might sound odd at first, it helps to ensure that we are
While this might sound odd at first, it helps to ensure that we are
correctly handling setup/teardown even in complex code. User-level code
should not be affected unless it's implementing the pytest_runtest_teardown
hook and expecting certain fixture instances are torn down within (very
unlikely and would have been unreliable anyway).
- PR90: add --color=yes|no|auto option to force terminal coloring
- PR90: add --color=yes|no|auto option to force terminal coloring
mode ("auto" is default). Thanks Marc Abramowitz.
- fix issue319 - correctly show unicode in assertion errors. Many
thanks to Floris Bruynooghe for the complete PR. Also means
we depend on py>=1.4.19 now.
- fix issue396 - correctly sort and finalize class-scoped parametrized
tests independently from number of methods on the class.
- fix issue396 - correctly sort and finalize class-scoped parametrized
tests independently from number of methods on the class.
- refix issue323 in a better way -- parametrization should now never
cause Runtime Recursion errors because the underlying algorithm
@@ -70,18 +70,18 @@ holger krekel
to problems for more than >966 non-function scoped parameters).
- fix issue290 - there is preliminary support now for parametrizing
with repeated same values (sometimes useful to test if calling
with repeated same values (sometimes useful to test if calling
a second time works as with the first time).
- close issue240 - document precisely how pytest module importing
works, discuss the two common test directory layouts, and how it
works, discuss the two common test directory layouts, and how it
interacts with PEP420-namespace packages.
- fix issue246 fix finalizer order to be LIFO on independent fixtures
depending on a parametrized higher-than-function scoped fixture.
depending on a parametrized higher-than-function scoped fixture.
(was quite some effort so please bear with the complexity of this sentence :)
Thanks Ralph Schmitt for the precise failure example.
- fix issue244 by implementing special index for parameters to only use
indices for paramentrized test ids
@@ -99,9 +99,9 @@ holger krekel
filtering with simple strings that are not valid python expressions.
Examples: "-k 1.3" matches all tests parametrized with 1.3.
"-k None" filters all tests that have "None" in their name
and conversely "-k 'not None'".
and conversely "-k 'not None'".
Previously these examples would raise syntax errors.
- fix issue384 by removing the trial support code
since the unittest compat enhancements allow
trial to handle it on its own
@@ -109,7 +109,7 @@ holger krekel
- don't hide an ImportError when importing a plugin produces one.
fixes issue375.
- fix issue275 - allow usefixtures and autouse fixtures
- fix issue275 - allow usefixtures and autouse fixtures
for running doctest text files.
- fix issue380 by making --resultlog only rely on longrepr instead
@@ -135,20 +135,20 @@ holger krekel
(it already did neutralize pytest.mark.xfail markers)
- refine pytest / pkg_resources interactions: The AssertionRewritingHook
PEP302 compliant loader now registers itself with setuptools/pkg_resources
PEP302 compliant loader now registers itself with setuptools/pkg_resources
properly so that the pkg_resources.resource_stream method works properly.
Fixes issue366. Thanks for the investigations and full PR to Jason R. Coombs.
- pytestconfig fixture is now session-scoped as it is the same object during the
whole test run. Fixes issue370.
whole test run. Fixes issue370.
- avoid one surprising case of marker malfunction/confusion::
@pytest.mark.some(lambda arg: ...)
def test_function():
would not work correctly because pytest assumes @pytest.mark.some
gets a function to be decorated already. We now at least detect if this
would not work correctly because pytest assumes @pytest.mark.some
gets a function to be decorated already. We now at least detect if this
arg is a lambda and thus the example will work. Thanks Alex Gaynor
for bringing it up.
@@ -159,11 +159,11 @@ holger krekel
although it's not needed by pytest itself atm. Also
fix caching. Fixes issue376.
- fix issue221 - handle importing of namespace-package with no
- fix issue221 - handle importing of namespace-package with no
__init__.py properly.
- refactor internal FixtureRequest handling to avoid monkeypatching.
One of the positive user-facing effects is that the "request" object
One of the positive user-facing effects is that the "request" object
can now be used in closures.
- fixed version comparison in pytest.importskip(modname, minverstring)
@@ -172,4 +172,3 @@ holger krekel
does not duplicate the unittest-API into the "plain" namespace.
- fix verbose reporting for @mock'd test functions

View File

@@ -1,8 +1,8 @@
pytest-2.5.1: fixes and new home page styling
===========================================================================
pytest is a mature Python testing tool with more than a 1000 tests
against itself, passing on many different interpreters and platforms.
pytest is a mature Python testing tool with more than a 1000 tests
against itself, passing on many different interpreters and platforms.
The 2.5.1 release maintains the "zero-reported-bugs" promise by fixing
the three bugs reported since the last release a few days ago. It also
@@ -11,12 +11,12 @@ the flask theme from Armin Ronacher:
http://pytest.org
If you have anything more to improve styling and docs,
If you have anything more to improve styling and docs,
we'd be very happy to merge further pull requests.
On the coding side, the release also contains a little enhancement to
fixture decorators allowing to directly influence generation of test
ids, thanks to Floris Bruynooghe. Other thanks for helping with
ids, thanks to Floris Bruynooghe. Other thanks for helping with
this release go to Anatoly Bubenkoff and Ronny Pfannschmidt.
As usual, you can upgrade from pypi via::
@@ -37,11 +37,10 @@ holger krekel
- Allow parameterized fixtures to specify the ID of the parameters by
adding an ids argument to pytest.fixture() and pytest.yield_fixture().
Thanks Floris Bruynooghe.
Thanks Floris Bruynooghe.
- fix issue404 by always using the binary xml escape in the junitxml
plugin. Thanks Ronny Pfannschmidt.
- fix issue407: fix addoption docstring to point to argparse instead of
optparse. Thanks Daniel D. Wright.

View File

@@ -1,8 +1,8 @@
pytest-2.5.2: fixes
pytest-2.5.2: fixes
===========================================================================
pytest is a mature Python testing tool with more than a 1000 tests
against itself, passing on many different interpreters and platforms.
pytest is a mature Python testing tool with more than a 1000 tests
against itself, passing on many different interpreters and platforms.
The 2.5.2 release fixes a few bugs with two maybe-bugs remaining and
actively being worked on (and waiting for the bug reporter's input).
@@ -19,18 +19,18 @@ As usual, you can upgrade from pypi via::
Thanks to the following people who contributed to this release:
Anatoly Bubenkov
Anatoly Bubenkov
Ronny Pfannschmidt
Floris Bruynooghe
Bruno Oliveira
Andreas Pelme
Bruno Oliveira
Andreas Pelme
Jurko Gospodnetić
Piotr Banaszkiewicz
Simon Liedtke
lakka
Lukasz Balcerzak
Philippe Muller
Daniel Hahler
Piotr Banaszkiewicz
Simon Liedtke
lakka
Lukasz Balcerzak
Philippe Muller
Daniel Hahler
have fun,
holger krekel
@@ -39,11 +39,11 @@ holger krekel
-----------------------------------
- fix issue409 -- better interoperate with cx_freeze by not
trying to import from collections.abc which causes problems
trying to import from collections.abc which causes problems
for py27/cx_freeze. Thanks Wolfgang L. for reporting and tracking it down.
- fixed docs and code to use "pytest" instead of "py.test" almost everywhere.
Thanks Jurko Gospodnetic for the complete PR.
Thanks Jurko Gospodnetic for the complete PR.
- fix issue425: mention at end of "py.test -h" that --markers
and --fixtures work according to specified test path (or current dir)
@@ -54,11 +54,10 @@ holger krekel
- copy, cleanup and integrate py.io capture
from pylib 1.4.20.dev2 (rev 13d9af95547e)
- address issue416: clarify docs as to conftest.py loading semantics
- fix issue429: comparing byte strings with non-ascii chars in assert
expressions now work better. Thanks Floris Bruynooghe.
- make capfd/capsys.capture private, its unused and shouldn't be exposed

View File

@@ -52,8 +52,7 @@ Changes 2.6.1
"::" node id specifications (copy pasted from "-v" output)
- fix issue544 by only removing "@NUM" at the end of "::" separated parts
and if the part has an ".py" extension
and if the part has a ".py" extension
- don't use py.std import helper, rather import things directly.
Thanks Bruno Oliveira.

View File

@@ -49,4 +49,3 @@ holger krekel
- Do not mark as universal wheel because Python 2.6 is different from
other builds due to the extra argparse dependency. Fixes issue566.
Thanks sontek.

View File

@@ -49,4 +49,3 @@ Changes 2.6.3
- check xfail/skip also with non-python function test items. Thanks
Floris Bruynooghe.

View File

@@ -98,4 +98,3 @@ holger krekel
- On failure, the ``sys.last_value``, ``sys.last_type`` and
``sys.last_traceback`` are set, so that a user can inspect the error
via postmortem debugging (almarklein).

View File

@@ -55,4 +55,3 @@ The py.test Development Team
- fix issue756, fix issue752 (and similar issues): depend on py-1.4.29
which has a refined algorithm for traceback generation.

View File

@@ -53,7 +53,6 @@ The py.test Development Team
Thanks Gabriel Reis for the PR.
- add more talks to the documentation
- extend documentation on the --ignore cli option
- use pytest-runner for setuptools integration
- extend documentation on the --ignore cli option
- use pytest-runner for setuptools integration
- minor fixes for interaction with OS X El Capitan system integrity protection (thanks Florian)

View File

@@ -28,4 +28,4 @@ The py.test Development Team
2.8.7 (compared to 2.8.6)
-------------------------
- fix #1338: use predictable object resolution for monkeypatch
- fix #1338: use predictable object resolution for monkeypatch

View File

@@ -14,25 +14,25 @@ As usual, you can upgrade from pypi via::
Thanks to all who contributed to this release, among them:
Anatoly Bubenkov
Bruno Oliveira
Buck Golemon
David Vierra
Florian Bruhin
Galaczi Endre
Georgy Dyuldin
Lukas Bednar
Luke Murphy
Marcin Biernat
Matt Williams
Michael Aquilina
Raphael Pierzina
Ronny Pfannschmidt
Ryan Wooden
Tiemo Kieft
TomV
holger krekel
jab
Anatoly Bubenkov
Bruno Oliveira
Buck Golemon
David Vierra
Florian Bruhin
Galaczi Endre
Georgy Dyuldin
Lukas Bednar
Luke Murphy
Marcin Biernat
Matt Williams
Michael Aquilina
Raphael Pierzina
Ronny Pfannschmidt
Ryan Wooden
Tiemo Kieft
TomV
holger krekel
jab
Happy testing,
@@ -76,18 +76,18 @@ The py.test Development Team
**Changes**
* **Important**: `py.code <https://pylib.readthedocs.io/en/latest/code.html>`_ has been
merged into the ``pytest`` repository as ``pytest._code``. This decision
was made because ``py.code`` had very few uses outside ``pytest`` and the
fact that it was in a different repository made it difficult to fix bugs on
merged into the ``pytest`` repository as ``pytest._code``. This decision
was made because ``py.code`` had very few uses outside ``pytest`` and the
fact that it was in a different repository made it difficult to fix bugs on
its code in a timely manner. The team hopes with this to be able to better
refactor out and improve that code.
This change shouldn't affect users, but it is useful to let users aware
if they encounter any strange behavior.
Keep in mind that the code for ``pytest._code`` is **private** and
Keep in mind that the code for ``pytest._code`` is **private** and
**experimental**, so you definitely should not import it explicitly!
Please note that the original ``py.code`` is still available in
Please note that the original ``py.code`` is still available in
`pylib <https://pylib.readthedocs.io>`_.
* ``pytest_enter_pdb`` now optionally receives the pytest config object.
@@ -124,13 +124,13 @@ The py.test Development Team
Thanks `@biern`_ for the PR.
* Fix `traceback style docs`_ to describe all of the available options
(auto/long/short/line/native/no), with `auto` being the default since v2.6.
(auto/long/short/line/native/no), with ``auto`` being the default since v2.6.
Thanks `@hackebrot`_ for the PR.
* Fix (`#1422`_): junit record_xml_property doesn't allow multiple records
with same name.
.. _`traceback style docs`: https://pytest.org/latest/usage.html#modifying-python-traceback-printing
.. _#1422: https://github.com/pytest-dev/pytest/issues/1422
@@ -156,4 +156,4 @@ The py.test Development Team
.. _@tomviner: https://github.com/tomviner
.. _@RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
.. _@rabbbit: https://github.com/rabbbit
.. _@hackebrot: https://github.com/hackebrot
.. _@hackebrot: https://github.com/hackebrot

View File

@@ -14,17 +14,17 @@ As usual, you can upgrade from pypi via::
Thanks to all who contributed to this release, among them:
Bruno Oliveira
Daniel Hahler
Dmitry Malinovsky
Florian Bruhin
Floris Bruynooghe
Matt Bachmann
Ronny Pfannschmidt
TomV
Vladimir Bolshakov
Zearin
palaviv
Bruno Oliveira
Daniel Hahler
Dmitry Malinovsky
Florian Bruhin
Floris Bruynooghe
Matt Bachmann
Ronny Pfannschmidt
TomV
Vladimir Bolshakov
Zearin
palaviv
Happy testing,

View File

@@ -8,10 +8,10 @@ against itself, passing on many different interpreters and platforms.
This release contains a lot of bugs fixes and improvements, and much of
the work done on it was possible because of the 2016 Sprint[1], which
was funded by an indiegogo campaign which raised over US$12,000 with
nearly 100 backers.
was funded by an indiegogo campaign which raised over US$12,000 with
nearly 100 backers.
There's a "What's new in pytest 3.0" [2] blog post highlighting the
There's a "What's new in pytest 3.0" [2] blog post highlighting the
major features in this release.
To see the complete changelog and documentation, please visit:

View File

@@ -7,7 +7,7 @@ This release fixes some regressions reported in version 3.0.0, being a
drop-in replacement. To upgrade:
pip install --upgrade pytest
The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:

View File

@@ -7,7 +7,7 @@ This release fixes some regressions and bugs reported in version 3.0.1, being a
drop-in replacement. To upgrade::
pip install --upgrade pytest
The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:

View File

@@ -3,11 +3,11 @@ pytest-3.0.3
pytest 3.0.3 has just been released to PyPI.
This release fixes some regressions and bugs reported in the last version,
This release fixes some regressions and bugs reported in the last version,
being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:

View File

@@ -3,11 +3,11 @@ pytest-3.0.4
pytest 3.0.4 has just been released to PyPI.
This release fixes some regressions and bugs reported in the last version,
This release fixes some regressions and bugs reported in the last version,
being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:

View File

@@ -6,7 +6,7 @@ pytest 3.0.5 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:

View File

@@ -6,7 +6,7 @@ pytest 3.0.6 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at http://doc.pytest.org/en/latest/changelog.html.

View File

@@ -6,7 +6,7 @@ pytest 3.0.7 has just been released to PyPI.
This is a bug-fix release, being a drop-in replacement. To upgrade::
pip install --upgrade pytest
The full changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:

Some files were not shown because too many files have changed in this diff Show More