fix flakes issues
This commit is contained in:
parent
65a145e2a7
commit
54c88a6cf3
|
@ -4,7 +4,6 @@ import sys
|
||||||
import py, pytest
|
import py, pytest
|
||||||
import _pytest.assertion as plugin
|
import _pytest.assertion as plugin
|
||||||
from _pytest.assertion import reinterpret
|
from _pytest.assertion import reinterpret
|
||||||
from _pytest.assertion import util
|
|
||||||
needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)")
|
needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class TestCaptureManager:
|
||||||
assert parser._groups[0].options[0].default == "sys"
|
assert parser._groups[0].options[0].default == "sys"
|
||||||
|
|
||||||
@needsosdup
|
@needsosdup
|
||||||
@pytest.mark.parametrize("method",
|
@pytest.mark.parametrize("method",
|
||||||
['no', 'sys', pytest.mark.skipif('not hasattr(os, "dup")', 'fd')])
|
['no', 'sys', pytest.mark.skipif('not hasattr(os, "dup")', 'fd')])
|
||||||
def test_capturing_basic_api(self, method):
|
def test_capturing_basic_api(self, method):
|
||||||
capouter = StdCaptureFD()
|
capouter = StdCaptureFD()
|
||||||
|
@ -750,7 +750,7 @@ def saved_fd(fd):
|
||||||
finally:
|
finally:
|
||||||
os.dup2(new_fd, fd)
|
os.dup2(new_fd, fd)
|
||||||
|
|
||||||
|
|
||||||
class TestStdCapture:
|
class TestStdCapture:
|
||||||
captureclass = staticmethod(StdCapture)
|
captureclass = staticmethod(StdCapture)
|
||||||
|
|
||||||
|
@ -1011,20 +1011,3 @@ def test_capturing_and_logging_fundamentals(testdir, method):
|
||||||
""")
|
""")
|
||||||
assert "atexit" not in result.stderr.str()
|
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*
|
|
||||||
""")
|
|
||||||
|
|
||||||
|
|
|
@ -123,8 +123,8 @@ class TestConfigAPI:
|
||||||
parser.addoption("--hello")
|
parser.addoption("--hello")
|
||||||
""")
|
""")
|
||||||
config = testdir.parseconfig()
|
config = testdir.parseconfig()
|
||||||
pytest.raises(pytest.skip.Exception,
|
with pytest.raises(pytest.skip.Exception):
|
||||||
"config.getvalueorskip('hello')")
|
config.getvalueorskip('hello')
|
||||||
|
|
||||||
def test_getoption(self, testdir):
|
def test_getoption(self, testdir):
|
||||||
config = testdir.parseconfig()
|
config = testdir.parseconfig()
|
||||||
|
|
Loading…
Reference in New Issue