diff options
Diffstat (limited to 'tests/scanner')
-rw-r--r-- | tests/scanner/annotationparser/test_parser.py | 15 | ||||
-rw-r--r-- | tests/scanner/annotationparser/test_patterns.py | 15 | ||||
-rw-r--r-- | tests/scanner/test_pkgconfig.py | 9 | ||||
-rw-r--r-- | tests/scanner/test_shlibs.py | 5 | ||||
-rw-r--r-- | tests/scanner/test_sourcescanner.py | 5 | ||||
-rw-r--r-- | tests/scanner/test_transformer.py | 5 |
6 files changed, 5 insertions, 49 deletions
diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py index b676a508..368eb728 100644 --- a/tests/scanner/annotationparser/test_parser.py +++ b/tests/scanner/annotationparser/test_parser.py @@ -25,14 +25,8 @@ test_parser.py Tests ensuring annotationparser.py continues to function correctly. ''' -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import difflib import os -import sys import subprocess import unittest import xml.etree.ElementTree as etree @@ -41,11 +35,6 @@ from giscanner.annotationparser import GtkDocCommentBlockParser, GtkDocCommentBl from giscanner.ast import Namespace from giscanner.message import MessageLogger, WARNING, ERROR, FATAL -if sys.version_info.major < 3: - encode_name = lambda s: s.encode('ascii') -else: - encode_name = lambda s: s - XML_NS = 'http://schemas.gnome.org/gobject-introspection/2013/test' XML_SCHEMA = os.path.abspath(os.path.join(os.path.dirname(__file__), 'tests.xsd')) @@ -406,7 +395,7 @@ def create_test_case(logger, tests_dir, tests_file): for counter, test in enumerate(tests_tree.findall(ns('{}test'))): test_name = 'test_%03d' % (counter + 1) test_method = TestCommentBlock.__create_test__(logger, test) - test_method.__name__ = encode_name(test_name) + test_method.__name__ = test_name test_methods[test_name] = test_method # Dynamically generate a new subclass of TestCommentBlock in TitleCase @@ -414,7 +403,7 @@ def create_test_case(logger, tests_dir, tests_file): test_class_name = os.path.relpath(tests_file[:-4], tests_dir) test_class_name = test_class_name.replace('/', ' ').replace('\\', ' ').replace('.', ' ') test_class_name = 'Test' + test_class_name.title().replace(' ', '') - return type(encode_name(test_class_name), (TestCommentBlock,), test_methods) + return type(test_class_name, (TestCommentBlock,), test_methods) def create_test_cases(): diff --git a/tests/scanner/annotationparser/test_patterns.py b/tests/scanner/annotationparser/test_patterns.py index 0a0e3175..131d6282 100644 --- a/tests/scanner/annotationparser/test_patterns.py +++ b/tests/scanner/annotationparser/test_patterns.py @@ -29,12 +29,6 @@ should match, resulting symbolic groups are verified against the expected output. ''' -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - -import sys import unittest from giscanner.annotationparser import (COMMENT_BLOCK_START_RE, COMMENT_BLOCK_END_RE, @@ -43,11 +37,6 @@ from giscanner.annotationparser import (COMMENT_BLOCK_START_RE, COMMENT_BLOCK_EN SIGNAL_RE, PARAMETER_RE, TAG_RE, TAG_VALUE_VERSION_RE, TAG_VALUE_STABILITY_RE) -if sys.version_info.major < 3: - encode_name = lambda s: s.encode('ascii') -else: - encode_name = lambda s: s - comment_start_tests = [ (COMMENT_BLOCK_START_RE, '/**', @@ -902,10 +891,10 @@ def create_test_case(tests_class_name, testcases): for counter, test in enumerate(testcases): test_name = 'test_%03d' % (counter + 1) test_method = create_test_method(test) - test_method.__name__ = encode_name(test_name) + test_method.__name__ = test_name test_methods[test_name] = test_method - return type(encode_name(tests_class_name), (unittest.TestCase,), test_methods) + return type(tests_class_name, (unittest.TestCase,), test_methods) def create_test_cases(): diff --git a/tests/scanner/test_pkgconfig.py b/tests/scanner/test_pkgconfig.py index e81dedb6..8b654e38 100644 --- a/tests/scanner/test_pkgconfig.py +++ b/tests/scanner/test_pkgconfig.py @@ -18,11 +18,6 @@ # Boston, MA 02111-1307, USA. # -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import contextlib import os import sys @@ -88,9 +83,7 @@ class PkgConfigTest(unittest.TestCase): with pkg_config_script(s) as command: pkgconfig.libs(['a', 'b-42.0'], command=command) - @unittest.skipIf( - sys.version_info < (3, 0) or os.name == "nt", - "Python 2 defaults to ascii encoding in text file I/O and nothing is done to change that") + @unittest.skipIf(os.name == "nt", "FIXME") def test_non_ascii_output(self): with pkg_config_script("""print("-L'zażółć gęślą jaźń'")""") as command: flags = pkgconfig.cflags(['test-1.0'], command=command) diff --git a/tests/scanner/test_shlibs.py b/tests/scanner/test_shlibs.py index c3e28892..f3fb0d2e 100644 --- a/tests/scanner/test_shlibs.py +++ b/tests/scanner/test_shlibs.py @@ -1,8 +1,3 @@ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import unittest from giscanner.shlibs import resolve_from_ldd_output diff --git a/tests/scanner/test_sourcescanner.py b/tests/scanner/test_sourcescanner.py index 831af486..3963683d 100644 --- a/tests/scanner/test_sourcescanner.py +++ b/tests/scanner/test_sourcescanner.py @@ -1,8 +1,3 @@ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import unittest import tempfile import os diff --git a/tests/scanner/test_transformer.py b/tests/scanner/test_transformer.py index c0fb2d6f..27bfad58 100644 --- a/tests/scanner/test_transformer.py +++ b/tests/scanner/test_transformer.py @@ -1,8 +1,3 @@ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function -from __future__ import unicode_literals - import unittest import tempfile import os |