Bruno Oliveira
458ecae1df
Replace all usages of "pytest_funcarg__" for @pytest.fixture
2016-07-11 22:21:52 -03:00
RedBeardCode
0e2ebc96ff
Remove deprecated cmd options
...
Fixes #1657
2016-06-26 19:26:04 +02:00
Omar Kohl
d81f23009b
Raise CollectError if pytest.skip() is called during collection
...
pytest.skip() must not be used at module level because it can easily be
misunderstood and used as a decorator instead of pytest.mark.skip, causing the
whole module to be skipped instead of just the test being decorated.
This is unexpected for users used to the @unittest.skip decorator and therefore
it is best to bail out with a clean error when it happens.
The pytest equivalent of @unittest.skip is @pytest.mark.skip .
Adapt existing tests that were actually relying on this behaviour and add a
test that explicitly test that collection fails.
fix #607
2016-06-24 20:56:21 +02:00
TomV
99c4b6fdc3
issue 1496 - xfail with condition keyword
2016-04-19 18:12:37 +01:00
Quentin Pradet
653a53226a
Add strict parameter to xfail marker doc
2016-03-22 16:01:51 +04:00
Quentin Pradet
1fbd19b8cb
Fix pytest.mark.skip mark when used in strict mode
2016-03-22 15:40:34 +04:00
Bruno Oliveira
d9ede1bac2
Add test for unconditional skip with reason
2016-02-25 20:02:34 -03:00
Bruno Oliveira
0eeb466f11
Fix strict xfail: it should behave exactly like xfail when a test fails
2016-02-15 19:18:48 -02:00
Bruno Oliveira
ee88679c54
Fix bug in strict xfail: test was not being actually called
2016-02-15 18:43:45 -02:00
Bruno Oliveira
7823838e69
Add strict option to xfail, making tests which XPASS to actually fail the suite
...
Fix #1355
2016-02-14 20:52:27 -02:00
Michael Aquilina
8984177448
TestXFail also shouldnt explicitly inherit from object
2015-10-03 17:12:44 +01:00
Michael Aquilina
00d0c74657
Update reason in test to prevent confusing with test_no_reason
2015-10-03 17:01:21 +01:00
Michael Aquilina
fc0bd9412c
Test that "unconditional skip" is the default reason if none given
2015-10-03 17:00:16 +01:00
Michael Aquilina
5ff9a0ff54
Remove redundant comments
2015-10-03 16:59:27 +01:00
Michael Aquilina
25d74a5919
Dont explicitly inherit from object
2015-10-03 16:55:04 +01:00
Michael Aquilina
213dbe7a5f
newlines
2015-10-03 16:42:15 +01:00
Michael Aquilina
9e57954b03
First argument in pytest.mark.skip is a reason
2015-10-03 16:42:15 +01:00
Michael Aquilina
1b5aa2868d
Check no reason displayed if none specified
2015-10-03 16:42:15 +01:00
Michael Aquilina
04545f8a54
classes inherit from object
2015-10-03 16:42:15 +01:00
Michael Aquilina
d1628944a6
Update skippings tests for better coverage
2015-10-03 16:42:15 +01:00
Michael Aquilina
771aef9ddb
Add a test_skip_class test
2015-10-03 16:42:15 +01:00
Michael Aquilina
f144666f8b
Work towards test coverage of mark.skip
2015-10-03 16:42:14 +01:00
Abhijeet Kasurde
dd69394598
Added testcase and help for report option
...
Fix added to show help of new reporting option 'a'.
Also, added testcase for checking reporting functionality
with option 'a'.
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2015-09-11 12:24:45 +05:30
Bruno Oliveira
953916df49
Report correct reason when using multiple skip/xfail markers
2015-07-18 18:18:45 -03:00
Bruno Oliveira
9d4e0365da
Skipif marker report now refers to the skipped function
...
Fix #114
2015-06-18 21:59:44 -03:00
Floris Bruynooghe
62b8712ca9
Let xfail work on non-python Items
...
For some reason xfail was only implemented on non-python Item
instances. This removes this guard which means plugins creating new
items can raise pytest.xfail.Exception and it will work as expected.
2014-09-23 23:55:26 +01:00
david@mcbf.net
309e3d38a0
Directly pass multiple parameters with mark.parametrize()
...
--HG--
branch : xfail-cause
2014-07-26 18:19:27 +02:00
david@mcbf.net
6a4492a22d
isinstance() on exception value instead of comparing types, consolidate tests
...
--HG--
branch : xfail-cause
2014-07-26 17:46:50 +02:00
david@mcbf.net
7b273b8577
Add mark.xfail argument raises so that unexpected exceptions show up as test failures.
...
--HG--
branch : xfail-cause
2014-07-26 15:11:05 +02:00
holger krekel
8ac5af2896
fix flakes issues and make --flakes run part of tox runs
2013-10-12 15:39:22 +02:00
holger krekel
a5d4c20905
make "--runxfail" turn imperative pytest.xfail calls into no ops
...
(it already did neutralize pytest.mark.xfail markers)
2013-10-09 22:55:20 +02:00
Anatoly Bubenkov
87eae6213e
fixes for py25 in test_skipping
2013-07-11 11:15:31 +02:00
Anatoly Bubenkov
214793f697
re #329 add test for skipif failure when you pass boolean without the reason. add emphasize to the docs.
...
--HG--
branch : 329-skipif-requires-expression-as-a-string
2013-07-06 18:54:24 +02:00
holger krekel
bbd265184d
support boolean condition expressions in skipif/xfail
...
change documentation to prefer it over string expressions
2013-05-07 18:40:26 +02:00
Floris Bruynooghe
48e6aa9dc7
Allow MarkEvaluator expressions to be unicode
...
This fixes issue #266 .
2013-02-15 11:47:48 +00:00
holger krekel
d4d213f83d
some more fixes
2012-10-20 14:10:12 +02:00
holger krekel
6e0c30d67d
fix skip/xfail confusion, reported and discussed on
...
http://stackoverflow.com/questions/11105828/in-py-test-when-i-explicitly-skip-a-test-that-is-marked-as-xfail-how-can-i-get
2012-06-23 11:32:32 +02:00
holger krekel
1bbe1d086c
fix issue160 a failing setup of an xfail-marked tests should
...
be reported as xfail (not xpass)
2012-06-19 23:48:39 +02:00
holger krekel
bc8ee95e72
add ini-file "markers" option and a cmdline option "--markers" to show defined markers. Add "skipif", "xfail" etc. to the set of builtin markers shown with the --markers option.
2011-11-11 22:56:11 +00:00
Ronny Pfannschmidt
6ac638ba87
add a reportchar for reporting errors, fixes #76
2011-09-29 23:44:26 +02:00
holger krekel
3bd3ba133f
fix issue75 - test failure on jython.
...
also experimentally enable more tests in the jython test env.
2011-09-25 07:40:43 +02:00
holger krekel
7e44c38570
avoid this test on pypy because syntax errors on pypy-1.4.1 are not precise it seems
2011-03-05 14:59:06 +01:00
holger krekel
070c73ff2f
fix issue30 (the second time)
...
put module globals into namespace for xfail and skipif expressions
2011-03-03 23:22:55 +01:00
holger krekel
682773e0cb
fix issue30 - better handling and reporting of errors in xfail expressions
2011-03-03 12:19:17 +01:00
holger krekel
513482f4f7
fix issue9 wrong XPass with failing setup/teardown function of xfail marked test
...
now when setup or teardown of a test item/function fails and the test
is marked "xfail" it will show up as an xfail-ed test.
2010-12-06 18:20:47 +01:00
holger krekel
0357d3afda
refine initialization and collection reporting, introduce a progress bar
2010-11-22 11:59:56 +01:00
holger krekel
a698465487
streamline docs, especially use "import pytest" and "pytest.*" in python code examples instead of "import py" and "py.test.*".
2010-11-17 22:12:16 +01:00
holger krekel
82ba645a2e
fix skip reporting over distributed testing. if we have a "skip" report
...
rep.longrepr will now be a 3-tuple (path, lineno, message)
2010-11-13 21:03:28 +01:00
holger krekel
076e03e90f
also un-nest test directory
2010-11-13 11:30:40 +01:00