[Pytest-commit] commit/pytest: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Sep 22 13:34:54 CEST 2014
2 new commits in pytest:
https://bitbucket.org/hpk42/pytest/commits/7426c3938174/
Changeset: 7426c3938174
Branch: dontreadfrominput-encoding
User: davidszotten
Date: 2014-09-22 11:19:27+00:00
Summary: add `encoding` attr to DontReadFromInput
required by https://docs.python.org/2/library/stdtypes.html#file.encoding
and used e.g. by ipdb at _import_ time
Affected #: 2 files
diff -r 81d45151f455fd7ca06501bb2a895ac0feb54bd2 -r 7426c3938174a2129587f44cc55cee66f450a65c _pytest/capture.py
--- a/_pytest/capture.py
+++ b/_pytest/capture.py
@@ -428,6 +428,9 @@
because in automated test runs it is better to crash than
hang indefinitely.
"""
+
+ encoding = None
+
def read(self, *args):
raise IOError("reading from stdin while output is captured")
readline = read
diff -r 81d45151f455fd7ca06501bb2a895ac0feb54bd2 -r 7426c3938174a2129587f44cc55cee66f450a65c testing/test_capture.py
--- a/testing/test_capture.py
+++ b/testing/test_capture.py
@@ -1025,6 +1025,18 @@
reprec.assertoutcome(passed=1)
+def test_dontreadfrominput_has_encoding(testdir):
+ testdir.makepyfile("""
+ import sys
+ def test_capattr():
+ # should not raise AttributeError
+ assert sys.stdout.encoding
+ assert sys.stderr.encoding
+ """)
+ reprec = testdir.inline_run()
+ reprec.assertoutcome(passed=1)
+
+
def test_pickling_and_unpickling_enocded_file():
# See https://bitbucket.org/hpk42/pytest/pull-request/194
# pickle.loads() raises infinite recursion if
https://bitbucket.org/hpk42/pytest/commits/f58d81b9d2c2/
Changeset: f58d81b9d2c2
User: hpk42
Date: 2014-09-22 11:34:50+00:00
Summary: Merged in davidszotten/pytest/dontreadfrominput-encoding (pull request #205)
add `encoding` attr to DontReadFromInput
Affected #: 2 files
diff -r 81d45151f455fd7ca06501bb2a895ac0feb54bd2 -r f58d81b9d2c2e382ecdfcb09677f742f37a5840d _pytest/capture.py
--- a/_pytest/capture.py
+++ b/_pytest/capture.py
@@ -428,6 +428,9 @@
because in automated test runs it is better to crash than
hang indefinitely.
"""
+
+ encoding = None
+
def read(self, *args):
raise IOError("reading from stdin while output is captured")
readline = read
diff -r 81d45151f455fd7ca06501bb2a895ac0feb54bd2 -r f58d81b9d2c2e382ecdfcb09677f742f37a5840d testing/test_capture.py
--- a/testing/test_capture.py
+++ b/testing/test_capture.py
@@ -1025,6 +1025,18 @@
reprec.assertoutcome(passed=1)
+def test_dontreadfrominput_has_encoding(testdir):
+ testdir.makepyfile("""
+ import sys
+ def test_capattr():
+ # should not raise AttributeError
+ assert sys.stdout.encoding
+ assert sys.stderr.encoding
+ """)
+ reprec = testdir.inline_run()
+ reprec.assertoutcome(passed=1)
+
+
def test_pickling_and_unpickling_enocded_file():
# See https://bitbucket.org/hpk42/pytest/pull-request/194
# pickle.loads() raises infinite recursion if
Repository URL: https://bitbucket.org/hpk42/pytest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list