summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-05-01 08:16:06 -0400
committerNed Batchelder <ned@nedbatchelder.com>2022-05-01 13:00:38 -0400
commit420c01394a31415d7a7cbb80be196bcfca48482c (patch)
treed71672faede9de984c024eadc678ae05ff5af558
parent53f00a00b7cfb5e856136ea600844160746d6ae2 (diff)
downloadpython-coveragepy-git-420c01394a31415d7a7cbb80be196bcfca48482c.tar.gz
style: parens should indent the same as their opening line
-rw-r--r--ci/comment_on_fixes.py2
-rw-r--r--coverage/cmdline.py24
-rw-r--r--coverage/config.py2
-rw-r--r--coverage/control.py12
-rw-r--r--coverage/debug.py2
-rw-r--r--coverage/html.py6
-rw-r--r--coverage/inorout.py2
-rw-r--r--coverage/jsonreport.py2
-rw-r--r--coverage/misc.py2
-rw-r--r--coverage/parser.py6
-rw-r--r--coverage/phystokens.py2
-rw-r--r--coverage/python.py4
-rw-r--r--coverage/results.py4
-rw-r--r--coverage/sqldata.py6
-rw-r--r--coverage/summary.py4
-rw-r--r--coverage/xmlreport.py4
-rw-r--r--doc/conf.py2
-rw-r--r--lab/goals.py2
-rw-r--r--lab/hack_pyc.py2
-rw-r--r--lab/parser.py8
-rw-r--r--lab/run_trace.py2
-rw-r--r--tests/conftest.py4
-rw-r--r--tests/helpers.py4
-rw-r--r--tests/test_annotate.py2
-rw-r--r--tests/test_api.py4
-rw-r--r--tests/test_arcs.py32
-rw-r--r--tests/test_cmdline.py12
-rw-r--r--tests/test_coverage.py14
-rw-r--r--tests/test_data.py2
-rw-r--r--tests/test_files.py4
-rw-r--r--tests/test_html.py8
-rw-r--r--tests/test_json.py18
-rw-r--r--tests/test_numbits.py2
-rw-r--r--tests/test_oddball.py12
-rw-r--r--tests/test_parser.py10
-rw-r--r--tests/test_plugins.py10
-rw-r--r--tests/test_process.py4
-rw-r--r--tests/test_results.py6
-rw-r--r--tests/test_setup.py2
-rw-r--r--tests/test_summary.py2
-rw-r--r--tests/test_templite.py46
-rw-r--r--tests/test_venv.py18
-rw-r--r--tests/test_xml.py14
43 files changed, 164 insertions, 166 deletions
diff --git a/ci/comment_on_fixes.py b/ci/comment_on_fixes.py
index f36cba93..b0f469b1 100644
--- a/ci/comment_on_fixes.py
+++ b/ci/comment_on_fixes.py
@@ -13,7 +13,7 @@ version = latest["version"]
comment = (
f"This is now released as part of [coverage {version}]" +
f"(https://pypi.org/project/coverage/{version})."
- )
+)
print(f"Comment will be: {comment}")
owner = "nedbat"
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 0c44378a..dbf66e0a 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -232,9 +232,7 @@ class CoverageOptionParser(optparse.OptionParser):
"""
def __init__(self, *args, **kwargs):
- super().__init__(
- add_help_option=False, *args, **kwargs
- )
+ super().__init__(add_help_option=False, *args, **kwargs)
self.set_defaults(
# Keep these arguments alphabetized by their names.
action=None,
@@ -267,7 +265,7 @@ class CoverageOptionParser(optparse.OptionParser):
timid=None,
title=None,
version=None,
- )
+ )
self.disable_interspersed_args()
@@ -352,7 +350,7 @@ GLOBAL_ARGS = [
Opts.debug,
Opts.help,
Opts.rcfile,
- ]
+]
COMMANDS = {
'annotate': CmdOptionParser(
@@ -473,7 +471,7 @@ COMMANDS = {
Opts.output_lcov,
Opts.omit,
Opts.quiet,
- ] + GLOBAL_ARGS,
+ ] + GLOBAL_ARGS,
usage="[options] [modules]",
description="Generate an LCOV report of coverage results.",
),
@@ -648,7 +646,7 @@ class CoverageScript:
check_preimported=True,
context=options.context,
messages=not options.quiet,
- )
+ )
if options.action == "debug":
return self.do_debug(args)
@@ -675,7 +673,7 @@ class CoverageScript:
omit=omit,
include=include,
contexts=contexts,
- )
+ )
# We need to be able to import from the current directory, because
# plugins may try to, for example, to read Django settings.
@@ -692,7 +690,7 @@ class CoverageScript:
skip_empty=options.skip_empty,
sort=options.sort,
**report_args
- )
+ )
elif options.action == "annotate":
self.coverage.annotate(directory=options.directory, **report_args)
elif options.action == "html":
@@ -704,25 +702,25 @@ class CoverageScript:
show_contexts=options.show_contexts,
title=options.title,
**report_args
- )
+ )
elif options.action == "xml":
total = self.coverage.xml_report(
outfile=options.outfile,
skip_empty=options.skip_empty,
**report_args
- )
+ )
elif options.action == "json":
total = self.coverage.json_report(
outfile=options.outfile,
pretty_print=options.pretty_print,
show_contexts=options.show_contexts,
**report_args
- )
+ )
elif options.action == "lcov":
total = self.coverage.lcov_report(
outfile=options.outfile,
**report_args
- )
+ )
else:
# There are no other possible actions.
raise AssertionError
diff --git a/coverage/config.py b/coverage/config.py
index fbfb59f4..1571c017 100644
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -499,7 +499,7 @@ class CoverageConfig:
"""Make a list of (name, value) pairs for writing debug info."""
return human_sorted_items(
(k, v) for k, v in self.__dict__.items() if not k.startswith("_")
- )
+ )
def config_files_to_try(config_file):
diff --git a/coverage/control.py b/coverage/control.py
index 910cfb08..6387d0dd 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -250,7 +250,7 @@ class Coverage:
source=source, source_pkgs=source_pkgs, run_omit=omit, run_include=include, debug=debug,
report_omit=omit, report_include=include,
concurrency=concurrency, context=context,
- )
+ )
# If we have sub-process measurement happening automatically, then we
# want any explicit creation of a Coverage object to mean, this process
@@ -489,7 +489,7 @@ class Coverage:
branch=self.config.branch,
warn=self._warn,
concurrency=concurrency,
- )
+ )
suffix = self._data_suffix_specified
if suffix:
@@ -515,10 +515,10 @@ class Coverage:
", ".join(
plugin._coverage_plugin_name
for plugin in self._plugins.file_tracers
- ),
+ ),
self._collector.tracer_name(),
- )
)
+ )
for plugin in self._plugins.file_tracers:
plugin._coverage_enabled = False
@@ -835,7 +835,7 @@ class Coverage:
sorted(analysis.excluded),
sorted(analysis.missing),
analysis.missing_formatted(),
- )
+ )
def _analyze(self, it):
"""Analyze a single morf or code unit.
@@ -1146,7 +1146,7 @@ class Coverage:
)
)),
('command_line', " ".join(getattr(sys, 'argv', ['-none-']))),
- ]
+ ]
if self._inorout:
info.extend(self._inorout.sys_info())
diff --git a/coverage/debug.py b/coverage/debug.py
index 8c5e3839..7ec3ae42 100644
--- a/coverage/debug.py
+++ b/coverage/debug.py
@@ -211,7 +211,7 @@ class SimpleReprMixin:
klass=self.__class__.__name__,
id=id(self),
attrs=" ".join(f"{k}={v!r}" for k, v in show_attrs),
- )
+ )
def simplify(v): # pragma: debugging
diff --git a/coverage/html.py b/coverage/html.py
index 342d2ad1..e18a30a1 100644
--- a/coverage/html.py
+++ b/coverage/html.py
@@ -188,7 +188,7 @@ class HtmlReporter:
'mis': 'mis show_mis',
'par': 'par run show_par',
'run': 'run',
- }
+ },
}
self.pyfile_html_source = read_data("pyfile.html")
self.source_tmpl = Templite(self.pyfile_html_source, self.template_globals)
@@ -292,7 +292,7 @@ class HtmlReporter:
ldata.annotate = ",&nbsp;&nbsp; ".join(
f"{ldata.number}&#x202F;&#x219B;&#x202F;{d}"
for d in ldata.short_annotations
- )
+ )
else:
ldata.annotate = None
@@ -306,7 +306,7 @@ class HtmlReporter:
", ".join(
f"{num:d}) {ann_long}"
for num, ann_long in enumerate(longs, start=1)
- ),
+ ),
)
else:
ldata.annotate_long = None
diff --git a/coverage/inorout.py b/coverage/inorout.py
index 25943cb1..ec89d1b4 100644
--- a/coverage/inorout.py
+++ b/coverage/inorout.py
@@ -591,7 +591,7 @@ class InOrOut:
'source_match', 'source_pkgs_match',
'include_match', 'omit_match',
'cover_match', 'pylib_match', 'third_match',
- ]
+ ]
for matcher_name in matcher_names:
matcher = getattr(self, matcher_name)
diff --git a/coverage/jsonreport.py b/coverage/jsonreport.py
index 75ba755d..43edc452 100644
--- a/coverage/jsonreport.py
+++ b/coverage/jsonreport.py
@@ -70,7 +70,7 @@ class JsonReporter:
json.dump(
self.report_data,
outfile,
- indent=4 if self.config.json_pretty_print else None
+ indent=(4 if self.config.json_pretty_print else None),
)
return self.total.n_statements and self.total.pc_covered
diff --git a/coverage/misc.py b/coverage/misc.py
index aaf1bcf7..777cdc43 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -272,7 +272,7 @@ def _needs_to_implement(that, func_name):
raise NotImplementedError(
f"{thing} {name!r} needs to implement {func_name}()"
- )
+ )
class DefaultValue:
diff --git a/coverage/parser.py b/coverage/parser.py
index dc7c7404..60b6dc35 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -1231,15 +1231,15 @@ class AstArcAnalyzer:
if with_block.break_from:
self.process_break_exits(
self._combine_finally_starts(with_block.break_from, with_exit)
- )
+ )
if with_block.continue_from:
self.process_continue_exits(
self._combine_finally_starts(with_block.continue_from, with_exit)
- )
+ )
if with_block.return_from:
self.process_return_exits(
self._combine_finally_starts(with_block.return_from, with_exit)
- )
+ )
return exits
_handle__AsyncWith = _handle__With
diff --git a/coverage/phystokens.py b/coverage/phystokens.py
index b6b08d00..7184f160 100644
--- a/coverage/phystokens.py
+++ b/coverage/phystokens.py
@@ -60,7 +60,7 @@ def phys_tokens(toks):
99999, "\\\n",
(slineno, ccol), (slineno, ccol+2),
last_line
- )
+ )
last_line = ltext
if ttype not in (tokenize.NEWLINE, tokenize.NL):
last_ttext = ttext
diff --git a/coverage/python.py b/coverage/python.py
index 78c3e716..da43e6e8 100644
--- a/coverage/python.py
+++ b/coverage/python.py
@@ -202,8 +202,8 @@ class PythonFileReporter(FileReporter):
def no_branch_lines(self):
no_branch = self.parser.lines_matching(
join_regex(self.coverage.config.partial_list),
- join_regex(self.coverage.config.partial_always_list)
- )
+ join_regex(self.coverage.config.partial_always_list),
+ )
return no_branch
@expensive
diff --git a/coverage/results.py b/coverage/results.py
index 9675bff9..79439fd9 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -271,10 +271,10 @@ class Numbers(SimpleReprMixin):
nums.n_branches = self.n_branches + other.n_branches
nums.n_partial_branches = (
self.n_partial_branches + other.n_partial_branches
- )
+ )
nums.n_missing_branches = (
self.n_missing_branches + other.n_missing_branches
- )
+ )
return nums
def __radd__(self, other):
diff --git a/coverage/sqldata.py b/coverage/sqldata.py
index b3157a8a..aa4002a7 100644
--- a/coverage/sqldata.py
+++ b/coverage/sqldata.py
@@ -643,7 +643,7 @@ class CoverageData(SimpleReprMixin):
"from line_bits " +
"inner join file on file.id = line_bits.file_id " +
"inner join context on context.id = line_bits.context_id"
- )
+ )
lines = {(files[path], context): numbits for (path, context, numbits) in cur}
cur.close()
@@ -720,7 +720,7 @@ class CoverageData(SimpleReprMixin):
"from line_bits " +
"inner join file on file.id = line_bits.file_id " +
"inner join context on context.id = line_bits.context_id"
- )
+ )
for path, context, numbits in cur:
key = (aliases.map(path), context)
if key in lines:
@@ -977,7 +977,7 @@ class CoverageData(SimpleReprMixin):
"select l.numbits, c.context from line_bits l, context c " +
"where l.context_id = c.id " +
"and file_id = ?"
- )
+ )
data = [file_id]
if self._query_context_ids is not None:
ids_array = ", ".join("?" * len(self._query_context_ids))
diff --git a/coverage/summary.py b/coverage/summary.py
index 467c601d..861fbc53 100644
--- a/coverage/summary.py
+++ b/coverage/summary.py
@@ -127,11 +127,11 @@ class SummaryReporter:
if self.config.skip_covered and self.skipped_count:
self.writeout(
fmt_skip_covered % (self.skipped_count, 's' if self.skipped_count > 1 else '')
- )
+ )
if self.config.skip_empty and self.empty_count:
self.writeout(
fmt_skip_empty % (self.empty_count, 's' if self.empty_count > 1 else '')
- )
+ )
return self.total.n_statements and self.total.pc_covered
diff --git a/coverage/xmlreport.py b/coverage/xmlreport.py
index ebc85de4..2c34cb54 100644
--- a/coverage/xmlreport.py
+++ b/coverage/xmlreport.py
@@ -68,7 +68,7 @@ class XmlReporter:
xcoverage.setAttribute("timestamp", str(int(time.time()*1000)))
xcoverage.appendChild(self.xml_out.createComment(
f" Generated by coverage.py: {__url__} "
- ))
+ ))
xcoverage.appendChild(self.xml_out.createComment(f" Based on {DTD_URL} "))
# Call xml_file for each file in the data.
@@ -193,7 +193,7 @@ class XmlReporter:
xline.setAttribute(
"condition-coverage",
"%d%% (%d/%d)" % (100*taken//total, taken, total)
- )
+ )
if line in missing_branch_arcs:
annlines = ["exit" if b < 0 else str(b) for b in missing_branch_arcs[line]]
xline.setAttribute("missing-branches", ",".join(annlines))
diff --git a/doc/conf.py b/doc/conf.py
index a5c1d02b..a8387b13 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -119,7 +119,7 @@ pygments_style = 'sphinx'
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
- }
+}
# -- Options for HTML output ---------------------------------------------------
diff --git a/lab/goals.py b/lab/goals.py
index 8d8acdc6..4bda0f0f 100644
--- a/lab/goals.py
+++ b/lab/goals.py
@@ -40,7 +40,7 @@ def total_for_files(data, files):
n_branches=sel_summ.get("num_branches", 0),
n_partial_branches=sel_summ.get("num_partial_branches", 0),
n_missing_branches=sel_summ.get("missing_branches", 0),
- )
+ )
return total
diff --git a/lab/hack_pyc.py b/lab/hack_pyc.py
index d63da8fa..60b8459b 100644
--- a/lab/hack_pyc.py
+++ b/lab/hack_pyc.py
@@ -71,7 +71,7 @@ def hack_line_numbers(code):
code.co_argcount, code.co_nlocals, code.co_stacksize, code.co_flags,
code.co_code, tuple(new_consts), code.co_names, code.co_varnames,
code.co_filename, code.co_name, new_firstlineno, new_lnotab
- )
+ )
return new_code
diff --git a/lab/parser.py b/lab/parser.py
index 50b43564..43f3da52 100644
--- a/lab/parser.py
+++ b/lab/parser.py
@@ -28,19 +28,19 @@ class ParserMain:
parser.add_option(
"-d", action="store_true", dest="dis",
help="Disassemble"
- )
+ )
parser.add_option(
"-R", action="store_true", dest="recursive",
help="Recurse to find source files"
- )
+ )
parser.add_option(
"-s", action="store_true", dest="source",
help="Show analyzed source"
- )
+ )
parser.add_option(
"-t", action="store_true", dest="tokens",
help="Show tokens"
- )
+ )
options, args = parser.parse_args()
if options.recursive:
diff --git a/lab/run_trace.py b/lab/run_trace.py
index c0e47593..54e6a53f 100644
--- a/lab/run_trace.py
+++ b/lab/run_trace.py
@@ -20,7 +20,7 @@ def trace(frame, event, arg):
os.path.basename(frame.f_code.co_filename),
frame.f_lineno,
frame.f_lasti,
- ))
+ ))
if event == 'call':
nest += 1
diff --git a/tests/conftest.py b/tests/conftest.py
index 39f39e25..03b51b2c 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -43,12 +43,12 @@ def set_warnings():
"ignore",
category=DeprecationWarning,
message=r".*imp module is deprecated in favour of importlib",
- )
+ )
warnings.filterwarnings(
"ignore",
category=pytest.PytestRemovedIn8Warning,
- )
+ )
if env.PYPY:
# pypy3 warns about unclosed files a lot.
diff --git a/tests/helpers.py b/tests/helpers.py
index 890bd7c5..3d177824 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -45,7 +45,7 @@ def run_command(cmd):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
- )
+ )
output, _ = proc.communicate()
status = proc.returncode
@@ -135,7 +135,7 @@ class CheckUniqueFilenames:
"""The replacement method. Check that we don't have dupes."""
assert filename not in self.filenames, (
f"File name {filename!r} passed to {self.wrapped!r} twice"
- )
+ )
self.filenames.add(filename)
ret = self.wrapped(filename, *args, **kwargs)
return ret
diff --git a/tests/test_annotate.py b/tests/test_annotate.py
index 09893143..e2d49f25 100644
--- a/tests/test_annotate.py
+++ b/tests/test_annotate.py
@@ -128,5 +128,5 @@ class AnnotationGoldTest(CoverageTest):
"2\n" +
"The annotate command will be removed in a future version.\n" +
"Get in touch if you still use it: ned@nedbatchelder.com\n"
- )
+ )
compare(gold_path("annotate/mae"), ".", "*,cover")
diff --git a/tests/test_api.py b/tests/test_api.py
index bc2d05f6..63bb9abc 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -540,7 +540,7 @@ class ApiTest(CoverageTest):
"Module xyzzy was never imported. (module-not-imported)",
"Module quux was never imported. (module-not-imported)",
"No data was collected. (no-data-collected)",
- )
+ )
def test_warnings_suppressed(self):
self.make_file("hello.py", """\
@@ -1225,7 +1225,7 @@ class RelativePathTest(CoverageTest):
config_file=".coveragerc",
concurrency="multiprocessing",
data_suffix=False,
- )
+ )
cov.start()
cov.stop()
# The warning isn't the point of this test, but suppress it.
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index 10157a77..c2ae7847 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -135,7 +135,7 @@ class SimpleArcTest(CoverageTest):
assert foo() == 3 # 7
""",
arcz=".1 17 7. .2 23 36 25 56 6.", arcz_missing="25 56"
- )
+ )
self.check_coverage("""\
def foo():
if foo:
@@ -145,7 +145,7 @@ class SimpleArcTest(CoverageTest):
foo() # 6
""",
arcz=".1 16 6. .2 23 3. 25 5.", arcz_missing="25 5."
- )
+ )
def test_what_is_the_sound_of_no_lines_clapping(self):
if env.JYTHON:
@@ -176,7 +176,7 @@ class SimpleArcTest(CoverageTest):
""",
arcz=".1 19 9-1 .2 23 27 34 47 56 67 7-1 9A A9",
arcz_unpredicted="45",
- )
+ )
class WithTest(CoverageTest):
@@ -195,7 +195,7 @@ class WithTest(CoverageTest):
example()
""",
arcz=arcz,
- )
+ )
def test_with_return(self):
arcz = ".1 .2 23 34 4. 16 6."
@@ -210,7 +210,7 @@ class WithTest(CoverageTest):
example()
""",
arcz=arcz,
- )
+ )
def test_bug_146(self):
# https://github.com/nedbat/coveragepy/issues/146
@@ -225,7 +225,7 @@ class WithTest(CoverageTest):
print(5)
""",
arcz=arcz,
- )
+ )
def test_nested_with_return(self):
arcz = ".1 .2 23 34 45 56 6. 18 8."
@@ -242,7 +242,7 @@ class WithTest(CoverageTest):
example(8)
""",
arcz=arcz,
- )
+ )
def test_break_through_with(self):
arcz = ".1 12 23 34 45 15 5."
@@ -257,7 +257,7 @@ class WithTest(CoverageTest):
""",
arcz=arcz,
arcz_missing="15",
- )
+ )
def test_continue_through_with(self):
arcz = ".1 12 23 34 41 15 5."
@@ -271,7 +271,7 @@ class WithTest(CoverageTest):
print(5)
""",
arcz=arcz,
- )
+ )
@pytest.mark.xfail(
(3, 11) <= env.PYVERSION <= (3, 11, 0, 'alpha', 2, 0),
@@ -302,7 +302,7 @@ class WithTest(CoverageTest):
arcz=arcz,
arcz_missing=arcz_missing,
arcz_unpredicted=arcz_unpredicted,
- )
+ )
expected = "line 3 didn't jump to the function exit"
assert self.get_missing_arc_description(cov, 3, -2) == expected
@@ -328,7 +328,7 @@ class WithTest(CoverageTest):
""",
arcz=arcz,
arcz_missing=arcz_missing,
- )
+ )
expected = "line 3 didn't jump to the function exit"
assert self.get_missing_arc_description(cov, 3, -2) == expected
@@ -428,7 +428,7 @@ class LoopArcTest(CoverageTest):
assert a == 4 and i == 3
""",
arcz=arcz,
- )
+ )
def test_while_true(self):
# With "while True", 2.x thinks it's computation,
@@ -492,7 +492,7 @@ class LoopArcTest(CoverageTest):
break
""",
arcz=arcz
- )
+ )
def test_for_if_else_for(self):
self.check_coverage("""\
@@ -519,7 +519,7 @@ class LoopArcTest(CoverageTest):
".2 23 34 43 26 3. 6. " +
"-89 9A 9-8 AB BC CB B9 AE E9",
arcz_missing="26 6."
- )
+ )
def test_for_else(self):
self.check_coverage("""\
@@ -534,7 +534,7 @@ class LoopArcTest(CoverageTest):
forelse([1,6])
""",
arcz=".1 .2 23 32 34 47 26 67 7. 18 89 9."
- )
+ )
def test_while_else(self):
self.check_coverage("""\
@@ -1777,7 +1777,7 @@ class LambdaArcTest(CoverageTest):
b = 3
""",
arcz=".1 12 -22 2-2 23 3.", arcz_missing="-22 2-2",
- )
+ )
def test_raise_with_lambda_looks_like_partial_branch(self):
self.check_coverage("""\
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index a088ab8a..c147b527 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -107,7 +107,7 @@ class BaseCmdLineTest(CoverageTest):
patchers = [
mock.patch("coverage.cmdline."+name, getattr(mk, name))
for name in self.MOCK_GLOBALS
- ]
+ ]
for patcher in patchers:
patcher.start()
try:
@@ -797,7 +797,7 @@ class CmdLineTest(BaseCmdLineTest):
cov.save()
""",
options=options,
- )
+ )
def test_run_module_from_config(self):
self.cmd_executes("run", """\
@@ -810,7 +810,7 @@ class CmdLineTest(BaseCmdLineTest):
cov.save()
""",
options={"run:command_line": "-m mymodule thing1 thing2"},
- )
+ )
def test_run_from_config_but_empty(self):
self.cmd_executes("run", """\
@@ -819,7 +819,7 @@ class CmdLineTest(BaseCmdLineTest):
""",
ret=ERR,
options={"run:command_line": ""},
- )
+ )
def test_run_dashm_only(self):
self.cmd_executes("run -m", """\
@@ -827,14 +827,14 @@ class CmdLineTest(BaseCmdLineTest):
show_help('No module specified for -m')
""",
ret=ERR,
- )
+ )
self.cmd_executes("run -m", """\
cov = Coverage()
show_help('No module specified for -m')
""",
ret=ERR,
options={"run:command_line": "myprog.py"}
- )
+ )
def test_cant_append_parallel(self):
self.command_line("run --append --parallel-mode foo.py", ret=ERR)
diff --git a/tests/test_coverage.py b/tests/test_coverage.py
index fc4263de..9164db0f 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -22,14 +22,14 @@ class TestCoverageTest(CoverageTest):
b = 2
""",
[1,2]
- )
+ )
# You can provide a list of possible statement matches.
self.check_coverage("""\
a = 1
b = 2
""",
([100], [1,2], [1723,47]),
- )
+ )
# You can specify missing lines.
self.check_coverage("""\
a = 1
@@ -38,7 +38,7 @@ class TestCoverageTest(CoverageTest):
""",
[1,2,3],
missing="3",
- )
+ )
# You can specify a list of possible missing lines.
self.check_coverage("""\
a = 1
@@ -47,7 +47,7 @@ class TestCoverageTest(CoverageTest):
""",
[1,2,3],
missing=("47-49", "3", "100,102")
- )
+ )
def test_failed_coverage(self):
# If the lines are wrong, the message shows right and wrong.
@@ -96,7 +96,7 @@ class TestCoverageTest(CoverageTest):
a = 1
assert a == 99, "This is bad"
"""
- )
+ )
# Other exceptions too.
with pytest.raises(ZeroDivisionError, match="division"):
self.check_coverage("""\
@@ -104,7 +104,7 @@ class TestCoverageTest(CoverageTest):
assert a == 1, "This is good"
a/0
"""
- )
+ )
class BasicCoverageTest(CoverageTest):
@@ -1256,7 +1256,7 @@ class ExcludeTest(CoverageTest):
g = 7
""",
[1,3,5,7]
- )
+ )
def test_simple(self):
self.check_coverage("""\
diff --git a/tests/test_data.py b/tests/test_data.py
index f9928467..f8bff2eb 100644
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -888,6 +888,6 @@ class DumpsLoadsTest(CoverageTest):
msg = r"Unrecognized serialization: {} \(head of {} bytes\)".format(
re.escape(repr(bad_data[:40])),
len(bad_data),
- )
+ )
with pytest.raises(DataError, match=msg):
covdata.loads(bad_data)
diff --git a/tests/test_files.py b/tests/test_files.py
index 0780fdb3..5588c373 100644
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -170,7 +170,7 @@ class MatcherTest(CoverageTest):
files.canonical_filename("sub3/file4.py"),
files.canonical_filename("sub4/file5.py"),
files.canonical_filename("SUB5/file6.py"),
- ]
+ ]
tm = TreeMatcher(trees)
assert tm.info() == sorted(trees)
for filepath, matches in matches_to_try:
@@ -418,7 +418,7 @@ class FindPythonFilesTest(CoverageTest):
"sub/a.py", "sub/b.py",
"sub/ssub/__init__.py", "sub/ssub/s.py",
"sub/windows.pyw",
- ])
+ ])
@pytest.mark.skipif(not env.WINDOWS, reason="Only need to run Windows tests on Windows.")
diff --git a/tests/test_html.py b/tests/test_html.py
index 797fee1d..b1951cdb 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -363,7 +363,7 @@ class HtmlWithUnparsableFilesTest(HtmlTestHelpers, CoverageTest):
assert_coverage_warnings(
warns,
re.compile(r"Couldn't parse Python file '.*innocuous.py' \(couldnt-parse\)"),
- )
+ )
self.assert_exists("htmlcov/index.html")
# This would be better as a glob, if the HTML layout changes:
self.assert_doesnt_exist("htmlcov/innocuous.html")
@@ -868,8 +868,8 @@ assert len(math) == 18
gold_path("html/other"), "out/other",
extra_scrubs=[
(r'href="d_[0-9a-z]{16}_', 'href="_TEST_TMPDIR_othersrc_'),
- ],
- )
+ ],
+ )
contains(
'out/other/index.html',
'<a href="here_py.html">here.py</a>',
@@ -1096,7 +1096,7 @@ class HtmlWithContextsTest(HtmlTestHelpers, CoverageTest):
assert b == (14-4)
helper(
16
- )
+ )
test_one()
x = 20
diff --git a/tests/test_json.py b/tests/test_json.py
index b750a666..63713af8 100644
--- a/tests/test_json.py
+++ b/tests/test_json.py
@@ -57,8 +57,8 @@ class JsonReportTest(UsingModulesMixin, CoverageTest):
'missing_branches': 1,
'percent_covered': 60.0,
'percent_covered_display': '60',
- }
- }
+ },
+ },
},
'totals': {
'missing_lines': 1,
@@ -71,7 +71,7 @@ class JsonReportTest(UsingModulesMixin, CoverageTest):
'percent_covered_display': '60',
'covered_branches': 1,
'missing_branches': 1,
- }
+ },
}
self._assert_expected_json_report(cov, expected_result)
@@ -95,8 +95,8 @@ class JsonReportTest(UsingModulesMixin, CoverageTest):
'num_statements': 3,
'percent_covered': 66.66666666666667,
'percent_covered_display': '67',
- }
- }
+ },
+ },
},
'totals': {
'excluded_lines': 0,
@@ -105,7 +105,7 @@ class JsonReportTest(UsingModulesMixin, CoverageTest):
'num_statements': 3,
'percent_covered': 66.66666666666667,
'percent_covered_display': '67',
- }
+ },
}
self._assert_expected_json_report(cov, expected_result)
@@ -148,8 +148,8 @@ class JsonReportTest(UsingModulesMixin, CoverageTest):
'num_statements': 3,
'percent_covered': 66.66666666666667,
'percent_covered_display': '66.67',
- }
- }
+ },
+ },
},
'totals': {
'excluded_lines': 0,
@@ -158,7 +158,7 @@ class JsonReportTest(UsingModulesMixin, CoverageTest):
'num_statements': 3,
'percent_covered': 66.66666666666667,
'percent_covered_display': '66.67',
- }
+ },
}
self._assert_expected_json_report(cov, expected_result)
diff --git a/tests/test_numbits.py b/tests/test_numbits.py
index 359097b6..39cb93f6 100644
--- a/tests/test_numbits.py
+++ b/tests/test_numbits.py
@@ -13,7 +13,7 @@ from coverage import env
from coverage.numbits import (
nums_to_numbits, numbits_to_nums, numbits_union, numbits_intersection,
numbits_any_intersection, num_in_numbits, register_sqlite_functions,
- )
+)
from tests.coveragetest import CoverageTest
diff --git a/tests/test_oddball.py b/tests/test_oddball.py
index 703e8187..15dae128 100644
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -94,7 +94,7 @@ class RecursionTest(CoverageTest):
recur(100000) # This is definitely too many frames.
""",
[1, 2, 3, 5, 7], ""
- )
+ )
def test_long_recursion_recovery(self):
# Test the core of bug 93: https://github.com/nedbat/coveragepy/issues/93
@@ -346,25 +346,25 @@ class ExceptionTest(CoverageTest):
'doit.py': [302, 303, 304, 305],
'fly.py': [102, 103],
'oops.py': [2, 3],
- }),
+ }),
("doit catch oops", {
'doit.py': [302, 303],
'catch.py': [202, 203, 204, 206, 207],
'oops.py': [2, 3],
- }),
+ }),
("doit fly catch oops", {
'doit.py': [302, 303],
'fly.py': [102, 103, 104],
'catch.py': [202, 203, 204, 206, 207],
'oops.py': [2, 3],
- }),
+ }),
("doit catch fly oops", {
'doit.py': [302, 303],
'catch.py': [202, 203, 204, 206, 207],
'fly.py': [102, 103],
'oops.py': [2, 3],
- }),
- ]
+ }),
+ ]
for callnames, lines_expected in runs:
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 29c93035..cc5d6ba0 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -44,7 +44,7 @@ class PythonParserTest(CoverageTest):
""")
assert parser.exit_counts() == {
2:2, 3:1, 4:2, 5:1, 7:1, 9:2, 10:1
- }
+ }
def test_generator_exit_counts(self):
# https://github.com/nedbat/coveragepy/issues/324
@@ -76,7 +76,7 @@ class PythonParserTest(CoverageTest):
""")
assert parser.exit_counts() == {
1: 1, 2:1, 3:2, 4:1, 5:2, 6:1, 7:1, 8:1, 9:1
- }
+ }
def test_excluded_classes(self):
parser = self.parse_source("""\
@@ -90,7 +90,7 @@ class PythonParserTest(CoverageTest):
""")
assert parser.exit_counts() == {
1:1, 2:1, 3:1
- }
+ }
def test_missing_branch_to_excluded_code(self):
parser = self.parse_source("""\
@@ -433,10 +433,10 @@ class ParserMissingArcDescriptionTest(CoverageTest):
""")
assert parser.missing_arc_description(3, 4) == (
"line 3 didn't jump to line 4, because the pattern on line 3 never matched"
- )
+ )
assert parser.missing_arc_description(3, 5) == (
"line 3 didn't jump to line 5, because the pattern on line 3 always matched"
- )
+ )
class ParserFileTest(CoverageTest):
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index edf849f6..b4239700 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -196,7 +196,7 @@ class PluginTest(CoverageTest):
cov.set_option("run:plugins", ["plugin_sys_info"])
with swallow_warnings(
r"Plugin file tracers \(plugin_sys_info.Plugin\) aren't supported with PyTracer"
- ):
+ ):
cov.start()
cov.stop() # pragma: nested
@@ -210,7 +210,7 @@ class PluginTest(CoverageTest):
"-- sys: plugin_sys_info.Plugin -------------------------------",
"hello: world",
"-- end -------------------------------------------------------",
- ]
+ ]
assert expected_end == out_lines[-len(expected_end):]
def test_plugin_with_no_sys_info(self):
@@ -236,7 +236,7 @@ class PluginTest(CoverageTest):
expected_end = [
"-- sys: plugin_no_sys_info.Plugin ----------------------------",
"-- end -------------------------------------------------------",
- ]
+ ]
assert expected_end == out_lines[-len(expected_end):]
def test_local_files_are_importable(self):
@@ -426,7 +426,7 @@ class GoodFileTracerTest(FileTracerTest):
'foo_7.html 7 5 0 0 29% 1-3, 6-7',
'--------------------------------------------------------',
'TOTAL 11 7 0 0 36%',
- ]
+ ]
assert expected == report
assert math.isclose(total, 4 / 11 * 100)
@@ -525,7 +525,7 @@ class GoodFileTracerTest(FileTracerTest):
'unsuspecting.py 6 3 50% 2, 4, 6',
'-----------------------------------------------',
'TOTAL 6 3 50%',
- ]
+ ]
assert expected == report
assert total == 50
diff --git a/tests/test_process.py b/tests/test_process.py
index eac3ddda..c473cf9a 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -826,7 +826,7 @@ class EnvironmentTest(CoverageTest):
sys.path[0:0] = [
r'{abc}',
'/Users/somebody/temp/something/eggs/something-4.5.1-py2.7-xxx-10.13-x86_64.egg',
- ]
+ ]
import coverage.cmdline
@@ -1076,7 +1076,7 @@ class FailUnderTest(CoverageTest):
"b = 2\n" * 2000 +
"if a > 3:\n" +
" c = 4\n"
- )
+ )
self.make_data_file(lines={abs_file("ninety_nine_plus.py"): range(1, 2002)})
st, out = self.run_command_status("coverage report --fail-under=100")
assert st == 2
diff --git a/tests/test_results.py b/tests/test_results.py
index 4138ffd4..41f3dc40 100644
--- a/tests/test_results.py
+++ b/tests/test_results.py
@@ -139,19 +139,19 @@ def test_format_lines(statements, lines, result):
{1,2,5,10,11,13,14},
(),
"1-2, 5-11, 13-14"
- ),
+ ),
(
[1,2,3,4,5,10,11,12,13,14,98,99],
[1,2,5,10,11,13,14,99],
[(3, [4]), (5, [10, 11]), (98, [100, -1])],
"1-2, 3->4, 5-11, 13-14, 98->100, 98->exit, 99"
- ),
+ ),
(
[1,2,3,4,98,99,100,101,102,103,104],
[1,2,99,102,103,104],
[(3, [4]), (104, [-1])],
"1-2, 3->4, 99, 102-104"
- ),
+ ),
])
def test_format_lines_with_arcs(statements, lines, arcs, result):
assert format_lines(statements, lines, arcs) == result
diff --git a/tests/test_setup.py b/tests/test_setup.py
index aa65af78..5468e3bf 100644
--- a/tests/test_setup.py
+++ b/tests/test_setup.py
@@ -23,7 +23,7 @@ class SetupPyTest(CoverageTest):
def test_metadata(self):
status, output = self.run_command_status(
"python setup.py --description --version --url --author"
- )
+ )
assert status == 0
out = output.splitlines()
assert "measurement" in out[0]
diff --git a/tests/test_summary.py b/tests/test_summary.py
index 7e8f2919..4bce80f6 100644
--- a/tests/test_summary.py
+++ b/tests/test_summary.py
@@ -597,7 +597,7 @@ class SummaryTest(UsingModulesMixin, CoverageTest):
assert_coverage_warnings(
warns,
re.compile(r"Couldn't parse Python file '.*[/\\]mycode.py' \(couldnt-parse\)"),
- )
+ )
def test_dothtml_not_python(self):
# We run a .html file, and when reporting, we can't parse it as
diff --git a/tests/test_templite.py b/tests/test_templite.py
index 0f86690b..d2e98479 100644
--- a/tests/test_templite.py
+++ b/tests/test_templite.py
@@ -71,7 +71,7 @@ class TempliteTest(CoverageTest):
'name': 'Ned',
'upper': lambda x: x.upper(),
'second': lambda x: x[1],
- }
+ }
self.try_render("Hello, {{name|upper}}!", data, "Hello, NED!")
# Pipes can be concatenated.
@@ -82,7 +82,7 @@ class TempliteTest(CoverageTest):
globs = {
'upper': lambda x: x.upper(),
'punct': '!',
- }
+ }
template = Templite("This is {{name|upper}}{{punct}}", globs)
assert template.render({'name':'Ned'}) == "This is NED!"
@@ -118,7 +118,7 @@ class TempliteTest(CoverageTest):
"Look: {% for n in nums %}{{n}}, {% endfor %}done.",
locals(),
"Look: 1, 2, 3, 4, done."
- )
+ )
# Loop iterables can be filtered.
def rev(l):
"""Return the reverse of `l`."""
@@ -130,21 +130,21 @@ class TempliteTest(CoverageTest):
"Look: {% for n in nums|rev %}{{n}}, {% endfor %}done.",
locals(),
"Look: 4, 3, 2, 1, done."
- )
+ )
def test_empty_loops(self):
self.try_render(
"Empty: {% for n in nums %}{{n}}, {% endfor %}done.",
{'nums':[]},
"Empty: done."
- )
+ )
def test_multiline_loops(self):
self.try_render(
"Look: \n{% for n in nums %}\n{{n}}, \n{% endfor %}done.",
{'nums':[1,2,3]},
"Look: \n\n1, \n\n2, \n\n3, \ndone."
- )
+ )
def test_multiple_loops(self):
self.try_render(
@@ -152,46 +152,46 @@ class TempliteTest(CoverageTest):
"{% for n in nums %}{{n}}{% endfor %}",
{'nums': [1,2,3]},
"123 and 123"
- )
+ )
def test_comments(self):
# Single-line comments work:
self.try_render(
"Hello, {# Name goes here: #}{{name}}!",
{'name':'Ned'}, "Hello, Ned!"
- )
+ )
# and so do multi-line comments:
self.try_render(
"Hello, {# Name\ngoes\nhere: #}{{name}}!",
{'name':'Ned'}, "Hello, Ned!"
- )
+ )
def test_if(self):
self.try_render(
"Hi, {% if ned %}NED{% endif %}{% if ben %}BEN{% endif %}!",
{'ned': 1, 'ben': 0},
"Hi, NED!"
- )
+ )
self.try_render(
"Hi, {% if ned %}NED{% endif %}{% if ben %}BEN{% endif %}!",
{'ned': 0, 'ben': 1},
"Hi, BEN!"
- )
+ )
self.try_render(
"Hi, {% if ned %}NED{% if ben %}BEN{% endif %}{% endif %}!",
{'ned': 0, 'ben': 0},
"Hi, !"
- )
+ )
self.try_render(
"Hi, {% if ned %}NED{% if ben %}BEN{% endif %}{% endif %}!",
{'ned': 1, 'ben': 0},
"Hi, NED!"
- )
+ )
self.try_render(
"Hi, {% if ned %}NED{% if ben %}BEN{% endif %}{% endif %}!",
{'ned': 1, 'ben': 1},
"Hi, NEDBEN!"
- )
+ )
def test_complex_if(self):
class Complex(AnyOldObject):
@@ -208,24 +208,24 @@ class TempliteTest(CoverageTest):
"!",
{ 'obj': obj, 'str': str },
"@XS!"
- )
+ )
def test_loop_if(self):
self.try_render(
"@{% for n in nums %}{% if n %}Z{% endif %}{{n}}{% endfor %}!",
{'nums': [0,1,2]},
"@0Z1Z2!"
- )
+ )
self.try_render(
"X{%if nums%}@{% for n in nums %}{{n}}{% endfor %}{%endif%}!",
{'nums': [0,1,2]},
"X@012!"
- )
+ )
self.try_render(
"X{%if nums%}@{% for n in nums %}{{n}}{% endfor %}{%endif%}!",
{'nums': []},
"X!"
- )
+ )
def test_nested_loops(self):
self.try_render(
@@ -236,7 +236,7 @@ class TempliteTest(CoverageTest):
"!",
{'nums': [0,1,2], 'abc': ['a', 'b', 'c']},
"@a0b0c0a1b1c1a2b2c2!"
- )
+ )
def test_whitespace_handling(self):
self.try_render(
@@ -245,7 +245,7 @@ class TempliteTest(CoverageTest):
"{% endfor %}!\n",
{'nums': [0, 1, 2], 'abc': ['a', 'b', 'c']},
"@\n a0b0c0\n\n a1b1c1\n\n a2b2c2\n!\n"
- )
+ )
self.try_render(
"@{% for n in nums -%}\n" +
" {% for a in abc -%}\n" +
@@ -257,7 +257,7 @@ class TempliteTest(CoverageTest):
"{% endfor %}!\n",
{'nums': [0, 1, 2], 'abc': ['a', 'b', 'c']},
"@a00b00c00\na11b11c11\na22b22c22\n!\n"
- )
+ )
self.try_render(
"@{% for n in nums -%}\n" +
" {{n -}}\n" +
@@ -265,7 +265,7 @@ class TempliteTest(CoverageTest):
"{% endfor %}!\n",
{'nums': [0, 1, 2]},
"@0x\n1x\n2x\n!\n"
- )
+ )
self.try_render(" hello ", {}, " hello ")
def test_eat_whitespace(self):
@@ -284,7 +284,7 @@ class TempliteTest(CoverageTest):
"{% endjoined %}\n",
{'nums': [0, 1, 2], 'abc': ['a', 'b', 'c']},
"Hey!\n@XYa0XYb0XYc0XYa1XYb1XYc1XYa2XYb2XYc2!\n"
- )
+ )
def test_non_ascii(self):
self.try_render(
diff --git a/tests/test_venv.py b/tests/test_venv.py
index 0fe30a49..4bf1eb02 100644
--- a/tests/test_venv.py
+++ b/tests/test_venv.py
@@ -212,12 +212,12 @@ class VirtualenvTest(CoverageTest):
assert re_lines(
r"^Not tracing .*\bexecfile.py': inside --source, but is third-party",
debug_out,
- )
+ )
assert re_lines(r"^Tracing .*\bmyproduct.py", debug_out)
assert re_lines(
r"^Not tracing .*\bcolorsys.py': falls outside the --source spec",
debug_out,
- )
+ )
out = run_in_venv(coverage_command + " report")
assert "myproduct.py" in out
@@ -236,15 +236,15 @@ class VirtualenvTest(CoverageTest):
r"^Not tracing .*\bexecfile.py': " +
"module 'coverage.execfile' falls outside the --source spec",
debug_out,
- )
+ )
assert re_lines(
r"^Not tracing .*\bmyproduct.py': module 'myproduct' falls outside the --source spec",
debug_out,
- )
+ )
assert re_lines(
r"^Not tracing .*\bcolorsys.py': module 'colorsys' falls outside the --source spec",
debug_out,
- )
+ )
out = run_in_venv(coverage_command + " report")
assert "myproduct.py" not in out
@@ -300,15 +300,15 @@ class VirtualenvTest(CoverageTest):
r"^Not tracing .*\bexecfile.py': " +
"module 'coverage.execfile' falls outside the --source spec",
debug_out,
- )
+ )
assert re_lines(
r"^Not tracing .*\bmyproduct.py': module 'myproduct' falls outside the --source spec",
debug_out,
- )
+ )
assert re_lines(
r"^Not tracing .*\bcolorsys.py': module 'colorsys' falls outside the --source spec",
debug_out,
- )
+ )
out = run_in_venv(coverage_command + " report")
@@ -330,6 +330,6 @@ class VirtualenvTest(CoverageTest):
out = run_in_venv(
coverage_command +
" run --source=bug888/app,bug888/plugin bug888/app/testcov/main.py"
- )
+ )
# When the test fails, the output includes "Already imported a file that will be measured"
assert out == "Plugin here\n"
diff --git a/tests/test_xml.py b/tests/test_xml.py
index 2f332bd3..1e94dfa2 100644
--- a/tests/test_xml.py
+++ b/tests/test_xml.py
@@ -152,7 +152,7 @@ class XmlReportTest(XmlTestHelpers, CoverageTest):
assert_coverage_warnings(
warns,
re.compile(r"Couldn't parse '.*innocuous.py'. \(couldnt-parse\)"),
- )
+ )
self.assert_exists("coverage.xml")
def test_filename_format_showing_everything(self):
@@ -235,7 +235,7 @@ class XmlReportTest(XmlTestHelpers, CoverageTest):
assert_coverage_warnings(
warns,
"Module not/really was never imported. (module-not-imported)",
- )
+ )
dom = ElementTree.parse("coverage.xml")
self.assert_source(dom, "src/main")
@@ -351,7 +351,7 @@ class XmlPackageStructureTest(XmlTestHelpers, CoverageTest):
('package', {'name': "d0.d0"}),
('class', {'filename': "d0/d0/__init__.py", 'name': "__init__.py"}),
('class', {'filename': "d0/d0/f0.py", 'name': "f0.py"}),
- ])
+ ])
def test_package_depth_1(self):
self.make_tree(width=1, depth=4)
@@ -372,7 +372,7 @@ class XmlPackageStructureTest(XmlTestHelpers, CoverageTest):
('class', {'filename': "d0/d0/d0/f0.py", 'name': "d0/d0/f0.py"}),
('class', {'filename': "d0/d0/f0.py", 'name': "d0/f0.py"}),
('class', {'filename': "d0/f0.py", 'name': "f0.py"}),
- ])
+ ])
def test_package_depth_2(self):
self.make_tree(width=1, depth=4)
@@ -394,7 +394,7 @@ class XmlPackageStructureTest(XmlTestHelpers, CoverageTest):
('class', {'filename': "d0/d0/d0/__init__.py", 'name': "d0/__init__.py"}),
('class', {'filename': "d0/d0/d0/f0.py", 'name': "d0/f0.py"}),
('class', {'filename': "d0/d0/f0.py", 'name': "f0.py"}),
- ])
+ ])
def test_package_depth_3(self):
self.make_tree(width=1, depth=4)
@@ -417,7 +417,7 @@ class XmlPackageStructureTest(XmlTestHelpers, CoverageTest):
('package', {'name': "d0.d0.d0"}),
('class', {'filename': "d0/d0/d0/__init__.py", 'name': "__init__.py"}),
('class', {'filename': "d0/d0/d0/f0.py", 'name': "f0.py"}),
- ])
+ ])
def test_source_prefix(self):
# https://github.com/nedbat/coveragepy/issues/465
@@ -429,7 +429,7 @@ class XmlPackageStructureTest(XmlTestHelpers, CoverageTest):
self.assert_package_and_class_tags(cov, [
('package', {'name': "."}),
('class', {'filename': "mod.py", 'name': "mod.py"}),
- ])
+ ])
dom = ElementTree.parse("coverage.xml")
self.assert_source(dom, "src")