Merge master into features
This commit is contained in:
commit
c51173d426
1
AUTHORS
1
AUTHORS
|
@ -261,6 +261,7 @@ Tim Hoffmann
|
|||
Tim Strazny
|
||||
Tom Dalton
|
||||
Tom Viner
|
||||
Tomáš Gavenčiak
|
||||
Tomer Keren
|
||||
Trevor Bekolay
|
||||
Tyler Goodlet
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Make capture output streams ``.write()`` method return the same return value from original streams.
|
|
@ -1,7 +1 @@
|
|||
coverage:
|
||||
status:
|
||||
project: true
|
||||
patch: true
|
||||
changes: true
|
||||
|
||||
comment: off
|
||||
|
|
|
@ -427,7 +427,7 @@ class EncodedFile:
|
|||
raise TypeError(
|
||||
"write() argument must be str, not {}".format(type(obj).__name__)
|
||||
)
|
||||
self.buffer.write(obj)
|
||||
return self.buffer.write(obj)
|
||||
|
||||
def writelines(self, linelist):
|
||||
data = "".join(linelist)
|
||||
|
|
|
@ -76,7 +76,7 @@ def pytest_addoption(parser):
|
|||
dest="maxfail",
|
||||
const=1,
|
||||
help="exit instantly on first error or failed test.",
|
||||
),
|
||||
)
|
||||
group._addoption(
|
||||
"--maxfail",
|
||||
metavar="num",
|
||||
|
@ -123,7 +123,7 @@ def pytest_addoption(parser):
|
|||
"--co",
|
||||
action="store_true",
|
||||
help="only collect tests, don't execute them.",
|
||||
),
|
||||
)
|
||||
group.addoption(
|
||||
"--pyargs",
|
||||
action="store_true",
|
||||
|
|
|
@ -1532,3 +1532,8 @@ def test_typeerror_encodedfile_write(testdir):
|
|||
result_with_capture.stdout.fnmatch_lines(
|
||||
["E * TypeError: write() argument must be str, not bytes"]
|
||||
)
|
||||
|
||||
|
||||
def test_stderr_write_returns_len(capsys):
|
||||
"""Write on Encoded files, namely captured stderr, should return number of characters written."""
|
||||
assert sys.stderr.write("Foo") == 3
|
||||
|
|
Loading…
Reference in New Issue