diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_concurrency.py | 6 | ||||
-rw-r--r-- | tests/test_data.py | 4 | ||||
-rw-r--r-- | tests/test_html.py | 2 | ||||
-rw-r--r-- | tests/test_oddball.py | 2 | ||||
-rw-r--r-- | tests/test_plugins.py | 2 | ||||
-rw-r--r-- | tests/test_process.py | 6 | ||||
-rw-r--r-- | tests/test_xml.py | 6 |
7 files changed, 14 insertions, 14 deletions
diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index bcf61942..9d777afe 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -69,7 +69,7 @@ def line_count(s): def print_simple_annotation(code, linenos): """Print the lines in `code` with X for each line number in `linenos`.""" for lineno, line in enumerate(code.splitlines(), start=1): - print(" {0} {1}".format("X" if lineno in linenos else " ", line)) + print(" {} {}".format("X" if lineno in linenos else " ", line)) class LineCountTest(CoverageTest): @@ -242,7 +242,7 @@ class ConcurrencyTest(CoverageTest): # If the test fails, it's helpful to see this info: fname = abs_file("try_it.py") linenos = data.lines(fname) - print("{0}: {1}".format(len(linenos), linenos)) + print("{}: {}".format(len(linenos), linenos)) print_simple_annotation(code, linenos) lines = line_count(code) @@ -500,7 +500,7 @@ def test_thread_safe_save_data(tmpdir): # Create some Python modules and put them in the path modules_dir = tmpdir.mkdir('test_modules') - module_names = ["m{0:03d}".format(i) for i in range(1000)] + module_names = ["m{:03d}".format(i) for i in range(1000)] for module_name in module_names: modules_dir.join(module_name + ".py").write("def f(): pass\n") diff --git a/tests/test_data.py b/tests/test_data.py index ff97b330..e09aaf44 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -556,7 +556,7 @@ class CoverageDataTestInTempDir(DataTestHelpers, CoverageTest): with sqlite3.connect("wrong_schema.db") as con: con.execute("create table coverage_schema (version integer)") con.execute("insert into coverage_schema (version) values (99)") - msg = r"Couldn't .* '.*[/\\]{0}': wrong schema: 99 instead of \d+".format("wrong_schema.db") + msg = r"Couldn't .* '.*[/\\]{}': wrong schema: 99 instead of \d+".format("wrong_schema.db") with self.assertRaisesRegex(CoverageException, msg): covdata = CoverageData("wrong_schema.db") covdata.read() @@ -564,7 +564,7 @@ class CoverageDataTestInTempDir(DataTestHelpers, CoverageTest): with sqlite3.connect("no_schema.db") as con: con.execute("create table foobar (baz text)") - msg = r"Couldn't .* '.*[/\\]{0}': \S+".format("no_schema.db") + msg = r"Couldn't .* '.*[/\\]{}': \S+".format("no_schema.db") with self.assertRaisesRegex(CoverageException, msg): covdata = CoverageData("no_schema.db") covdata.read() diff --git a/tests/test_html.py b/tests/test_html.py index 3e567113..d30279a5 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -87,7 +87,7 @@ class HtmlTestHelpers(CoverageTest): self.assert_recent_datetime( timestamp, seconds=120, - msg="Timestamp is wrong: {0}".format(timestamp), + msg="Timestamp is wrong: {}".format(timestamp), ) diff --git a/tests/test_oddball.py b/tests/test_oddball.py index 1087ea57..3574806c 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -541,7 +541,7 @@ class ExecTest(CoverageTest): # but now it's fixed. :) self.make_file("to_exec.py", """\ \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n - print("var is {0}".format(var)) # line 31 + print("var is {}".format(var)) # line 31 """) self.make_file("main.py", """\ namespace = {'var': 17} diff --git a/tests/test_plugins.py b/tests/test_plugins.py index a4c7a5ee..416f05a2 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -321,7 +321,7 @@ class GoodFileTracerTest(FileTracerTest): # will examine the `filename` and `linenum` locals to # determine the source file and line number. fiddle_around = 1 # not used, just chaff. - return "[{0} @ {1}]".format(filename, linenum) + return "[{} @ {}]".format(filename, linenum) def helper(x): # This function is here just to show that not all code in diff --git a/tests/test_process.py b/tests/test_process.py index 000330ad..be7ae446 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -164,7 +164,7 @@ class ProcessTest(CoverageTest): self.assertEqual(status, 1) for n in "12": - self.assert_exists(".coverage.bad{0}".format(n)) + self.assert_exists(".coverage.bad{}".format(n)) warning_regex = ( r"(" # JSON message: r"Coverage.py warning: Couldn't read data from '.*\.coverage\.bad{0}': " @@ -1345,7 +1345,7 @@ def possible_pth_dirs(): def find_writable_pth_directory(): """Find a place to write a .pth file.""" for pth_dir in possible_pth_dirs(): # pragma: part covered - try_it = os.path.join(pth_dir, "touch_{0}.it".format(WORKER)) + try_it = os.path.join(pth_dir, "touch_{}.it".format(WORKER)) with open(try_it, "w") as f: try: f.write("foo") @@ -1370,7 +1370,7 @@ class ProcessCoverageMixin(object): # Create the .pth file. self.assertTrue(PTH_DIR) pth_contents = "import coverage; coverage.process_startup()\n" - pth_path = os.path.join(PTH_DIR, "subcover_{0}.pth".format(WORKER)) + pth_path = os.path.join(PTH_DIR, "subcover_{}.pth".format(WORKER)) with open(pth_path, "w") as pth: pth.write(pth_contents) self.pth_path = pth_path diff --git a/tests/test_xml.py b/tests/test_xml.py index 09ab2f85..658a6ab6 100644 --- a/tests/test_xml.py +++ b/tests/test_xml.py @@ -51,13 +51,13 @@ class XmlTestHelpers(CoverageTest): return os.path.join(curdir, p) for i in range(width): - next_dir = here("d{0}".format(i)) + next_dir = here("d{}".format(i)) self.make_tree(width, depth-1, next_dir) if curdir != ".": self.make_file(here("__init__.py"), "") for i in range(width): - filename = here("f{0}.py".format(i)) - self.make_file(filename, "# {0}\n".format(filename)) + filename = here("f{}.py".format(i)) + self.make_file(filename, "# {}\n".format(filename)) def assert_source(self, xmldom, src): """Assert that the XML has a <source> element with `src`.""" |