fix flakes issues and make --flakes run part of tox runs
This commit is contained in:
@@ -53,7 +53,8 @@ them in turn::
|
||||
|
||||
$ py.test
|
||||
=========================== test session starts ============================
|
||||
platform linux2 -- Python 2.7.3 -- pytest-2.4.2
|
||||
platform linux2 -- Python 2.7.3 -- pytest-2.4.3.dev1
|
||||
plugins: xdist, cov, pep8, xprocess, capturelog, cache, flakes, instafail
|
||||
collected 3 items
|
||||
|
||||
test_expectation.py ..F
|
||||
@@ -74,7 +75,7 @@ them in turn::
|
||||
E + where 54 = eval('6*9')
|
||||
|
||||
test_expectation.py:8: AssertionError
|
||||
==================== 1 failed, 2 passed in 0.01 seconds ====================
|
||||
==================== 1 failed, 2 passed in 0.04 seconds ====================
|
||||
|
||||
As designed in this example, only one pair of input/output values fails
|
||||
the simple test function. And as usual with test function arguments,
|
||||
@@ -100,12 +101,13 @@ Let's run this::
|
||||
|
||||
$ py.test
|
||||
=========================== test session starts ============================
|
||||
platform linux2 -- Python 2.7.3 -- pytest-2.4.2
|
||||
platform linux2 -- Python 2.7.3 -- pytest-2.4.3.dev1
|
||||
plugins: xdist, cov, pep8, xprocess, capturelog, cache, flakes, instafail
|
||||
collected 3 items
|
||||
|
||||
test_expectation.py ..x
|
||||
|
||||
=================== 2 passed, 1 xfailed in 0.01 seconds ====================
|
||||
=================== 2 passed, 1 xfailed in 0.02 seconds ====================
|
||||
|
||||
The one parameter set which caused a failure previously now
|
||||
shows up as an "xfailed (expected to fail)" test.
|
||||
@@ -170,8 +172,8 @@ Let's also run with a stringinput that will lead to a failing test::
|
||||
|
||||
def test_valid_string(stringinput):
|
||||
> assert stringinput.isalpha()
|
||||
E assert <built-in method isalpha of str object at 0x2ac85b043198>()
|
||||
E + where <built-in method isalpha of str object at 0x2ac85b043198> = '!'.isalpha
|
||||
E assert <built-in method isalpha of str object at 0x7f36a91ea1c0>()
|
||||
E + where <built-in method isalpha of str object at 0x7f36a91ea1c0> = '!'.isalpha
|
||||
|
||||
test_strings.py:3: AssertionError
|
||||
1 failed in 0.01 seconds
|
||||
@@ -185,7 +187,7 @@ listlist::
|
||||
$ py.test -q -rs test_strings.py
|
||||
s
|
||||
========================= short test summary info ==========================
|
||||
SKIP [1] /home/hpk/p/pytest/.tox/regen/local/lib/python2.7/site-packages/_pytest/python.py:1024: got empty parameter set, function test_valid_string at /tmp/doc-exec-561/test_strings.py:1
|
||||
SKIP [1] /home/hpk/p/pytest/_pytest/python.py:1019: got empty parameter set, function test_valid_string at /tmp/doc-exec-686/test_strings.py:1
|
||||
1 skipped in 0.01 seconds
|
||||
|
||||
For further examples, you might want to look at :ref:`more
|
||||
|
||||
Reference in New Issue
Block a user