Bruno Oliveira
b11640c1eb
Fix linting E722: do not use bare except
2017-11-04 13:59:10 -02:00
Bruno Oliveira
03829fde8a
Fix linting E741: ambiguous variable name
2017-11-04 13:59:10 -02:00
Ronny Pfannschmidt
b18a9deb4c
Merge pull request #2892 from nicoddemus/merge-master-into-features
...
Merge upstream/master into features
2017-11-04 08:15:28 +01:00
Bruno Oliveira
d7e8eeef56
Merge pull request #2878 from RonnyPfannschmidt/collector-makeitem-deprecate
...
deprecate the public internal PyCollector.makeitem method
2017-11-03 17:13:18 -02:00
Bruno Oliveira
f3a119c06a
Merge upstream/master into features
2017-11-03 16:37:18 -02:00
Ronny Pfannschmidt
d1aa553f73
add mocked integrationtest for the deprecationwarning of makeitem
2017-10-30 19:49:14 +01:00
Ronny Pfannschmidt
cd747c48a4
Merge pull request #2874 from nicoddemus/fix-py27-xdist-envs-2843
...
Change directory for py27 xdist-related envs
2017-10-30 17:09:34 +01:00
Thomas Hisch
2f993af54a
Fix context output handling for doctests
...
Show full context of doctest source in the pytest output, if the lineno of
failed example in the docstring is < 9.
2017-10-29 20:06:10 +00:00
Samuel Dion-Girardeau
b27dde24d6
Use a nametuple for `readouterr()` results
...
This allows accessing `out` and `err` directly by attribute,
while preserving tuple unpacking.
Also added tests, one for the `capsys` fixture, and one for the
`MultiCapture` class itself.
2017-10-28 14:53:19 -04:00
Bruno Oliveira
27cea340f3
Remove trailing whitespace
2017-10-26 21:55:28 -02:00
Bruno Oliveira
27bb2eceb4
Add comment about why we remove docstrings on test_assertrewrite
...
As explained in pytest-dev/pytest#2870
2017-10-26 20:15:05 -02:00
Sviatoslav Abakumov
fd7bfa30d0
Put imports on the last line unless there are other exprs
2017-10-25 11:05:07 +03:00
Sviatoslav Abakumov
3427d27d5a
Try to get docstring from module node
2017-10-25 10:54:43 +03:00
Ronny Pfannschmidt
def471b975
Merge pull request #2869 from nicoddemus/merge-master-into-features
...
Merge master into features
2017-10-25 09:08:08 +02:00
Ronny Pfannschmidt
f743e95cfc
Merge pull request #2791 from OfirOshir/features
...
bugfix for issue #2491
2017-10-25 09:04:01 +02:00
Bruno Oliveira
6b86b0dbfe
Fix additional linting issues
2017-10-24 21:01:00 -02:00
Bruno Oliveira
bdab29fa3d
Merge pull request #2867 from Perlence/ini-markers-whitespace
...
Strip whitespace from markers in INI config
2017-10-24 20:11:20 -02:00
Bruno Oliveira
6821d36ca5
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
2017-10-24 19:57:14 -02:00
Sviatoslav Abakumov
52aadcd7c1
Strip whitespace from markers in INI config
...
Resolves #2856 .
2017-10-24 14:18:39 +03:00
Tom Dalton
655ab0bf8b
Address more review comments, fix massive bug I reintroduced in the node-splitting code :-/
2017-10-23 17:49:49 +01:00
Tom Dalton
1e6dc6f8e5
Working (I think) fix for #2836
2017-10-23 13:26:42 +01:00
Tom Dalton
c03612f729
Test now looks for real expected output
2017-10-23 12:40:32 +01:00
Tom Dalton
29fa9d5bff
Add failing test
2017-10-23 12:28:54 +01:00
Ronny Pfannschmidt
083084fcbc
Merge pull request #2842 from ceridwen/features
...
Use funcsigs and inspect.signature to do function argument analysis
2017-10-20 07:49:08 +02:00
Bruno Oliveira
f7387e45ea
Fix linting
2017-10-19 21:50:15 -02:00
Ceridwen
3da28067f3
Replace introspection in compat.getfuncargnames() with inspect/funcsigs.signature
2017-10-19 16:01:26 -07:00
Ronny Pfannschmidt
3f9f4be070
Merge pull request #2845 from jespino/fix/2832
...
Adding Failed exception to manage maxfail behavior
2017-10-19 09:12:11 +02:00
Bruno Oliveira
537fc3c315
Merge pull request #2824 from dirk-thomas/pytest_addopts_before_initini
...
get PYTEST_ADDOPTS before calling _initini
2017-10-18 18:35:12 -02:00
Jesús Espino
00d3abe6dc
Adding Failed exception to manage maxfail behavior
2017-10-17 21:32:20 +02:00
je
eaf38c7239
call path.read(), add tests, add news fragment
2017-10-14 00:49:54 +08:00
Ronny Pfannschmidt
c750a5beec
Merge pull request #2794 from thisch/catchlog
...
Merge pytest-catchlog plugin
2017-10-12 09:02:46 +02:00
Ronny Pfannschmidt
df37cdf51f
Merge pull request #2808 from georgeyk/allow-module-level-skip
...
Allow module level skip
2017-10-12 06:50:53 +02:00
Thomas Hisch
8aed5fecd9
Remove test_logging_initialized_in_test
2017-10-12 02:19:24 +02:00
Thomas Hisch
0e83511d6d
Rename name of registered logging plugin
2017-10-12 02:19:24 +02:00
Thomas Hisch
815dd19fb4
Remove unicode literal compat code
2017-10-12 02:19:24 +02:00
Bruno Oliveira
10a3b9118b
Use a relative cache_dir in test because of how arguments are parsed on Windows
...
We use shlex to parse command-line arguments and PYTEST_ADDOPTS, so passing
a full path with '\' arguments produces incorrect results on Windows
Anyway users are advised to use relative paths for portability
2017-10-11 19:37:17 -03:00
Dirk Thomas
ce8c829945
add test for #2824
2017-10-11 09:41:18 -07:00
hugovk
7113c76f0d
Remove unused import
2017-10-10 09:03:26 +03:00
hugovk
ef732fc51d
Remove code for unsupported Python versions
2017-10-10 08:54:56 +03:00
Ronny Pfannschmidt
9b0ce535c9
Merge pull request #2801 from nicoddemus/capture-fixture
...
Allow fixtures to use capsys and capfd
2017-10-09 15:26:50 +02:00
Leonard Lausen
e86ba41a32
Add testcase for #2819
2017-10-09 01:06:25 +09:00
George Y. Kussumoto
03ce0adb79
Fix: handle CollectReport in folded_skips function
2017-10-04 19:18:55 -03:00
Bruno Oliveira
e7a4d3d8cf
Merge remote-tracking branch 'upstream/master' into features
2017-10-04 17:28:34 -03:00
Bruno Oliveira
df6d5cd4e7
Use ascii_escaped to escape unicode warnings
2017-10-03 12:19:37 -03:00
Bruno Oliveira
fbb9e9328b
Fix warning about non-ascii warnings even when they are ascii
...
Fix #2809
2017-10-03 07:39:53 -03:00
George Y. Kussumoto
06307be15d
Add initial tests using skip with allow_module_level kwarg
2017-10-02 21:07:21 -03:00
Bruno Oliveira
f9589f7b64
Resume output capturing after capsys/capfd.disabled() context manager
...
Fix #1993
2017-09-29 17:24:31 -03:00
Bruno Oliveira
22f338d74d
Refactor some names for better understanding and consistency
2017-09-26 20:09:42 -03:00
Bruno Oliveira
9919269ed0
Allow to use capsys and capfd in other fixtures
...
Fix #2709
2017-09-26 20:09:36 -03:00
Thomas Hisch
ad21d5cac4
Remove pytest-capturelog backward compat code
2017-09-26 23:24:27 +02:00
Thomas Hisch
3e71a50403
Remove unneeded sys import from unittest
2017-09-22 22:27:50 +02:00
Thomas Hisch
1ba219e0da
Adapt (logging) unittest
2017-09-22 22:27:50 +02:00
Thomas Hisch
ca46f4fe2a
Remove conftest
2017-09-22 22:27:49 +02:00
Thomas Hisch
5130f5707f
Fix name clash
2017-09-22 22:27:49 +02:00
Thomas Hisch
6607478b23
Add unittests for LoggingPlugin (excluding perf tests)
2017-09-22 22:27:49 +02:00
Ofir
c89827b9f2
updating import plugin error test in order to make sure it also checks that the original traceback has been shown to the users
2017-09-19 15:23:07 +03:00
Oliver Bestwalter
2802135741
fix 'DoctestItem' object has no attribute '_fixtureinfo'
...
* doxtests don't seem to have this attribute, so nothing will be written in that case.
* tried to be a good boy scout and tidied up surrounding code a bit (comments, shadowed/unused names, removed random new lines, naming things)
2017-09-19 12:41:12 +02:00
Bruno Oliveira
afe7966683
Fix call to outcome.get_result now that outcome.result is deprecated
2017-09-18 21:36:54 -03:00
Bruno Oliveira
3ebfb881c9
Merge remote-tracking branch 'upstream/master' into features
2017-09-18 19:10:31 -03:00
Bruno Oliveira
ac5c5cc1ef
Merge pull request #2750 from evanunderscore/fix-filescompleter
...
Fix crash in FastFilesCompleter with no prefix
2017-09-14 20:11:43 -03:00
Christian Boelsen
14b6380e5f
Fix #2775 - running pytest with "--pyargs" will result in Items with empty "parent.nodeid" if run from a different root directory
2017-09-13 17:15:32 +01:00
Ronny Pfannschmidt
70cdfaf661
Merge pull request #2754 from nicoddemus/xfail_strict
...
Set xfail_strict=True in pytest's own test suite
2017-09-13 09:01:32 +02:00
Bruno Oliveira
abfd9774ef
Remove xfail mark from passing test in py26
2017-09-12 17:59:09 -03:00
Xuan Luong
1e93089165
[bugfix] Checking MarkDecorator equality returns False for non-MarkDecorator object
2017-09-09 01:31:08 -04:00
Bruno Oliveira
9273e11f21
Merge branch 'master' into features
2017-09-07 13:59:10 -03:00
Evan
6cf515b164
Fix crash in FastFilesCompleter with no prefix
2017-09-08 00:14:56 +10:00
Ronny Pfannschmidt
6967f3070e
Merge pull request #2711 from massich/mimic_raises_signature_in_warns
...
[MRG][feature] Change warns signature to mimic the raises call
2017-09-07 13:19:09 +02:00
Joan Massich
aa6a67044f
Add match_regex functionality to warns
2017-09-07 09:58:03 +02:00
Bruno Oliveira
d01f08e96f
Merge branch 'features' into pluggy-master
2017-09-06 13:13:35 -03:00
Ronny Pfannschmidt
ad36407747
Merge pull request #2700 from nicoddemus/staticmethods-fixtures
...
Allow tests declared as @staticmethod to use fixtures
2017-09-06 08:24:00 +02:00
Bruno Oliveira
f825b4979b
Merge remote-tracking branch 'upstream/master' into features
2017-09-05 19:44:33 -03:00
Bruno Oliveira
7d59b2e350
Fix call to outcome.force_result
...
Even though the test is not running at the moment (xfail), at least
we avoid future confusion
2017-09-05 19:08:20 -03:00
Tarcisio Fischer
8d1903fed3
Avoid creating arbitrary filenames for tmpdir on Testdir's constructor
...
Fixes #2751
2017-09-05 15:22:04 -03:00
Joan Massich
d8ecca5ebd
Add test to design warns signature in TDD mimicking raises signature
2017-09-04 15:26:00 +02:00
Bruno Oliveira
3dc0da9339
Remove __multicall__ warning and usages in testing
...
pluggy>=0.5 already warns about those
2017-09-01 18:53:06 -03:00
Ronny Pfannschmidt
181bd60bf9
Merge pull request #2742 from nicoddemus/resultlog-deprecation
...
Improve user guidance regarding ``--resultlog`` deprecation
2017-09-01 08:29:41 +02:00
Bruno Oliveira
3288c9a110
Improve user guidance regarding ``--resultlog`` deprecation
...
Fix #2739
2017-08-31 19:11:41 -03:00
Bruno Oliveira
221797c609
Encode utf-8 byte strings in pytester's makefile
...
Fix #2738
2017-08-31 18:49:06 -03:00
Ronny Pfannschmidt
5e00549ecc
Merge pull request #2735 from fgmacedo/fgm-fix-reprfuncargs-toterminal
...
2731.bug Fix ReprFuncArgs with mixed unicode and utf-8 args.
2017-08-31 09:36:56 +02:00
Fernando Macedo
59cdef92be
fixes #2731 ReprFuncArgs with mixed unicode and utf-8 args
2017-08-30 16:06:12 -03:00
Tyler Goodlet
ff35c17ecf
Drop wrapper module; import directly
2017-08-25 11:46:55 -04:00
Kirill Pinchuk
12b1bff6c5
`compat.safe_getattr` now catches OutcomeExceptions too
2017-08-23 17:17:03 +03:00
Bruno Oliveira
a993add783
Allow tests declared as @staticmethod to use fixtures
...
Fix #2699
2017-08-17 20:44:19 -03:00
Ronny Pfannschmidt
5c0feb2877
Merge pull request #2680 from prokaktus/skipping-same-module
...
Fold skipped tests with global pytestmark variable
2017-08-15 10:52:24 +02:00
prokaktus
98bf5fc9be
Fold skipped tests with global pytestmark variable
2017-08-15 02:18:46 +03:00
Ronny Pfannschmidt
eb462582af
fix #2675 - store marks correctly in callspecs
2017-08-10 19:46:36 +02:00
Bruno Oliveira
cc0f2473eb
Fix windows console workaround error with non-standard io-streams
...
Fix #2666
2017-08-07 20:57:13 -03:00
Srinivas Reddy Thatiparthy
a0101f024e
remove os.sep as it behaves differently linux and windows.
...
* on linux it is '/'
* on windows it is '\'
2017-08-05 23:21:43 +05:30
Bruno Oliveira
ad52f714a9
Fix small terminal glitch when collecting a single test item
...
Fix #2579
2017-08-03 20:57:46 -03:00
Bruno Oliveira
1deac2e210
Properly escape test names when setting PYTEST_CURRENT_TEST environment variable
...
Fix #2644
2017-08-01 20:52:37 -03:00
Bruno Oliveira
763c580a2a
Merge pull request #2576 from maiksensi/feat/raise-not-implemented-for-lt-gt-in-approx
...
#2003 Change behavior of `approx.py` to only support `__eq__` comparison
2017-07-30 17:48:33 -03:00
Bruno Oliveira
e1aed8cb17
Merge pull request #2490 from RonnyPfannschmidt/fix-580
...
Test Outcomes as BaseException - fix #580
2017-07-30 17:38:42 -03:00
Bruno Oliveira
713f7636e1
Merge pull request #2632 from jmoldow/pep_0415_suppress_exception_context
...
Support PEP-415's Exception.__suppress_context__
2017-07-30 17:22:40 -03:00
Bruno Oliveira
4cd8727379
Merge pull request #2617 from wence-/fix/nondeterministic-fixtures
...
Fix nondeterminism in fixture collection order
2017-07-30 17:17:40 -03:00
Jordan Moldow
2e61f702c0
Support PEP-415's Exception.__suppress_context__
...
PEP-415 states that `exception.__context__` should be suppressed
in traceback outputs, if `exception.__suppress_context__` is
`True`.
Now if a ``raise exception from None`` is caught by pytest,
pytest will no longer chain the context in the test report.
The algorithm in `FormattedExcinfo` now better matches the one
in `traceback.TracebackException`.
`Exception.__suppress_context__` is available in all of the
versions of Python 3 that are supported by pytest.
Fixes #2631 .
2017-07-29 02:39:17 -07:00
Ronny Pfannschmidt
be401bc2f8
fix linting issues
2017-07-28 18:27:59 +02:00
Ronny Pfannschmidt
06a49338b2
make Test Outcomes inherit from BaseException instead of exception
...
fixes #580
2017-07-28 15:28:51 +02:00
Bruno Oliveira
75e6f7717c
Use new hook to report accurate tests skipped in --lf and --ff
2017-07-28 08:54:55 -03:00
Bruno Oliveira
eb1bd3449e
xfail and skipped tests are removed from the "last-failed" cache
...
This accommodates the case where a failing test is marked as
skipped/failed later
2017-07-27 18:43:04 -03:00
Bruno Oliveira
22212c4d61
Add xfail specific tests
2017-07-27 14:40:21 -03:00