示例#1
0
 def test_rewrite(self, testdir, monkeypatch):
     config = testdir.parseconfig()
     f = py.io.TextIO()
     monkeypatch.setattr(f, "isatty", lambda *args: True)
     tr = TerminalReporter(config, f)
     tr._tw.fullwidth = 10
     tr.write("hello")
     tr.rewrite("hey", erase=True)
     assert f.getvalue() == "hello" + "\r" + "hey" + (6 * " ")
示例#2
0
 def test_rewrite(self, testdir, monkeypatch):
     config = testdir.parseconfig()
     f = py.io.TextIO()
     monkeypatch.setattr(f, 'isatty', lambda *args: True)
     tr = TerminalReporter(config, f)
     tr._tw.fullwidth = 10
     tr.write('hello')
     tr.rewrite('hey', erase=True)
     assert f.getvalue() == 'hello' + '\r' + 'hey' + (6 * ' ')
示例#3
0
 def test_rewrite(self, testdir, monkeypatch):
     config = testdir.parseconfig()
     f = py.io.TextIO()
     monkeypatch.setattr(f, 'isatty', lambda *args: True)
     tr = TerminalReporter(config, f)
     tr.writer.fullwidth = 10
     tr.write('hello')
     tr.rewrite('hey', erase=True)
     assert f.getvalue() == 'hello' + '\r' + 'hey' + (7 * ' ')