Add encoding: header and fix rep mock in test_line_with_reprcrash on py27
This commit is contained in:
parent
0e8a8f94f6
commit
32a5e80a6d
|
@ -1,3 +1,4 @@
|
||||||
|
# encoding: utf-8
|
||||||
""" terminal reporting of the full testing process.
|
""" terminal reporting of the full testing process.
|
||||||
|
|
||||||
This is a good source for looking at the various reporting hooks.
|
This is a good source for looking at the various reporting hooks.
|
||||||
|
|
|
@ -1599,10 +1599,10 @@ def test_line_with_reprcrash(monkeypatch):
|
||||||
|
|
||||||
monkeypatch.setattr(_pytest.terminal, "_get_pos", mock_get_pos)
|
monkeypatch.setattr(_pytest.terminal, "_get_pos", mock_get_pos)
|
||||||
|
|
||||||
class config:
|
class config(object):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class rep:
|
class rep(object):
|
||||||
def _get_verbose_word(self, *args):
|
def _get_verbose_word(self, *args):
|
||||||
return mocked_verbose_word
|
return mocked_verbose_word
|
||||||
|
|
||||||
|
@ -1614,7 +1614,7 @@ def test_line_with_reprcrash(monkeypatch):
|
||||||
__tracebackhide__ = True
|
__tracebackhide__ = True
|
||||||
if msg:
|
if msg:
|
||||||
rep.longrepr.reprcrash.message = msg
|
rep.longrepr.reprcrash.message = msg
|
||||||
actual = _get_line_with_reprcrash_message(config, rep, width)
|
actual = _get_line_with_reprcrash_message(config, rep(), width)
|
||||||
|
|
||||||
assert actual == expected
|
assert actual == expected
|
||||||
if actual != "%s %s" % (mocked_verbose_word, mocked_pos):
|
if actual != "%s %s" % (mocked_verbose_word, mocked_pos):
|
||||||
|
|
Loading…
Reference in New Issue