Skip to content

Commit 424756d

Browse files
committed
chore(tests): field numbering not required since python 3.1
1 parent 2f1b3a3 commit 424756d

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

testing/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def make_default_config(project):
5353
"exhale_args": {
5454
# required arguments
5555
"containmentFolder": "./api",
56-
"rootFileName": "{0}_root.rst".format(project),
57-
"rootFileTitle": "``{0}`` Test Project".format(project),
56+
"rootFileName": "{}_root.rst".format(project),
57+
"rootFileTitle": "``{}`` Test Project".format(project),
5858
"doxygenStripFromPath": "..",
5959
# additional arguments
6060
"exhaleExecutesDoxygen": True,
@@ -100,7 +100,7 @@ def __new__(mcs, name, bases, attrs): # noqa: N804
100100
)
101101
if not isinstance(test_project, six.string_types):
102102
raise RuntimeError(
103-
"'test_project' in class {0} must be a string!".format(name)
103+
"'test_project' in class {} must be a string!".format(name)
104104
)
105105

106106
# looking for test methods ("test_*")
@@ -154,7 +154,7 @@ def _rootdir(self, app_params):
154154
testroot = os.path.join(
155155
TEST_PROJECTS_ROOT,
156156
self.test_project,
157-
"docs_{0}_{1}".format(self.__class__.__name__, self._testMethodName)
157+
"docs_{}_{}".format(self.__class__.__name__, self._testMethodName)
158158
)
159159
if os.path.isdir(testroot):
160160
shutil.rmtree(testroot)
@@ -442,7 +442,7 @@ def checkRequiredConfigs(self):
442442
# validate that the title was included
443443
with open(os.path.join(containmentFolder, rootFileName), "r") as root:
444444
root_contents = root.read()
445-
root_heading = "{0}\n{1}".format(
445+
root_heading = "{}\n{}".format(
446446
rootFileTitle,
447447
exhale.utils.heading_mark(rootFileTitle, exhale.configs.SECTION_HEADING_CHAR)
448448
)

testing/hierarchies.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def toConsole(self, level):
115115
``level`` (:class:`python:int`)
116116
The recursion level, used as ``" " * level`` to indent children.
117117
"""
118-
print("{0}{1}".format(" " * level, self))
118+
print("{}{}".format(" " * level, self))
119119
for child in self.children:
120120
child.toConsole(level + 1)
121121

@@ -554,7 +554,7 @@ def _reparent_all(self):
554554
self.unions.remove(u)
555555

556556
def _track_node(self, node):
557-
lst_name = "Mapping from node.kind={0} to internal list not found.".format(node.kind)
557+
lst_name = "Mapping from node.kind={} to internal list not found.".format(node.kind)
558558
kind = node.kind
559559
if kind in ["class", "struct"]:
560560
lst_name = "class_like"
@@ -580,7 +580,7 @@ def _track_node(self, node):
580580
lst_name = "variables"
581581

582582
if lst_name not in self.__dict__.keys():
583-
raise ValueError("Invalid internal list name: {0}".format(lst_name))
583+
raise ValueError("Invalid internal list name: {}".format(lst_name))
584584

585585
if node not in self.__dict__[lst_name]:
586586
self.__dict__[lst_name].append(node)
@@ -594,14 +594,14 @@ def _visit_children(self, parent, child_spec):
594594
if isinstance(parent, function):
595595
if not isinstance(child_spec, parameters):
596596
raise ValueError(
597-
"Specification of 'function' [{0}] must be of type 'parameters'".format(parent.name)
597+
"Specification of 'function' [{}] must be of type 'parameters'".format(parent.name)
598598
)
599599
else:
600600
parent.setParameters(child_spec)
601601
return
602602
else:
603603
raise ValueError(
604-
"Specification of '{0}' [{1}] must be a dictionary.".format(parent.kind, parent.name)
604+
"Specification of '{}' [{}] must be a dictionary.".format(parent.kind, parent.name)
605605
)
606606

607607
for child in child_spec:
@@ -653,7 +653,7 @@ def _visit_children(self, parent, child_spec):
653653
child.name = os.path.join(parent.name, child.name)
654654
# simulate how Doxygen will present fully qualified names
655655
if parent.kind in ["class", "struct", "namespace"]:
656-
child.name = "{0}::{1}".format(parent.name, child.name)
656+
child.name = "{}::{}".format(parent.name, child.name)
657657
if self.hierarchy_type == "file":
658658
child.def_in_file = parent.def_in_file
659659
if child.kind == "namespace":
@@ -1185,7 +1185,7 @@ def compare_class_hierarchy(test, test_root):
11851185
if exhale_obj is None:
11861186
test.assertTrue(
11871187
False,
1188-
msg="Did not find match for [{0}] {1}".format(test_obj.kind, test_obj.name)
1188+
msg="Did not find match for [{}] {}".format(test_obj.kind, test_obj.name)
11891189
)
11901190

11911191
_compare_children("class", test, test_obj, exhale_obj)
@@ -1240,7 +1240,7 @@ def compare_file_hierarchy(test, test_root):
12401240
break
12411241

12421242
if exhale_obj is None:
1243-
raise RuntimeError("Did not find match for [{0}] {1}".format(
1243+
raise RuntimeError("Did not find match for [{}] {}".format(
12441244
test_obj.kind, test_obj.name
12451245
))
12461246
_compare_children("file", test, test_obj, exhale_obj)
@@ -1321,10 +1321,10 @@ def set_error_string(s):
13211321
"Function overload group [{group}]:\nTest:\n{test_ids}\n\nExhale:\n{exhale_ids}\n".format(
13221322
group=key,
13231323
test_ids="".join(
1324-
"\n - {0}".format(f.full_signature()) for f in test_overloads[key]
1324+
"\n - {}".format(f.full_signature()) for f in test_overloads[key]
13251325
),
13261326
exhale_ids="".join(
1327-
"\n - {0}".format(f.full_signature()) for f in exhale_overloads[key]
1327+
"\n - {}".format(f.full_signature()) for f in exhale_overloads[key]
13281328
)
13291329
)
13301330
)

testing/tests/configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_treeview_mismatch(self):
170170
expected = "Exhale: `treeViewIsBootstrap=True` ignored since `createTreeView=False`"
171171
self.assertTrue(
172172
expected in sphinx_warnings,
173-
"Sphinx Warnings did not contain '{0}'.".format(expected)
173+
"Sphinx Warnings did not contain '{}'.".format(expected)
174174
)
175175

176176

testing/tests/configs_tree_view.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ def line_compare(self, expected_list, test_list):
160160

161161
self.assertTrue(
162162
len(mismatches) == 0,
163-
"Mismatches in line_compare:\n\n{0}".format(
163+
"Mismatches in line_compare:\n\n{}".format(
164164
"\n".join(
165-
"- expected: '{0}'\n got: '{1}'".format(*item)
165+
"- expected: '{}'\n got: '{}'".format(*item)
166166
for item in mismatches
167167
)
168168
)

testing/tests/cpp_fortran_mixed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def validate_pygments_lexers(self, exhale_root, node_map):
108108
lexer = lexer_match.groups()[0]
109109
self.assertTrue(
110110
lexer == expected_lexer,
111-
"{0}: expected '{1}' but got '{2}' language lexer.".format(
111+
"{}: expected '{}' but got '{}' language lexer.".format(
112112
file_node.location, expected_lexer, lexer
113113
)
114114
)
@@ -118,7 +118,7 @@ def validate_pygments_lexers(self, exhale_root, node_map):
118118
# Make sure we actually ran a check for this file.
119119
self.assertTrue(
120120
lexer_was_asserted,
121-
"Did not find '.. code-block:: xxxx' in [{0}]".format(program_listing_file_path)
121+
"Did not find '.. code-block:: xxxx' in [{}]".format(program_listing_file_path)
122122
)
123123

124124
def get_hpp_and_f90_nodes(self, exhale_root):

testing/tests/cpp_long_names.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def create_absurd_directory_structure():
6262
'''))
6363
except Exception as e:
6464
raise RuntimeError(
65-
"Could not make the absurd directory structure: {0}".format(e)
65+
"Could not make the absurd directory structure: {}".format(e)
6666
)
6767

6868

@@ -83,7 +83,7 @@ def remove_absurd_directory_structure():
8383
if os.path.isdir(absurd_dir_root):
8484
shutil.rmtree(absurd_dir_root)
8585
except Exception as e:
86-
raise RuntimeError("Could not remove the directory [{0}]: {1}".format(
86+
raise RuntimeError("Could not remove the directory [{}]: {}".format(
8787
absurd_dir_root, e
8888
))
8989

0 commit comments

Comments
 (0)