Move TWMock class to a fixture
Using a relative import like before was not very nice
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
from test_excinfo import TWMock
|
||||
|
||||
import _pytest._code
|
||||
import pytest
|
||||
|
||||
@@ -168,17 +166,15 @@ class TestTracebackEntry:
|
||||
|
||||
|
||||
class TestReprFuncArgs:
|
||||
def test_not_raise_exception_with_mixed_encoding(self):
|
||||
def test_not_raise_exception_with_mixed_encoding(self, tw_mock):
|
||||
from _pytest._code.code import ReprFuncArgs
|
||||
|
||||
tw = TWMock()
|
||||
|
||||
args = [("unicode_string", "São Paulo"), ("utf8_string", b"S\xc3\xa3o Paulo")]
|
||||
|
||||
r = ReprFuncArgs(args)
|
||||
r.toterminal(tw)
|
||||
r.toterminal(tw_mock)
|
||||
|
||||
assert (
|
||||
tw.lines[0]
|
||||
tw_mock.lines[0]
|
||||
== r"unicode_string = São Paulo, utf8_string = b'S\xc3\xa3o Paulo'"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user