diff --git a/_pytest/monkeypatch.py b/_pytest/monkeypatch.py index 0444a5404..be131bd93 100644 --- a/_pytest/monkeypatch.py +++ b/_pytest/monkeypatch.py @@ -29,7 +29,7 @@ def pytest_funcarg__monkeypatch(request): def derive_importpath(import_path): import pytest - if not isinstance(import_path, basestring) or "." not in import_path: + if not isinstance(import_path, _basestring) or "." not in import_path: raise TypeError("must be absolute import path string, not %r" % (import_path,)) rest = [] @@ -116,7 +116,7 @@ class monkeypatch: """ __tracebackhide__ = True if name is notset: - if not isinstance(target, basestring): + if not isinstance(target, _basestring): raise TypeError("use delattr(target, name) or " "delattr(target) with target being a dotted " "import string") diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py index 3f1e5b7be..01e38b88c 100644 --- a/testing/test_junitxml.py +++ b/testing/test_junitxml.py @@ -465,8 +465,9 @@ def test_escaped_parametrized_names_xml(testdir): def test_unicode_issue368(testdir): path = testdir.tmpdir.join("test.xml") log = LogXML(str(path), None) + ustr = py.builtin._totext("ВНИ!", "utf-8") class report: - longrepr = u"ВНИМАНИЕ!" + longrepr = ustr sections = [] nodeid = "something" @@ -477,9 +478,9 @@ def test_unicode_issue368(testdir): log.append_collect_failure(report) log.append_collect_skipped(report) log.append_error(report) - report.longrepr = "filename", 1, u"ВНИМАНИЕ!" + report.longrepr = "filename", 1, ustr log.append_skipped(report) - report.wasxfail = u"ВНИМАНИЕ!" + report.wasxfail = ustr log.append_skipped(report) log.pytest_sessionfinish()