Revert making TerminalWriter public in TerminalReporter plugin
We eventually want to replace py.io.TerminalWriter (exposed as "_tw" in TerminalReporter) by something else, so deprecating access to "_tw" and making it public as "writer" is contrary to that.
This commit is contained in:
parent
0ddd3e2839
commit
05cfdcc8cb
|
@ -31,11 +31,6 @@ Deprecations and Removals
|
||||||
with the boolean ``Node._skipped_by_mark``. (`#2767
|
with the boolean ``Node._skipped_by_mark``. (`#2767
|
||||||
<https://github.com/pytest-dev/pytest/issues/2767>`_)
|
<https://github.com/pytest-dev/pytest/issues/2767>`_)
|
||||||
|
|
||||||
- ``TerminalReporter._tw`` has been deprecated in favor of
|
|
||||||
``TerminalReporter.writer`` and will be removed in a future version. Also,
|
|
||||||
``TerminalReporter.writer`` is now read-only. (`#2803
|
|
||||||
<https://github.com/pytest-dev/pytest/issues/2803>`_)
|
|
||||||
|
|
||||||
- Pytest no longer supports Python **2.6** and **3.3**. Those Python versions
|
- Pytest no longer supports Python **2.6** and **3.3**. Those Python versions
|
||||||
are EOL for some time now and incurr maintanance and compatibility costs on
|
are EOL for some time now and incurr maintanance and compatibility costs on
|
||||||
the pytest core team, and following up with the rest of the community we
|
the pytest core team, and following up with the rest of the community we
|
||||||
|
|
|
@ -931,7 +931,7 @@ class Config(object):
|
||||||
fslocation=fslocation, nodeid=nodeid))
|
fslocation=fslocation, nodeid=nodeid))
|
||||||
|
|
||||||
def get_terminal_writer(self):
|
def get_terminal_writer(self):
|
||||||
return self.pluginmanager.get_plugin("terminalreporter").writer
|
return self.pluginmanager.get_plugin("terminalreporter")._tw
|
||||||
|
|
||||||
def pytest_cmdline_parse(self, pluginmanager, args):
|
def pytest_cmdline_parse(self, pluginmanager, args):
|
||||||
# REF1 assert self == pluginmanager.config, (self, pluginmanager.config)
|
# REF1 assert self == pluginmanager.config, (self, pluginmanager.config)
|
||||||
|
|
|
@ -83,7 +83,7 @@ def _enter_pdb(node, excinfo, rep):
|
||||||
# XXX we re-use the TerminalReporter's terminalwriter
|
# XXX we re-use the TerminalReporter's terminalwriter
|
||||||
# because this seems to avoid some encoding related troubles
|
# because this seems to avoid some encoding related troubles
|
||||||
# for not completely clear reasons.
|
# for not completely clear reasons.
|
||||||
tw = node.config.pluginmanager.getplugin("terminalreporter").writer
|
tw = node.config.pluginmanager.getplugin("terminalreporter")._tw
|
||||||
tw.line()
|
tw.line()
|
||||||
tw.sep(">", "traceback")
|
tw.sep(">", "traceback")
|
||||||
rep.toterminal(tw)
|
rep.toterminal(tw)
|
||||||
|
|
|
@ -107,7 +107,7 @@ def pytest_cmdline_main(config):
|
||||||
|
|
||||||
def showhelp(config):
|
def showhelp(config):
|
||||||
reporter = config.pluginmanager.get_plugin('terminalreporter')
|
reporter = config.pluginmanager.get_plugin('terminalreporter')
|
||||||
tw = reporter.writer
|
tw = reporter._tw
|
||||||
tw.write(config._parser.optparser.format_help())
|
tw.write(config._parser.optparser.format_help())
|
||||||
tw.line()
|
tw.line()
|
||||||
tw.line()
|
tw.line()
|
||||||
|
|
|
@ -25,7 +25,7 @@ def pytest_configure(config):
|
||||||
if tr is not None:
|
if tr is not None:
|
||||||
# pastebin file will be utf-8 encoded binary file
|
# pastebin file will be utf-8 encoded binary file
|
||||||
config._pastebinfile = tempfile.TemporaryFile('w+b')
|
config._pastebinfile = tempfile.TemporaryFile('w+b')
|
||||||
oldwrite = tr.writer.write
|
oldwrite = tr._tw.write
|
||||||
|
|
||||||
def tee_write(s, **kwargs):
|
def tee_write(s, **kwargs):
|
||||||
oldwrite(s, **kwargs)
|
oldwrite(s, **kwargs)
|
||||||
|
@ -33,7 +33,7 @@ def pytest_configure(config):
|
||||||
s = s.encode('utf-8')
|
s = s.encode('utf-8')
|
||||||
config._pastebinfile.write(s)
|
config._pastebinfile.write(s)
|
||||||
|
|
||||||
tr.writer.write = tee_write
|
tr._tw.write = tee_write
|
||||||
|
|
||||||
|
|
||||||
def pytest_unconfigure(config):
|
def pytest_unconfigure(config):
|
||||||
|
@ -45,7 +45,7 @@ def pytest_unconfigure(config):
|
||||||
del config._pastebinfile
|
del config._pastebinfile
|
||||||
# undo our patching in the terminal reporter
|
# undo our patching in the terminal reporter
|
||||||
tr = config.pluginmanager.getplugin('terminalreporter')
|
tr = config.pluginmanager.getplugin('terminalreporter')
|
||||||
del tr.writer.__dict__['write']
|
del tr._tw.__dict__['write']
|
||||||
# write summary
|
# write summary
|
||||||
tr.write_sep("=", "Sending information to Paste Service")
|
tr.write_sep("=", "Sending information to Paste Service")
|
||||||
pastebinurl = create_new_paste(sessionlog)
|
pastebinurl = create_new_paste(sessionlog)
|
||||||
|
|
|
@ -308,9 +308,9 @@ def pytest_terminal_summary(terminalreporter):
|
||||||
show_simple(terminalreporter, lines, 'passed', "PASSED %s")
|
show_simple(terminalreporter, lines, 'passed', "PASSED %s")
|
||||||
|
|
||||||
if lines:
|
if lines:
|
||||||
tr.writer.sep("=", "short test summary info")
|
tr._tw.sep("=", "short test summary info")
|
||||||
for line in lines:
|
for line in lines:
|
||||||
tr.writer.line(line)
|
tr._tw.line(line)
|
||||||
|
|
||||||
|
|
||||||
def show_simple(terminalreporter, lines, stat, format):
|
def show_simple(terminalreporter, lines, stat, format):
|
||||||
|
|
|
@ -8,7 +8,6 @@ import itertools
|
||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import warnings
|
|
||||||
|
|
||||||
import pluggy
|
import pluggy
|
||||||
import py
|
import py
|
||||||
|
@ -145,25 +144,15 @@ class TerminalReporter:
|
||||||
self.startdir = py.path.local()
|
self.startdir = py.path.local()
|
||||||
if file is None:
|
if file is None:
|
||||||
file = sys.stdout
|
file = sys.stdout
|
||||||
self._writer = _pytest.config.create_terminal_writer(config, file)
|
self._tw = _pytest.config.create_terminal_writer(config, file)
|
||||||
self._screen_width = self.writer.fullwidth
|
self._screen_width = self._tw.fullwidth
|
||||||
self.currentfspath = None
|
self.currentfspath = None
|
||||||
self.reportchars = getreportopt(config)
|
self.reportchars = getreportopt(config)
|
||||||
self.hasmarkup = self.writer.hasmarkup
|
self.hasmarkup = self._tw.hasmarkup
|
||||||
self.isatty = file.isatty()
|
self.isatty = file.isatty()
|
||||||
self._progress_items_reported = 0
|
self._progress_items_reported = 0
|
||||||
self._show_progress_info = self.config.getini('console_output_style') == 'progress'
|
self._show_progress_info = self.config.getini('console_output_style') == 'progress'
|
||||||
|
|
||||||
@property
|
|
||||||
def writer(self):
|
|
||||||
return self._writer
|
|
||||||
|
|
||||||
@property
|
|
||||||
def _tw(self):
|
|
||||||
warnings.warn(DeprecationWarning('TerminalReporter._tw is deprecated, use TerminalReporter.writer instead'),
|
|
||||||
stacklevel=2)
|
|
||||||
return self.writer
|
|
||||||
|
|
||||||
def hasopt(self, char):
|
def hasopt(self, char):
|
||||||
char = {'xfailed': 'x', 'skipped': 's'}.get(char, char)
|
char = {'xfailed': 'x', 'skipped': 's'}.get(char, char)
|
||||||
return char in self.reportchars
|
return char in self.reportchars
|
||||||
|
@ -175,33 +164,33 @@ class TerminalReporter:
|
||||||
self._write_progress_information_filling_space()
|
self._write_progress_information_filling_space()
|
||||||
self.currentfspath = fspath
|
self.currentfspath = fspath
|
||||||
fspath = self.startdir.bestrelpath(fspath)
|
fspath = self.startdir.bestrelpath(fspath)
|
||||||
self.writer.line()
|
self._tw.line()
|
||||||
self.writer.write(fspath + " ")
|
self._tw.write(fspath + " ")
|
||||||
self.writer.write(res)
|
self._tw.write(res)
|
||||||
|
|
||||||
def write_ensure_prefix(self, prefix, extra="", **kwargs):
|
def write_ensure_prefix(self, prefix, extra="", **kwargs):
|
||||||
if self.currentfspath != prefix:
|
if self.currentfspath != prefix:
|
||||||
self.writer.line()
|
self._tw.line()
|
||||||
self.currentfspath = prefix
|
self.currentfspath = prefix
|
||||||
self.writer.write(prefix)
|
self._tw.write(prefix)
|
||||||
if extra:
|
if extra:
|
||||||
self.writer.write(extra, **kwargs)
|
self._tw.write(extra, **kwargs)
|
||||||
self.currentfspath = -2
|
self.currentfspath = -2
|
||||||
self._write_progress_information_filling_space()
|
self._write_progress_information_filling_space()
|
||||||
|
|
||||||
def ensure_newline(self):
|
def ensure_newline(self):
|
||||||
if self.currentfspath:
|
if self.currentfspath:
|
||||||
self.writer.line()
|
self._tw.line()
|
||||||
self.currentfspath = None
|
self.currentfspath = None
|
||||||
|
|
||||||
def write(self, content, **markup):
|
def write(self, content, **markup):
|
||||||
self.writer.write(content, **markup)
|
self._tw.write(content, **markup)
|
||||||
|
|
||||||
def write_line(self, line, **markup):
|
def write_line(self, line, **markup):
|
||||||
if not isinstance(line, six.text_type):
|
if not isinstance(line, six.text_type):
|
||||||
line = six.text_type(line, errors="replace")
|
line = six.text_type(line, errors="replace")
|
||||||
self.ensure_newline()
|
self.ensure_newline()
|
||||||
self.writer.line(line, **markup)
|
self._tw.line(line, **markup)
|
||||||
|
|
||||||
def rewrite(self, line, **markup):
|
def rewrite(self, line, **markup):
|
||||||
"""
|
"""
|
||||||
|
@ -214,22 +203,22 @@ class TerminalReporter:
|
||||||
"""
|
"""
|
||||||
erase = markup.pop('erase', False)
|
erase = markup.pop('erase', False)
|
||||||
if erase:
|
if erase:
|
||||||
fill_count = self.writer.fullwidth - len(line) - 1
|
fill_count = self._tw.fullwidth - len(line) - 1
|
||||||
fill = ' ' * fill_count
|
fill = ' ' * fill_count
|
||||||
else:
|
else:
|
||||||
fill = ''
|
fill = ''
|
||||||
line = str(line)
|
line = str(line)
|
||||||
self.writer.write("\r" + line + fill, **markup)
|
self._tw.write("\r" + line + fill, **markup)
|
||||||
|
|
||||||
def write_sep(self, sep, title=None, **markup):
|
def write_sep(self, sep, title=None, **markup):
|
||||||
self.ensure_newline()
|
self.ensure_newline()
|
||||||
self.writer.sep(sep, title, **markup)
|
self._tw.sep(sep, title, **markup)
|
||||||
|
|
||||||
def section(self, title, sep="=", **kw):
|
def section(self, title, sep="=", **kw):
|
||||||
self.writer.sep(sep, title, **kw)
|
self._tw.sep(sep, title, **kw)
|
||||||
|
|
||||||
def line(self, msg, **kw):
|
def line(self, msg, **kw):
|
||||||
self.writer.line(msg, **kw)
|
self._tw.line(msg, **kw)
|
||||||
|
|
||||||
def pytest_internalerror(self, excrepr):
|
def pytest_internalerror(self, excrepr):
|
||||||
for line in six.text_type(excrepr).split("\n"):
|
for line in six.text_type(excrepr).split("\n"):
|
||||||
|
@ -282,7 +271,7 @@ class TerminalReporter:
|
||||||
if not running_xdist and self.showfspath:
|
if not running_xdist and self.showfspath:
|
||||||
self.write_fspath_result(rep.nodeid, letter)
|
self.write_fspath_result(rep.nodeid, letter)
|
||||||
else:
|
else:
|
||||||
self.writer.write(letter)
|
self._tw.write(letter)
|
||||||
self._write_progress_if_past_edge()
|
self._write_progress_if_past_edge()
|
||||||
else:
|
else:
|
||||||
if markup is None:
|
if markup is None:
|
||||||
|
@ -299,13 +288,13 @@ class TerminalReporter:
|
||||||
self.write_ensure_prefix(line, word, **markup)
|
self.write_ensure_prefix(line, word, **markup)
|
||||||
else:
|
else:
|
||||||
self.ensure_newline()
|
self.ensure_newline()
|
||||||
self.writer.write("[%s]" % rep.node.gateway.id)
|
self._tw.write("[%s]" % rep.node.gateway.id)
|
||||||
if self._show_progress_info:
|
if self._show_progress_info:
|
||||||
self.writer.write(self._get_progress_information_message() + " ", cyan=True)
|
self._tw.write(self._get_progress_information_message() + " ", cyan=True)
|
||||||
else:
|
else:
|
||||||
self.writer.write(' ')
|
self._tw.write(' ')
|
||||||
self.writer.write(word, **markup)
|
self._tw.write(word, **markup)
|
||||||
self.writer.write(" " + line)
|
self._tw.write(" " + line)
|
||||||
self.currentfspath = -2
|
self.currentfspath = -2
|
||||||
|
|
||||||
def _write_progress_if_past_edge(self):
|
def _write_progress_if_past_edge(self):
|
||||||
|
@ -316,10 +305,10 @@ class TerminalReporter:
|
||||||
self._write_progress_information_filling_space()
|
self._write_progress_information_filling_space()
|
||||||
return
|
return
|
||||||
|
|
||||||
past_edge = self.writer.chars_on_current_line + self._PROGRESS_LENGTH + 1 >= self._screen_width
|
past_edge = self._tw.chars_on_current_line + self._PROGRESS_LENGTH + 1 >= self._screen_width
|
||||||
if past_edge:
|
if past_edge:
|
||||||
msg = self._get_progress_information_message()
|
msg = self._get_progress_information_message()
|
||||||
self.writer.write(msg + '\n', cyan=True)
|
self._tw.write(msg + '\n', cyan=True)
|
||||||
|
|
||||||
_PROGRESS_LENGTH = len(' [100%]')
|
_PROGRESS_LENGTH = len(' [100%]')
|
||||||
|
|
||||||
|
@ -331,7 +320,7 @@ class TerminalReporter:
|
||||||
if not self._show_progress_info:
|
if not self._show_progress_info:
|
||||||
return
|
return
|
||||||
msg = self._get_progress_information_message()
|
msg = self._get_progress_information_message()
|
||||||
fill = ' ' * (self.writer.fullwidth - self.writer.chars_on_current_line - len(msg) - 1)
|
fill = ' ' * (self._tw.fullwidth - self._tw.chars_on_current_line - len(msg) - 1)
|
||||||
self.write(fill + msg, cyan=True)
|
self.write(fill + msg, cyan=True)
|
||||||
|
|
||||||
def pytest_collection(self):
|
def pytest_collection(self):
|
||||||
|
@ -418,9 +407,9 @@ class TerminalReporter:
|
||||||
if self.config.option.collectonly:
|
if self.config.option.collectonly:
|
||||||
self._printcollecteditems(session.items)
|
self._printcollecteditems(session.items)
|
||||||
if self.stats.get('failed'):
|
if self.stats.get('failed'):
|
||||||
self.writer.sep("!", "collection failures")
|
self._tw.sep("!", "collection failures")
|
||||||
for rep in self.stats.get('failed'):
|
for rep in self.stats.get('failed'):
|
||||||
rep.toterminal(self.writer)
|
rep.toterminal(self._tw)
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
lines = self.config.hook.pytest_report_collectionfinish(
|
lines = self.config.hook.pytest_report_collectionfinish(
|
||||||
|
@ -438,12 +427,12 @@ class TerminalReporter:
|
||||||
name = item.nodeid.split('::', 1)[0]
|
name = item.nodeid.split('::', 1)[0]
|
||||||
counts[name] = counts.get(name, 0) + 1
|
counts[name] = counts.get(name, 0) + 1
|
||||||
for name, count in sorted(counts.items()):
|
for name, count in sorted(counts.items()):
|
||||||
self.writer.line("%s: %d" % (name, count))
|
self._tw.line("%s: %d" % (name, count))
|
||||||
else:
|
else:
|
||||||
for item in items:
|
for item in items:
|
||||||
nodeid = item.nodeid
|
nodeid = item.nodeid
|
||||||
nodeid = nodeid.replace("::()::", "::")
|
nodeid = nodeid.replace("::()::", "::")
|
||||||
self.writer.line(nodeid)
|
self._tw.line(nodeid)
|
||||||
return
|
return
|
||||||
stack = []
|
stack = []
|
||||||
indent = ""
|
indent = ""
|
||||||
|
@ -458,13 +447,13 @@ class TerminalReporter:
|
||||||
# if col.name == "()":
|
# if col.name == "()":
|
||||||
# continue
|
# continue
|
||||||
indent = (len(stack) - 1) * " "
|
indent = (len(stack) - 1) * " "
|
||||||
self.writer.line("%s%s" % (indent, col))
|
self._tw.line("%s%s" % (indent, col))
|
||||||
|
|
||||||
@pytest.hookimpl(hookwrapper=True)
|
@pytest.hookimpl(hookwrapper=True)
|
||||||
def pytest_sessionfinish(self, exitstatus):
|
def pytest_sessionfinish(self, exitstatus):
|
||||||
outcome = yield
|
outcome = yield
|
||||||
outcome.get_result()
|
outcome.get_result()
|
||||||
self.writer.line("")
|
self._tw.line("")
|
||||||
summary_exit_codes = (
|
summary_exit_codes = (
|
||||||
EXIT_OK, EXIT_TESTSFAILED, EXIT_INTERRUPTED, EXIT_USAGEERROR,
|
EXIT_OK, EXIT_TESTSFAILED, EXIT_INTERRUPTED, EXIT_USAGEERROR,
|
||||||
EXIT_NOTESTSCOLLECTED)
|
EXIT_NOTESTSCOLLECTED)
|
||||||
|
@ -494,10 +483,10 @@ class TerminalReporter:
|
||||||
self.write_sep("!", msg)
|
self.write_sep("!", msg)
|
||||||
if "KeyboardInterrupt" in msg:
|
if "KeyboardInterrupt" in msg:
|
||||||
if self.config.option.fulltrace:
|
if self.config.option.fulltrace:
|
||||||
excrepr.toterminal(self.writer)
|
excrepr.toterminal(self._tw)
|
||||||
else:
|
else:
|
||||||
self.writer.line("to show a full traceback on KeyboardInterrupt use --fulltrace", yellow=True)
|
self._tw.line("to show a full traceback on KeyboardInterrupt use --fulltrace", yellow=True)
|
||||||
excrepr.reprcrash.toterminal(self.writer)
|
excrepr.reprcrash.toterminal(self._tw)
|
||||||
|
|
||||||
def _locationline(self, nodeid, fspath, lineno, domain):
|
def _locationline(self, nodeid, fspath, lineno, domain):
|
||||||
def mkrel(nodeid):
|
def mkrel(nodeid):
|
||||||
|
@ -554,13 +543,13 @@ class TerminalReporter:
|
||||||
|
|
||||||
self.write_sep("=", "warnings summary", yellow=True, bold=False)
|
self.write_sep("=", "warnings summary", yellow=True, bold=False)
|
||||||
for location, warning_records in grouped:
|
for location, warning_records in grouped:
|
||||||
self.writer.line(str(location) or '<undetermined location>')
|
self._tw.line(str(location) or '<undetermined location>')
|
||||||
for w in warning_records:
|
for w in warning_records:
|
||||||
lines = w.message.splitlines()
|
lines = w.message.splitlines()
|
||||||
indented = '\n'.join(' ' + x for x in lines)
|
indented = '\n'.join(' ' + x for x in lines)
|
||||||
self.writer.line(indented)
|
self._tw.line(indented)
|
||||||
self.writer.line()
|
self._tw.line()
|
||||||
self.writer.line('-- Docs: http://doc.pytest.org/en/latest/warnings.html')
|
self._tw.line('-- Docs: http://doc.pytest.org/en/latest/warnings.html')
|
||||||
|
|
||||||
def summary_passes(self):
|
def summary_passes(self):
|
||||||
if self.config.option.tbstyle != "no":
|
if self.config.option.tbstyle != "no":
|
||||||
|
@ -577,10 +566,10 @@ class TerminalReporter:
|
||||||
def print_teardown_sections(self, rep):
|
def print_teardown_sections(self, rep):
|
||||||
for secname, content in rep.sections:
|
for secname, content in rep.sections:
|
||||||
if 'teardown' in secname:
|
if 'teardown' in secname:
|
||||||
self.writer.sep('-', secname)
|
self._tw.sep('-', secname)
|
||||||
if content[-1:] == "\n":
|
if content[-1:] == "\n":
|
||||||
content = content[:-1]
|
content = content[:-1]
|
||||||
self.writer.line(content)
|
self._tw.line(content)
|
||||||
|
|
||||||
def summary_failures(self):
|
def summary_failures(self):
|
||||||
if self.config.option.tbstyle != "no":
|
if self.config.option.tbstyle != "no":
|
||||||
|
@ -620,12 +609,12 @@ class TerminalReporter:
|
||||||
self._outrep_summary(rep)
|
self._outrep_summary(rep)
|
||||||
|
|
||||||
def _outrep_summary(self, rep):
|
def _outrep_summary(self, rep):
|
||||||
rep.toterminal(self.writer)
|
rep.toterminal(self._tw)
|
||||||
for secname, content in rep.sections:
|
for secname, content in rep.sections:
|
||||||
self.writer.sep("-", secname)
|
self._tw.sep("-", secname)
|
||||||
if content[-1:] == "\n":
|
if content[-1:] == "\n":
|
||||||
content = content[:-1]
|
content = content[:-1]
|
||||||
self.writer.line(content)
|
self._tw.line(content)
|
||||||
|
|
||||||
def summary_stats(self):
|
def summary_stats(self):
|
||||||
session_duration = time.time() - self._sessionstarttime
|
session_duration = time.time() - self._sessionstarttime
|
||||||
|
|
|
@ -593,7 +593,7 @@ class TestFunctional(object):
|
||||||
request.applymarker(pytest.mark.hello)
|
request.applymarker(pytest.mark.hello)
|
||||||
def pytest_terminal_summary(terminalreporter):
|
def pytest_terminal_summary(terminalreporter):
|
||||||
values = terminalreporter.stats['passed']
|
values = terminalreporter.stats['passed']
|
||||||
terminalreporter.writer.line("keyword: %s" % values[0].keywords)
|
terminalreporter._tw.line("keyword: %s" % values[0].keywords)
|
||||||
""")
|
""")
|
||||||
testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
def test_func(arg):
|
def test_func(arg):
|
||||||
|
|
|
@ -219,7 +219,7 @@ class TestTerminal(object):
|
||||||
f = py.io.TextIO()
|
f = py.io.TextIO()
|
||||||
monkeypatch.setattr(f, 'isatty', lambda *args: True)
|
monkeypatch.setattr(f, 'isatty', lambda *args: True)
|
||||||
tr = TerminalReporter(config, f)
|
tr = TerminalReporter(config, f)
|
||||||
tr.writer.fullwidth = 10
|
tr._tw.fullwidth = 10
|
||||||
tr.write('hello')
|
tr.write('hello')
|
||||||
tr.rewrite('hey', erase=True)
|
tr.rewrite('hey', erase=True)
|
||||||
assert f.getvalue() == 'hello' + '\r' + 'hey' + (6 * ' ')
|
assert f.getvalue() == 'hello' + '\r' + 'hey' + (6 * ' ')
|
||||||
|
|
Loading…
Reference in New Issue