diff options
author | Bruno Oliveira <nicoddemus@gmail.com> | 2017-07-26 19:01:28 -0300 |
---|---|---|
committer | Bruno Oliveira <nicoddemus@gmail.com> | 2017-07-26 19:01:28 -0300 |
commit | 3d89905114142a434d867ef2c8c6287cb1cfb8da (patch) | |
tree | daaac79f48e21224e5973427bcfac16a88d44f2f /testing | |
parent | 73c6122f35283a88f63db9c57c1dd5055a68d75e (diff) | |
parent | 1a9bc141a50901e2d01bfc3df447ad592d350225 (diff) | |
download | pytest-3d89905114142a434d867ef2c8c6287cb1cfb8da.tar.gz |
Merge remote-tracking branch 'upstream/master' into features
Diffstat (limited to 'testing')
-rw-r--r-- | testing/test_capture.py | 10 | ||||
-rw-r--r-- | testing/test_skipping.py | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/testing/test_capture.py b/testing/test_capture.py index 313819a96..4dd5d8e09 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -716,13 +716,21 @@ def test_dupfile(tmpfile): assert nf not in flist print(i, end="", file=nf) flist.append(nf) + + fname_open = flist[0].name + assert fname_open == repr(flist[0].buffer) + for i in range(5): f = flist[i] f.close() + fname_closed = flist[0].name + assert fname_closed == repr(flist[0].buffer) + assert fname_closed != fname_open tmpfile.seek(0) s = tmpfile.read() assert "01234" in repr(s) tmpfile.close() + assert fname_closed == repr(flist[0].buffer) def test_dupfile_on_bytesio(): @@ -730,6 +738,7 @@ def test_dupfile_on_bytesio(): f = capture.safe_text_dupfile(io, "wb") f.write("hello") assert io.getvalue() == b"hello" + assert 'BytesIO object' in f.name def test_dupfile_on_textio(): @@ -737,6 +746,7 @@ def test_dupfile_on_textio(): f = capture.safe_text_dupfile(io, "wb") f.write("hello") assert io.getvalue() == "hello" + assert not hasattr(f, 'name') @contextlib.contextmanager diff --git a/testing/test_skipping.py b/testing/test_skipping.py index b780e4dc8..6608ccadf 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -708,7 +708,7 @@ def test_skipped_reasons_functional(testdir): ) result = testdir.runpytest('-rs') result.stdout.fnmatch_lines([ - "*SKIP*2*conftest.py:3: test", + "*SKIP*2*conftest.py:4: test", ]) assert result.ret == 0 |