fix tests on py32/py33
This commit is contained in:
parent
cf9d345382
commit
75328b66e6
|
@ -29,7 +29,7 @@ def pytest_funcarg__monkeypatch(request):
|
||||||
|
|
||||||
def derive_importpath(import_path):
|
def derive_importpath(import_path):
|
||||||
import pytest
|
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" %
|
raise TypeError("must be absolute import path string, not %r" %
|
||||||
(import_path,))
|
(import_path,))
|
||||||
rest = []
|
rest = []
|
||||||
|
@ -116,7 +116,7 @@ class monkeypatch:
|
||||||
"""
|
"""
|
||||||
__tracebackhide__ = True
|
__tracebackhide__ = True
|
||||||
if name is notset:
|
if name is notset:
|
||||||
if not isinstance(target, basestring):
|
if not isinstance(target, _basestring):
|
||||||
raise TypeError("use delattr(target, name) or "
|
raise TypeError("use delattr(target, name) or "
|
||||||
"delattr(target) with target being a dotted "
|
"delattr(target) with target being a dotted "
|
||||||
"import string")
|
"import string")
|
||||||
|
|
|
@ -465,8 +465,9 @@ def test_escaped_parametrized_names_xml(testdir):
|
||||||
def test_unicode_issue368(testdir):
|
def test_unicode_issue368(testdir):
|
||||||
path = testdir.tmpdir.join("test.xml")
|
path = testdir.tmpdir.join("test.xml")
|
||||||
log = LogXML(str(path), None)
|
log = LogXML(str(path), None)
|
||||||
|
ustr = py.builtin._totext("ВНИ!", "utf-8")
|
||||||
class report:
|
class report:
|
||||||
longrepr = u"ВНИМАНИЕ!"
|
longrepr = ustr
|
||||||
sections = []
|
sections = []
|
||||||
nodeid = "something"
|
nodeid = "something"
|
||||||
|
|
||||||
|
@ -477,9 +478,9 @@ def test_unicode_issue368(testdir):
|
||||||
log.append_collect_failure(report)
|
log.append_collect_failure(report)
|
||||||
log.append_collect_skipped(report)
|
log.append_collect_skipped(report)
|
||||||
log.append_error(report)
|
log.append_error(report)
|
||||||
report.longrepr = "filename", 1, u"ВНИМАНИЕ!"
|
report.longrepr = "filename", 1, ustr
|
||||||
log.append_skipped(report)
|
log.append_skipped(report)
|
||||||
report.wasxfail = u"ВНИМАНИЕ!"
|
report.wasxfail = ustr
|
||||||
log.append_skipped(report)
|
log.append_skipped(report)
|
||||||
log.pytest_sessionfinish()
|
log.pytest_sessionfinish()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue