Daniel Hahler
fd64fa1863
Revisit test_importplugin_error_message
...
Should be more helpful in case of errors than before:
> assert re.match(expected_message, str(excinfo.value))
E _pytest.warning_types.PytestWarning: asserting the value None, please use "assert is None"
https://travis-ci.org/pytest-dev/pytest/jobs/509970576#L208
2019-03-22 17:02:26 +01:00
Daniel Hahler
05d55b86df
tests: minor sys.path cleanup
2019-03-22 16:20:55 +01:00
Daniel Hahler
475119988c
monkeypatch.syspath_prepend: call fixup_namespace_packages
...
Without the patch the test fails as follows:
# Prepending should call fixup_namespace_packages.
monkeypatch.syspath_prepend("world")
> import ns_pkg.world
E ModuleNotFoundError: No module named 'ns_pkg.world'
2019-03-22 15:29:08 +01:00
Daniel Hahler
7a6bcc3639
Add reference to test_cmdline_python_namespace_package
2019-03-22 13:23:44 +01:00
Daniel Hahler
ade773390a
minor: rename inner test
2019-03-22 13:23:44 +01:00
Daniel Hahler
2e7d6a6202
Fix test_assertrewrite in verbose mode
...
Fixes https://github.com/pytest-dev/pytest/issues/4879 .
2019-03-22 13:00:35 +01:00
Daniel Hahler
15d608867d
Merge pull request #4966 from blueyed/fix-preparse
...
config: fix consider_preparse with missing argument to -p
2019-03-21 19:12:57 +01:00
Daniel Hahler
ea2c6b8a88
config: fix consider_preparse with missing argument to -p
...
This is only required after/with 415899d4
- otherwise argparse ensures
there is an argument already.
2019-03-21 17:05:22 +01:00
Daniel Hahler
553951c443
Fix some issues related to "-p no:X" with default_plugins
2019-03-21 17:01:50 +01:00
Daniel Hahler
cc6e5ec345
tests: add test_report_collect_after_half_a_second
...
This is meant for stable coverage with "collecting X item(s)".
2019-03-20 22:13:11 +01:00
Daniel Hahler
7939e5327c
Merge pull request #4957 from blueyed/config-handle-pno-with-default-plugins
...
config: handle `-p no:plugin` with default plugins
2019-03-20 03:32:03 +01:00
Daniel Hahler
c7c120fba6
terminal: handle "capture" option not being available
...
This is the case with `-p no:capture` now.
2019-03-20 03:01:26 +01:00
Daniel Hahler
415899d428
config: handle `-p no:plugin` with default plugins
...
`-p no:capture` should not load its fixtures in the first place.
2019-03-20 02:47:13 +01:00
Daniel Hahler
8dda5613ef
Merge pull request #4956 from blueyed/home2
...
pytester: set HOME only with inline_run/popen
2019-03-20 02:29:29 +01:00
Daniel Hahler
714f2113bb
Merge pull request #4929 from blueyed/fix-_factorytraceback-offset
...
Fix line offsets with `ScopeMismatch` errors
2019-03-20 01:30:58 +01:00
Daniel Hahler
a50b92ea67
pytester: set HOME only with inline_run/popen
...
Ref: https://github.com/pytest-dev/pytest/issues/4955
2019-03-20 01:15:51 +01:00
Daniel Hahler
da81c1e49a
Merge pull request #4950 from blueyed/capture
...
Revisit capturing module: repr, doc fixes, minor
2019-03-20 01:12:22 +01:00
Bruno Oliveira
23ab43233e
Merge pull request #4920 from nicoddemus/subtests-pytest-1367
...
Internal refactorings required for *external* pytest-subtests plugin
2019-03-19 18:57:11 -03:00
Bruno Oliveira
1a119a22d1
Internal refactorings in order to support the new pytest-subtests plugin
...
Related to #1367
2019-03-19 18:20:41 -03:00
Daniel Hahler
920bffbfbb
Revisit _pytest.capture: repr, doc fixes, minor
2019-03-19 01:17:21 +01:00
Daniel Hahler
751c061d9a
Merge master into features
2019-03-19 01:07:10 +01:00
Daniel Hahler
a624b84097
Merge pull request #4941 from blueyed/testdir-home
...
pytester: testdir: set $HOME to tmpdir
2019-03-18 23:02:15 +01:00
Daniel Hahler
c75dd10671
pytester: testdir: set $HOME to tmpdir
...
This avoids loading user configuration, which might interfere with test
results, e.g. a `~/.pdbrc.py` with pdb++.
Also sets USERPROFILE, which will be required with Python 3.8 [1].
1: https://bugs.python.org/issue36264
2019-03-18 20:55:39 +01:00
Daniel Hahler
98981276a0
capture: fix FDCapture.__repr__ without targetfd_save
2019-03-18 02:33:03 +01:00
Daniel Hahler
15fe8c6e90
Handle `-p plug` after `-p no:plug`.
...
This can be used to override a blocked plugin (e.g. in "addopts") from the
command line etc.
2019-03-16 15:58:00 +01:00
Daniel Hahler
5e27ea5528
pytester: LineMatcher: assert Sequence when matching in order
...
This can be helpful when passing a set accidentally.
2019-03-15 23:07:08 +01:00
Bruno Oliveira
33d4c96aa2
Merge pull request #4830 from nicoddemus/warn-on-coroutine
...
Emit a warning when a coroutine test function is encountered
2019-03-15 09:51:34 -03:00
Takafumi Arakaki
fa3cca51e1
Test pytest.skip in doctest
2019-03-15 11:06:57 +09:00
Daniel Hahler
d441fa66fe
Fix line offsets with `ScopeMismatch` errors
...
Fixes https://github.com/pytest-dev/pytest/issues/4928 .
2019-03-15 02:47:33 +01:00
Daniel Hahler
7afe17740f
Merge master into features
2019-03-15 00:52:12 +01:00
Bruno Oliveira
40072b9511
Emit a warning when a async def function is not handled by a plugin
...
Fix #2224
2019-03-14 20:22:23 -03:00
Daniel Hahler
bdac9d3dd0
tests: improve test_pdb_interaction_doctest
...
- ignore pdbrc (might be done in general, but this was the only affected
test)
- fail faster in case of unexpected failure
2019-03-14 19:16:34 +01:00
Daniel Hahler
37158f5303
tests: fix test_pdb_interaction_continue_recursive with pdbpp
2019-03-14 19:16:34 +01:00
Bruno Oliveira
bd70f5c148
Add test for mtime issue in #4903
2019-03-14 10:16:08 -03:00
Miro Hrončok
d32ab6029f
Fix pytest tests invocation with custom PYTHONPATH
...
Fixes https://github.com/pytest-dev/pytest/issues/4913
Co-authored-by: Bruno Oliveira <nicoddemus@gmail.com>
2019-03-12 17:31:42 +01:00
Daniel Hahler
76687030f0
Merge branch 'master' into merge-master-into-features
...
Conflicts:
appveyor.yml
setup.py
2019-03-05 19:07:36 +01:00
Daniel Hahler
8481e438bd
ci: revisit coverage reporting
...
This brings coverage back that got missing with 9dcd6f2
.
Continuation of #4839 / #4846 .
2019-03-05 13:34:46 +01:00
Daniel Hahler
83558a0ba3
tests: make test_crash_on_closing_tmpfile_py27 more reliable
...
It fails reliable for me now without the fix from 9517c3a2a
.
Ref: #2370
2019-03-04 15:04:55 +01:00
Bruno Oliveira
23ea04f910
Merge pull request #4860 from nicoddemus/getfixturevalue-cleanup-1895
...
getfixturevalue does not correctly declare dependency with the calling fixture
2019-03-03 15:56:45 -03:00
Daniel Hahler
c334adc78f
Apply suggestions from code review
...
Co-Authored-By: nicoddemus <nicoddemus@gmail.com>
2019-03-03 11:20:00 -03:00
Bruno Oliveira
0deb7b1696
Do not show "inifile:" string if there's no configuration file
2019-03-02 11:45:08 -03:00
Bruno Oliveira
53b8aa065c
Show testpaths option in the header if it has been used for collection
...
Fix #4875
2019-03-02 11:35:32 -03:00
Bruno Oliveira
6a2d122a50
Remove code debugging leftovers
2019-03-02 09:56:15 -03:00
Bruno Oliveira
d97473e551
Add test and CHANGELOG for #1895
2019-03-02 09:39:30 -03:00
Bruno Oliveira
525639eaa0
Rename fixtures testing file to be consistent with the module name
2019-03-02 09:37:30 -03:00
Bruno Oliveira
7dceabfcb2
Ensure fixtures obtained with getfixturevalue() are finalized in the correct order
...
Fix #1895
2019-03-02 09:36:16 -03:00
Daniel Hahler
4290cacb86
Merge pull request #4864 from blueyed/isort-cfg
...
Add config for isort
2019-03-01 18:44:56 +01:00
Daniel Hahler
f7a3e001f7
pdb: allow for --pdbclass=mod:attr.class
2019-03-01 15:20:04 +01:00
Daniel Hahler
0d31e852b1
Run isort
2019-03-01 14:24:18 +01:00
Daniel Hahler
a51dc0c7ce
Validate type with writing to captured output like without
...
Fixes https://github.com/pytest-dev/pytest/issues/4861 .
2019-03-01 14:03:51 +01:00
Daniel Hahler
a868a9ac13
pdb: validate --pdbcls option
2019-02-28 18:11:58 +01:00
Daniel Hahler
ccab469a0c
Fix test_argcomplete: use python -m pytest
...
Previously it was not run with a) xdist ("-c"), and b) "python -m
pytest" ("…/pytest.py", not executable).
2019-02-27 16:52:46 +01:00
Bruno Oliveira
a0207274f4
-p option now can be used to early-load plugins by entry-point name
...
Fixes #4718
2019-02-24 13:20:17 -03:00
Bruno Oliveira
a68f4fd2b9
Fix test failures after pluggy 1.8 release
...
pluggy now calls iter_entry_points with different arguments, and tests
which mocked that call need to be updated accordingly.
2019-02-22 18:58:54 -03:00
Bruno Oliveira
5b35241470
Merge pull request #4812 from mitzkia/logging_from_runtest_logreport
...
Logging: Make pytest_runtest_logreport() hook available for logging
2019-02-22 18:47:06 -03:00
Andras Mitzki
b26b731498
Logging: Make pytest_runtest_logreport() available for logging
...
Signed-off-by: Andras Mitzki <andras.mitzki@balabit.com>
2019-02-22 05:14:44 +01:00
Bruno Oliveira
9cb504ca9a
Add same environments to Azure as have in AppVeyor, except py37-freeze
...
py37-freeze will be tackled in https://github.com/pytest-dev/pytest/issues/4807
2019-02-18 17:23:39 -03:00
Bruno Oliveira
f0a9f9042f
Merge pull request #4805 from nicoddemus/release-4.3.0
...
Release 4.3.0
2019-02-18 17:18:50 -03:00
Anthony Sottile
5505826db9
Fix python3.8 / pypy failures
2019-02-16 11:23:23 -08:00
Bruno Oliveira
0395996756
Merge remote-tracking branch 'upstream/master' into release-4.3.0
2019-02-16 14:06:51 +00:00
Bruno Oliveira
986dd84375
LoggingPlugin: Support to customize log_file from hook ( #4752 )
...
LoggingPlugin: Support to customize log_file from hook
2019-02-16 12:01:21 -02:00
Daniel Hahler
6fb7269979
terminal: write_fspath_result: work around py bug
2019-02-15 17:47:00 +01:00
Andras Mitzki
e3824d23bc
LoggingPlugin: Expose setting log_file_handler
...
- This patch allows to set log_file (path) from hook
Signed-off-by: Thomas Hisch
Signed-off-by: Andras Mitzki <andras.mitzki@balabit.com>
2019-02-15 16:05:10 +01:00
Daniel Hahler
407d4a0cf0
collect: python: fix `AssertionError` with broken symlinks
...
Fixes https://github.com/pytest-dev/pytest/issues/4782 .
2019-02-14 00:18:14 +01:00
Daniel Hahler
7b91952645
Merge master into features
...
Conflicts:
tox.ini
2019-02-13 17:58:16 +01:00
Anthony Sottile
f672b7e39e
Merge pull request #4773 from nicoddemus/remove-py27-py34-deprecation-warning
...
Remove py27 py34 deprecation warning
2019-02-12 21:42:07 -05:00
Bruno Oliveira
e20e376881
Merge pull request #4347 from blueyed/pdb-recursive-capture
...
pdbpp: fix capturing with recursive debugging
2019-02-12 16:53:14 -02:00
Bruno Oliveira
b41632e9a8
Revert "Show deprecation message when running under Python 2.7 and 3.4"
...
This reverts commit eb92e57509
.
2019-02-12 10:39:25 -02:00
Daniel Hahler
f13935da53
Display --help/--version with ArgumentErrors
2019-02-11 15:49:48 +01:00
Daniel Hahler
61b9246afe
Fix/improve handling of pkg init and test file via args
...
Ref: https://github.com/pytest-dev/pytest/issues/4344#issuecomment-441095934
2019-02-11 15:04:24 +01:00
Daniel Hahler
9feb4941f4
pdb: fix capturing with recursive debugging and pdb++
...
While I think that pdb++ should be fixed in this regard (by using
`pdb.Pdb`, and not `self.__class__` maybe), this ensures that custom
debuggers like this are working.
2019-02-11 14:52:20 +01:00
Daniel Hahler
ed01dc6567
Merge pull request #4652 from blueyed/RunResult-repr
...
Add __repr__ for RunResult
2019-02-09 01:26:24 +01:00
Daniel Hahler
fc8800c71f
Merge pull request #4722 from fetzerch/ignore_wildcards
...
Add ability to use globs when using --ignore
2019-02-09 00:11:04 +01:00
Daniel Hahler
9bcbf552d6
Add __repr__ for RunResult
2019-02-08 23:41:20 +01:00
Bruno Oliveira
32c6d4f603
Merge pull request #4738 from pstradomski/master
...
Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.
2019-02-08 19:57:14 -02:00
Daniel Hahler
9c03196e79
Merge master into features
2019-02-08 22:02:29 +01:00
Daniel Hahler
64e8185ff7
Merge master into features
2019-02-08 20:09:09 +01:00
Daniel Hahler
913a2da6e5
Fix handling of collect_ignore from parent conftest
...
`_collectfile` should be called on files only.
Fixes https://github.com/pytest-dev/pytest/issues/4592 .
2019-02-08 18:46:43 +01:00
Anthony Sottile
4c7ddb8d9b
Fix `parametrize(... ids=<function>)` when the function returns non-strings.
2019-02-07 12:25:59 -08:00
Paweł Stradomski
59e6fb94b5
Fix "ValueError: Plugin already registered" exceptions when running in build directories that symlink to actual source.
2019-02-07 02:05:22 +01:00
Zac Hatfield-Dodds
3384ffc6eb
Merge pull request #4725 from nicoddemus/collection-finish
...
Call pytest_report_collectionfinish hook when --collect-only is passed
2019-02-06 12:38:12 -10:00
Bruno Oliveira
e276bd3332
pytest.warns emits a warning on unknown keyword arguments
2019-02-06 19:52:13 -02:00
Christian Fetzer
2dc2a19db5
Add ability to exclude files matching glob patterns in conftest.py
...
This adds the `collect_ignore_glob` option for `conftest.py` to allow
Unix-style wildcards for excluding files.
2019-02-06 16:49:43 +01:00
Bruno Oliveira
54af0f4c65
Call pytest_report_collectionfinish hook when --collect-only is passed
...
Fix #2895
2019-02-06 12:58:23 -02:00
Christian Fetzer
fc5d4654e5
Add ability to exclude files matching glob patterns with --ignore-glob
...
This adds the `--ignore-glob` option to allow Unix-style wildcards so
that `--ignore-glob=integration*` excludes all tests that reside in
files starting with `integration`.
Fixes : #3711
2019-02-06 11:29:30 +01:00
Bruno Oliveira
19c93d16d1
Do not raise UsageError when "pytest_plugins" is a module
...
Fix #3899
2019-02-06 08:24:22 -02:00
Anthony Sottile
315374008b
Remove workaround for docstrings for py38+
2019-02-05 12:48:18 -08:00
Anthony Sottile
2264db7f4a
Merge pull request #4682 from arel/parameterize-conditional-raises-document-only
...
Document parametrizing conditional raises
2019-02-02 13:15:26 -08:00
Bruno Oliveira
c3d7340542
Fix setUpClass being called in subclasses that were skipped
...
Fix #4700
2019-01-31 20:24:11 -02:00
Bruno Oliveira
02962fabda
Merge remote-tracking branch 'upstream/features' into merge-master-into-features
2019-01-30 09:37:46 -02:00
Bruno Oliveira
1dc16ad77b
Merge pull request #4690 from nicoddemus/deprecated-python-summary
...
Show deprecation message when running under Python 2.7 and 3.4
2019-01-30 09:07:59 -02:00
Bruno Oliveira
ade5f2c8c5
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
2019-01-29 19:36:56 -02:00
Bruno Oliveira
3e0e819158
Merge pull request #4280 from blueyed/trace-quit
...
pdb: improve quitting from debugger
2019-01-29 19:14:20 -02:00
Bruno Oliveira
eb92e57509
Show deprecation message when running under Python 2.7 and 3.4
...
Fix #4627
2019-01-29 19:02:41 -02:00
Bruno Oliveira
1c5009c3fb
Handle unittest.SkipTest exception with non-ascii characters
...
Fix #4669
2019-01-28 12:50:04 -02:00
Arel Cordero
fd4289dae0
Adding `does_not_raise` to documentation only
2019-01-27 16:42:10 +00:00
Arel Cordero
977adf1354
Improving sphinx docs based on feedback
2019-01-27 16:41:23 +00:00
Arel Cordero
afe9fd5ffd
Adds `does_not_raise` context manager
...
Addressing issues #4324 and #1830
2019-01-27 16:40:35 +00:00
Ronny Pfannschmidt
5567c772cd
quick&dirty fix fixture tests that rely on tmppath fixture structure
2019-01-27 14:19:23 +01:00
Ronny Pfannschmidt
f7d7555521
fix #4680 - ensure tmpdir and tmp_path are the same
2019-01-27 13:05:34 +01:00