diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_git_command.py | 7 | ||||
-rw-r--r-- | tests/test_git_config.py | 2 | ||||
-rw-r--r-- | tests/test_git_superproject.py | 2 | ||||
-rw-r--r-- | tests/test_git_trace2_event_log.py | 2 | ||||
-rw-r--r-- | tests/test_manifest_xml.py | 6 | ||||
-rw-r--r-- | tests/test_project.py | 2 |
6 files changed, 8 insertions, 13 deletions
diff --git a/tests/test_git_command.py b/tests/test_git_command.py index 7c108ccd..ffee023b 100644 --- a/tests/test_git_command.py +++ b/tests/test_git_command.py | |||
@@ -19,12 +19,7 @@ import os | |||
19 | import re | 19 | import re |
20 | import subprocess | 20 | import subprocess |
21 | import unittest | 21 | import unittest |
22 | 22 | from unittest import mock | |
23 | |||
24 | try: | ||
25 | from unittest import mock | ||
26 | except ImportError: | ||
27 | import mock | ||
28 | 23 | ||
29 | import git_command | 24 | import git_command |
30 | import wrapper | 25 | import wrapper |
diff --git a/tests/test_git_config.py b/tests/test_git_config.py index a44dca0f..cf6e7793 100644 --- a/tests/test_git_config.py +++ b/tests/test_git_config.py | |||
@@ -100,7 +100,7 @@ class GitConfigReadOnlyTests(unittest.TestCase): | |||
100 | ("intg", 10737418240), | 100 | ("intg", 10737418240), |
101 | ) | 101 | ) |
102 | for key, value in TESTS: | 102 | for key, value in TESTS: |
103 | self.assertEqual(value, self.config.GetInt("section.%s" % (key,))) | 103 | self.assertEqual(value, self.config.GetInt(f"section.{key}")) |
104 | 104 | ||
105 | 105 | ||
106 | class GitConfigReadWriteTests(unittest.TestCase): | 106 | class GitConfigReadWriteTests(unittest.TestCase): |
diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py index 478ebca7..4e66521b 100644 --- a/tests/test_git_superproject.py +++ b/tests/test_git_superproject.py | |||
@@ -34,7 +34,7 @@ class SuperprojectTestCase(unittest.TestCase): | |||
34 | PARENT_SID_KEY = "GIT_TRACE2_PARENT_SID" | 34 | PARENT_SID_KEY = "GIT_TRACE2_PARENT_SID" |
35 | PARENT_SID_VALUE = "parent_sid" | 35 | PARENT_SID_VALUE = "parent_sid" |
36 | SELF_SID_REGEX = r"repo-\d+T\d+Z-.*" | 36 | SELF_SID_REGEX = r"repo-\d+T\d+Z-.*" |
37 | FULL_SID_REGEX = r"^%s/%s" % (PARENT_SID_VALUE, SELF_SID_REGEX) | 37 | FULL_SID_REGEX = rf"^{PARENT_SID_VALUE}/{SELF_SID_REGEX}" |
38 | 38 | ||
39 | def setUp(self): | 39 | def setUp(self): |
40 | """Set up superproject every time.""" | 40 | """Set up superproject every time.""" |
diff --git a/tests/test_git_trace2_event_log.py b/tests/test_git_trace2_event_log.py index d8e963dd..4658a793 100644 --- a/tests/test_git_trace2_event_log.py +++ b/tests/test_git_trace2_event_log.py | |||
@@ -61,7 +61,7 @@ class EventLogTestCase(unittest.TestCase): | |||
61 | PARENT_SID_KEY = "GIT_TRACE2_PARENT_SID" | 61 | PARENT_SID_KEY = "GIT_TRACE2_PARENT_SID" |
62 | PARENT_SID_VALUE = "parent_sid" | 62 | PARENT_SID_VALUE = "parent_sid" |
63 | SELF_SID_REGEX = r"repo-\d+T\d+Z-.*" | 63 | SELF_SID_REGEX = r"repo-\d+T\d+Z-.*" |
64 | FULL_SID_REGEX = r"^%s/%s" % (PARENT_SID_VALUE, SELF_SID_REGEX) | 64 | FULL_SID_REGEX = rf"^{PARENT_SID_VALUE}/{SELF_SID_REGEX}" |
65 | 65 | ||
66 | def setUp(self): | 66 | def setUp(self): |
67 | """Load the event_log module every time.""" | 67 | """Load the event_log module every time.""" |
diff --git a/tests/test_manifest_xml.py b/tests/test_manifest_xml.py index bd255dcc..3fcf09fa 100644 --- a/tests/test_manifest_xml.py +++ b/tests/test_manifest_xml.py | |||
@@ -198,13 +198,13 @@ class ValueTests(unittest.TestCase): | |||
198 | def test_bool_true(self): | 198 | def test_bool_true(self): |
199 | """Check XmlBool true values.""" | 199 | """Check XmlBool true values.""" |
200 | for value in ("yes", "true", "1"): | 200 | for value in ("yes", "true", "1"): |
201 | node = self._get_node('<node a="%s"/>' % (value,)) | 201 | node = self._get_node(f'<node a="{value}"/>') |
202 | self.assertTrue(manifest_xml.XmlBool(node, "a")) | 202 | self.assertTrue(manifest_xml.XmlBool(node, "a")) |
203 | 203 | ||
204 | def test_bool_false(self): | 204 | def test_bool_false(self): |
205 | """Check XmlBool false values.""" | 205 | """Check XmlBool false values.""" |
206 | for value in ("no", "false", "0"): | 206 | for value in ("no", "false", "0"): |
207 | node = self._get_node('<node a="%s"/>' % (value,)) | 207 | node = self._get_node(f'<node a="{value}"/>') |
208 | self.assertFalse(manifest_xml.XmlBool(node, "a")) | 208 | self.assertFalse(manifest_xml.XmlBool(node, "a")) |
209 | 209 | ||
210 | def test_int_default(self): | 210 | def test_int_default(self): |
@@ -220,7 +220,7 @@ class ValueTests(unittest.TestCase): | |||
220 | def test_int_good(self): | 220 | def test_int_good(self): |
221 | """Check XmlInt numeric handling.""" | 221 | """Check XmlInt numeric handling.""" |
222 | for value in (-1, 0, 1, 50000): | 222 | for value in (-1, 0, 1, 50000): |
223 | node = self._get_node('<node a="%s"/>' % (value,)) | 223 | node = self._get_node(f'<node a="{value}"/>') |
224 | self.assertEqual(value, manifest_xml.XmlInt(node, "a")) | 224 | self.assertEqual(value, manifest_xml.XmlInt(node, "a")) |
225 | 225 | ||
226 | def test_int_invalid(self): | 226 | def test_int_invalid(self): |
diff --git a/tests/test_project.py b/tests/test_project.py index 83cfe0a4..6dc071bd 100644 --- a/tests/test_project.py +++ b/tests/test_project.py | |||
@@ -151,7 +151,7 @@ class CopyLinkTestCase(unittest.TestCase): | |||
151 | # "". | 151 | # "". |
152 | break | 152 | break |
153 | result = os.path.exists(path) | 153 | result = os.path.exists(path) |
154 | msg.append("\tos.path.exists(%s): %s" % (path, result)) | 154 | msg.append(f"\tos.path.exists({path}): {result}") |
155 | if result: | 155 | if result: |
156 | msg.append("\tcontents: %r" % os.listdir(path)) | 156 | msg.append("\tcontents: %r" % os.listdir(path)) |
157 | break | 157 | break |