Merge branch 'master' into features
This commit is contained in:
commit
abb5d20841
2
AUTHORS
2
AUTHORS
|
@ -93,6 +93,7 @@ Kevin Cox
|
||||||
Kodi B. Arfer
|
Kodi B. Arfer
|
||||||
Lee Kamentsky
|
Lee Kamentsky
|
||||||
Lev Maximov
|
Lev Maximov
|
||||||
|
Llandy Riveron Del Risco
|
||||||
Loic Esteve
|
Loic Esteve
|
||||||
Lukas Bednar
|
Lukas Bednar
|
||||||
Luke Murphy
|
Luke Murphy
|
||||||
|
@ -168,3 +169,4 @@ Vitaly Lashmanov
|
||||||
Vlad Dragos
|
Vlad Dragos
|
||||||
Wouter van Ackooy
|
Wouter van Ackooy
|
||||||
Xuecong Liao
|
Xuecong Liao
|
||||||
|
Zoltán Máté
|
||||||
|
|
|
@ -282,7 +282,15 @@ def _setup_collect_fakemodule():
|
||||||
|
|
||||||
|
|
||||||
if _PY2:
|
if _PY2:
|
||||||
from py.io import TextIO as CaptureIO
|
# Without this the test_dupfile_on_textio will fail, otherwise CaptureIO could directly inherit from StringIO.
|
||||||
|
from py.io import TextIO
|
||||||
|
|
||||||
|
class CaptureIO(TextIO):
|
||||||
|
|
||||||
|
@property
|
||||||
|
def encoding(self):
|
||||||
|
return getattr(self, '_encoding', 'UTF-8')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
import io
|
import io
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Provides encoding attribute on CaptureIO.
|
|
@ -355,7 +355,7 @@ class TestLoggingInteraction(object):
|
||||||
""")
|
""")
|
||||||
result = testdir.runpytest_subprocess(
|
result = testdir.runpytest_subprocess(
|
||||||
p, "--traceconfig",
|
p, "--traceconfig",
|
||||||
"-p", "no:capturelog")
|
"-p", "no:capturelog", "-p", "no:hypothesis", "-p", "no:hypothesispytest")
|
||||||
assert result.ret != 0
|
assert result.ret != 0
|
||||||
result.stdout.fnmatch_lines([
|
result.stdout.fnmatch_lines([
|
||||||
"*hello432*",
|
"*hello432*",
|
||||||
|
@ -1040,6 +1040,15 @@ def test_capture_not_started_but_reset():
|
||||||
capsys.stop_capturing()
|
capsys.stop_capturing()
|
||||||
|
|
||||||
|
|
||||||
|
def test_using_capsys_fixture_works_with_sys_stdout_encoding(capsys):
|
||||||
|
test_text = 'test text'
|
||||||
|
|
||||||
|
print(test_text.encode(sys.stdout.encoding, 'replace'))
|
||||||
|
(out, err) = capsys.readouterr()
|
||||||
|
assert out
|
||||||
|
assert err == ''
|
||||||
|
|
||||||
|
|
||||||
@needsosdup
|
@needsosdup
|
||||||
@pytest.mark.parametrize('use', [True, False])
|
@pytest.mark.parametrize('use', [True, False])
|
||||||
def test_fdcapture_tmpfile_remains_the_same(tmpfile, use):
|
def test_fdcapture_tmpfile_remains_the_same(tmpfile, use):
|
||||||
|
|
Loading…
Reference in New Issue