From: Ben Darnell Date: Sun, 21 Jan 2018 20:30:50 +0000 (-0500) Subject: Revert "Fix error in coverage runs under Py3 with a C locale" X-Git-Tag: v5.0.0~13^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1ae51677b5c0bad961835a2ee481e07d3547c6f;p=thirdparty%2Ftornado.git Revert "Fix error in coverage runs under Py3 with a C locale" This reverts commit e0c489fd02b042a74845a07dd09e8ce66a2780ca. That commit was a workaround for old versions of the coverage package. Fixes #1895 --- diff --git a/tornado/test/template_test.py b/tornado/test/template_test.py index 41c1c90c6..c19728e13 100644 --- a/tornado/test/template_test.py +++ b/tornado/test/template_test.py @@ -6,8 +6,8 @@ import traceback from tornado.escape import utf8, native_str, to_unicode from tornado.template import Template, DictLoader, ParseError, Loader -from tornado.test.util import unittest, is_coverage_running -from tornado.util import ObjectDict, unicode_type, PY3 +from tornado.test.util import unittest +from tornado.util import ObjectDict, unicode_type class TemplateTest(unittest.TestCase): @@ -175,11 +175,6 @@ try{% set y = 1/x %} self.assertEqual(template.generate(), '0') def test_non_ascii_name(self): - if PY3 and is_coverage_running(): - try: - os.fsencode(u"t\u00e9st.html") - except UnicodeEncodeError: - self.skipTest("coverage tries to access unencodable filename") loader = DictLoader({u"t\u00e9st.html": "hello"}) self.assertEqual(loader.load(u"t\u00e9st.html").generate(), b"hello") diff --git a/tornado/test/util.py b/tornado/test/util.py index 1d998f0ea..63a9762f1 100644 --- a/tornado/test/util.py +++ b/tornado/test/util.py @@ -97,24 +97,6 @@ def exec_test(caller_globals, caller_locals, s): return local_namespace -def is_coverage_running(): - """Return whether coverage is currently running. - """ - if 'coverage' not in sys.modules: - return False - tracer = sys.gettrace() - if tracer is None: - return False - try: - mod = tracer.__module__ - except AttributeError: - try: - mod = tracer.__class__.__module__ - except AttributeError: - return False - return mod.startswith('coverage') - - def subTest(test, *args, **kwargs): """Compatibility shim for unittest.TestCase.subTest.