fix flakes issues

This commit is contained in:
holger krekel 2014-06-16 11:27:32 +02:00
parent 65a145e2a7
commit 54c88a6cf3
3 changed files with 4 additions and 22 deletions

View File

@ -4,7 +4,6 @@ import sys
import py, pytest
import _pytest.assertion as plugin
from _pytest.assertion import reinterpret
from _pytest.assertion import util
needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)")

View File

@ -65,7 +65,7 @@ class TestCaptureManager:
assert parser._groups[0].options[0].default == "sys"
@needsosdup
@pytest.mark.parametrize("method",
@pytest.mark.parametrize("method",
['no', 'sys', pytest.mark.skipif('not hasattr(os, "dup")', 'fd')])
def test_capturing_basic_api(self, method):
capouter = StdCaptureFD()
@ -750,7 +750,7 @@ def saved_fd(fd):
finally:
os.dup2(new_fd, fd)
class TestStdCapture:
captureclass = staticmethod(StdCapture)
@ -1011,20 +1011,3 @@ def test_capturing_and_logging_fundamentals(testdir, method):
""")
assert "atexit" not in result.stderr.str()
def test_close_and_capture_again(testdir):
testdir.makepyfile("""
import os
def test_close():
os.close(1)
def test_capture_again():
os.write(1, b"hello\\n")
assert 0
""")
result = testdir.runpytest()
result.stdout.fnmatch_lines("""
*test_capture_again*
*assert 0*
*stdout*
*hello*
""")

View File

@ -123,8 +123,8 @@ class TestConfigAPI:
parser.addoption("--hello")
""")
config = testdir.parseconfig()
pytest.raises(pytest.skip.Exception,
"config.getvalueorskip('hello')")
with pytest.raises(pytest.skip.Exception):
config.getvalueorskip('hello')
def test_getoption(self, testdir):
config = testdir.parseconfig()