terminalwriter: remove TerminalWriter's stringio argument
Had a mark indicating it should be removed, and I agree, it's better to just use the `file` argument.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import io
|
||||
import operator
|
||||
import os
|
||||
import queue
|
||||
@@ -1037,10 +1038,11 @@ raise ValueError()
|
||||
"""
|
||||
)
|
||||
excinfo = pytest.raises(ValueError, mod.f)
|
||||
tw = TerminalWriter(stringio=True)
|
||||
file = io.StringIO()
|
||||
tw = TerminalWriter(file=file)
|
||||
repr = excinfo.getrepr(**reproptions)
|
||||
repr.toterminal(tw)
|
||||
assert tw.stringio.getvalue()
|
||||
assert file.getvalue()
|
||||
|
||||
def test_traceback_repr_style(self, importasmod, tw_mock):
|
||||
mod = importasmod(
|
||||
@@ -1255,11 +1257,12 @@ raise ValueError()
|
||||
getattr(excinfo.value, attr).__traceback__ = None
|
||||
|
||||
r = excinfo.getrepr()
|
||||
tw = TerminalWriter(stringio=True)
|
||||
file = io.StringIO()
|
||||
tw = TerminalWriter(file=file)
|
||||
tw.hasmarkup = False
|
||||
r.toterminal(tw)
|
||||
|
||||
matcher = LineMatcher(tw.stringio.getvalue().splitlines())
|
||||
matcher = LineMatcher(file.getvalue().splitlines())
|
||||
matcher.fnmatch_lines(
|
||||
[
|
||||
"ValueError: invalid value",
|
||||
|
||||
Reference in New Issue
Block a user