Add encoding: header and fix rep mock in test_line_with_reprcrash on py27

This commit is contained in:
Bruno Oliveira 2019-05-05 09:33:37 -03:00
parent 0e8a8f94f6
commit 32a5e80a6d
2 changed files with 4 additions and 3 deletions

View File

@ -1,3 +1,4 @@
# encoding: utf-8
""" terminal reporting of the full testing process.
This is a good source for looking at the various reporting hooks.

View File

@ -1599,10 +1599,10 @@ def test_line_with_reprcrash(monkeypatch):
monkeypatch.setattr(_pytest.terminal, "_get_pos", mock_get_pos)
class config:
class config(object):
pass
class rep:
class rep(object):
def _get_verbose_word(self, *args):
return mocked_verbose_word
@ -1614,7 +1614,7 @@ def test_line_with_reprcrash(monkeypatch):
__tracebackhide__ = True
if 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
if actual != "%s %s" % (mocked_verbose_word, mocked_pos):