diff options
Diffstat (limited to 'tests/test_domain_cpp.py')
-rw-r--r-- | tests/test_domain_cpp.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py index f059b32e5..c45ed367d 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ test_domain_cpp ~~~~~~~~~~~~~~~ @@ -13,7 +12,6 @@ import re import sys import pytest -from six import text_type import sphinx.domains.cpp as cppDomain from sphinx import addnodes @@ -22,7 +20,7 @@ from sphinx.domains.cpp import Symbol, _max_id, _id_prefix def parse(name, string): - class Config(object): + class Config: cpp_id_attributes = ["id_attr"] cpp_paren_attributes = ["paren_attr"] parser = DefinitionParser(string, None, Config()) @@ -40,10 +38,10 @@ def check(name, input, idDict, output=None): if output is None: output = input ast = parse(name, input) - res = text_type(ast) + res = str(ast) if res != output: print("") - print("Input: ", text_type(input)) + print("Input: ", input) print("Result: ", res) print("Expected: ", output) raise DefinitionError("") @@ -74,19 +72,19 @@ def check(name, input, idDict, output=None): res.append(idExpected[i] == idActual[i]) if not all(res): - print("input: %s" % text_type(input).rjust(20)) + print("input: %s" % input.rjust(20)) for i in range(1, _max_id + 1): if res[i]: continue print("Error in id version %d." % i) - print("result: %s" % str(idActual[i])) - print("expected: %s" % str(idExpected[i])) + print("result: %s" % idActual[i]) + print("expected: %s" % idExpected[i]) print(rootSymbol.dump(0)) raise DefinitionError("") def test_fundamental_types(): - # see http://en.cppreference.com/w/cpp/language/types + # see https://en.cppreference.com/w/cpp/language/types for t, id_v2 in cppDomain._id_fundamental_v2.items(): def makeIdV1(): if t == 'decltype(auto)': @@ -816,7 +814,7 @@ not found in `{test}` assert result, expect return set(result.group('classes').split()) - class RoleClasses(object): + class RoleClasses: """Collect the classes from the layout that was generated for a given role.""" def __init__(self, role, root, contents): |