Bruno Oliveira
221f42c5ce
Change --strict help message to clarify it deals with unregistered markers
...
Fix #2444
2017-07-04 20:14:57 -03:00
Bruno Oliveira
22b7701431
Merge pull request #2480 from nicoddemus/issue-2469-deprecated-call-ctx
...
deprecated_call context manager captures warnings already raised
2017-06-22 10:53:28 -03:00
Ronny Pfannschmidt
5e832017d5
Merge pull request #2487 from nicoddemus/recursion-error-2486
...
Fix internal error when trying to detect the start of a recursive traceback
2017-06-22 13:40:32 +02:00
Ronny Pfannschmidt
4e57a39067
Merge pull request #2468 from nicoddemus/collection-report-2464
...
Fix incorrect "collected items" report when specifying tests on the command-line
2017-06-14 10:57:57 +02:00
Ronny Pfannschmidt
af0344e940
Merge pull request #2500 from nicoddemus/issue-2434-doctest-modules
...
Fix decode error in Python 2 for doctests in docstrings
2017-06-14 05:52:44 +02:00
Bruno Oliveira
4e4ebbef5a
Improve test to ensure the expected function is re-raised
2017-06-13 20:16:48 -03:00
Bruno Oliveira
b09d60c60a
Fix decode error in Python 2 for doctests in docstrings
...
Fix #2434
2017-06-13 19:41:34 -03:00
Ryan Fitzpatrick
5a856b6e29
handle and reraise subrequest finalizer exceptions
2017-06-12 21:26:42 -04:00
Bruno Oliveira
8bb589fc5d
Fix internal error when trying to detect the start of a recursive traceback.
...
Fix #2486
2017-06-09 19:26:26 -03:00
Ronny Pfannschmidt
917b9a8352
Merge pull request #2476 from nicoddemus/fix-2459-numpy-comparison
...
Fix internal error when a recursion error occurs and frames contain objects that can't be compared
2017-06-07 20:34:36 +02:00
Bruno Oliveira
2127a2378a
Fix internal error with recursive tracebacks with that frames contain objects that can't be compared
...
Fix #2459
2017-06-07 14:40:13 -03:00
Bruno Oliveira
620ba5971f
deprecated_call context manager captures warnings already raised
...
Fix #2469
2017-06-06 22:40:04 -03:00
Bruno Oliveira
9d41eaedbf
Issue UnicodeWarning only for non-ascii unicode
...
Fix #2463
2017-06-05 10:43:15 -03:00
Bruno Oliveira
46d157fe07
Fix collection report when collecting a single test item
2017-06-03 20:39:53 -03:00
Bruno Oliveira
87e4a28351
Fix incorrect collected items report when specifying tests on the command-line
...
Fix #2464
2017-06-03 20:39:53 -03:00
Segev Finer
f74f14f038
Fix --help with required options
...
This works by adding an argparse Action that will raise an exception in
order to skip the rest of the argument parsing. This prevents argparse
from quitting due to missing required arguments, similar to the way that
the builtin argparse --help option is implemented by raising SystemExit.
Fixes : #1999
2017-06-01 21:29:50 +03:00
Andreas Pelme
ac9c8fcdab
Failing test for issue #2121
2017-05-31 08:25:04 +02:00
Bruno Oliveira
1dee443c2b
Merge pull request #2445 from nicoddemus/warnings-remove-filter
...
No longer override existing warning filters during warnings capture
2017-05-30 18:14:01 -03:00
Bruno Oliveira
32e2642233
No longer override existing warning filters during warnings capture
...
Fix #2430
2017-05-30 17:17:36 -03:00
Bruno Oliveira
f96a1d89c5
pytest.deprecated_call now captures PendingDeprecationWarning in context manager form
...
Fix #2441
2017-05-30 12:52:18 -03:00
Bruno Oliveira
836dc451f4
Fix unicode issue while running doctests in Python 2
...
Fix #2434
2017-05-26 07:35:14 -03:00
wanghui
d7a5c5716f
Add UnicodeWarning for unicode warnings in Python2
2017-05-26 13:12:02 +08:00
wanghui
c39689da41
Correct warnings with unicode message.
2017-05-25 17:59:42 +08:00
Bruno Oliveira
f39f416c5d
Improve tests a bit
...
Use a normal function instead of a lambda
Parametrize test about suite name option
2017-05-12 17:52:50 -03:00
Dmitri Pribysh
c9282f9e94
Transition to using ini option for suite name
2017-05-12 17:48:50 -03:00
Dmitri Pribysh
fe7d89f033
Add '--junit-suite-name' CLI option
2017-05-12 17:48:50 -03:00
Bruno Oliveira
f3b359f5b8
Merge remote-tracking branch 'upstream/master' into merge-master-into-features
...
# Conflicts:
# _pytest/capture.py
# _pytest/compat.py
# _pytest/python.py
# testing/python/collect.py
# testing/test_mark.py
2017-05-03 19:04:53 -03:00
Vitaly Lashmanov
60b8339166
Issue #2383 - Show the correct error message when collect "parametrize" func with wrong args and add test for this case.
2017-04-29 14:32:09 +03:00
Bruno Oliveira
25371ddbfd
Merge pull request #2315 from RonnyPfannschmidt/namespace-hook
...
remove pytest internal usage of the namespace hook
2017-04-21 16:24:20 -03:00
Kodi Arfer
dcefb287fc
Try not to assume a module's file extension is .py
2017-04-19 12:26:56 -07:00
Bruno Oliveira
0baf5e1499
Fix test that expected "unknown hook" error on stderr
2017-04-11 21:55:12 -03:00
Bruno Oliveira
83c508eea3
Verify hooks after collection completes
...
Fix #1821
2017-04-11 21:55:12 -03:00
Bruno Oliveira
78ac1bf5d1
Merge pull request #2350 from nicoddemus/future-imports-rewrite
...
Ensure rewritten modules don't inherit __future__ flags from pytest
2017-04-11 20:59:05 -03:00
Bruno Oliveira
1125786e78
Improve --lf/--ff test as commented during review
2017-04-11 17:55:55 -03:00
Jonas Obrist
0ab85e7a9c
Changed behavior if --lf and --ff are both used.
...
When using both --last-failed/--lf and --failed-first/--ff pytest would
run all tests with failed tests first (as if --lf was not provied). This
patch changes it so that when using both flags, only the last failed
tests are run. This makes it easier to set --ff as the default behavior
via the config file and then selectively use --lf to only run the last
failed tests.
2017-04-10 17:46:13 +09:00
Bruno Oliveira
1b5f898dc5
Ensure rewritten modules don't inherit __future__ flags from pytest
...
In a recent refactoring we enabled all __future__ features in pytest
modules, but that has the unwanted side effect of propagating those
features to compile()'d modules inside assertion rewriting, unless
we pass dont_inherit=False to compile().
2017-04-06 15:00:36 -03:00
reut
333ce9849d
added acceptance test for unicode plugin names
2017-04-06 10:54:47 +00:00
Bruno Oliveira
58ac4faf0c
Fix exception formatting while importing test modules
...
Fix #2336
2017-03-29 14:43:13 -03:00
Ronny Pfannschmidt
4d31ea8316
add a comment explaining the modimport tests
2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt
bb750a7945
add missed file
2017-03-28 11:45:06 +02:00
Bruno Oliveira
74b54ac0ec
Fix errors related to warnings raised on pypy test environment
...
For some reason pypy raises this warning in the line that the catch_warnings block was added:
______________________________ ERROR collecting ______________________________
C:\ProgramData\chocolatey\lib\python.pypy\tools\pypy2-v5.4.1-win32\lib-python\2.7\pkgutil.py:476: in find_loader
loader = importer.find_module(fullname)
c:\pytest\.tox\pypy\site-packages\_pytest\assertion\rewrite.py:75: in find_module
fd, fn, desc = imp.find_module(lastname, path)
<builtin>/?:3: in anonymous
???
E ImportWarning: Not importing directory 'c:\users\bruno\appdata\local\temp\pytest-of-Bruno\pytest-3192\testdir\test_cmdline_python_package0' missing __init__.py
2017-03-21 22:32:41 -03:00
Bruno Oliveira
916d272c44
Fix test on linux
2017-03-20 23:44:50 -03:00
Bruno Oliveira
fa56114115
Clean up warnings generated by pytest's own suite
2017-03-20 22:13:17 -03:00
Bruno Oliveira
9f85584656
Merge remote-tracking branch 'upstream/features' into integrate-pytest-warnings
2017-03-20 19:59:05 -03:00
Ronny Pfannschmidt
e368fb4b29
implement pytest.param
...
this allows a clear addition of parameterization parameters that carry along marks
instead of nesting multiple mark objects and destroying the possibility of creating
function valued parameters,
it just folders everything together into one object carrfying parameters, and the marks.
2017-03-17 16:53:43 +01:00
Bruno Oliveira
4d947077bb
Fix test in py26 that expected a floor division error message
2017-03-16 23:07:03 -03:00
Bruno Oliveira
e5021dc9dc
Replace py.builtin.print_() calls by builtin print() function
2017-03-16 22:46:51 -03:00
Bruno Oliveira
42a5d6bdfa
Add __future__ imports to all pytest modules
...
This prevents silly errors from creeping in Python 2 when testing in Python 3
2017-03-16 22:45:40 -03:00
Bruno Oliveira
78194093af
Improve warning representation in terminal plugin and fix tests
2017-03-16 21:57:32 -03:00
Bruno Oliveira
be5db6fa22
Capture warnings around the entire runtestprotocol
...
This is necessary for the warnings plugin to play nice with the
recwarn fixture
2017-03-16 21:54:41 -03:00