Skip to content

Commit fd83f21

Browse files
committed
style: lists for homogenous collections
1 parent d961800 commit fd83f21

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

coverage/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def get_one(
461461
else:
462462
# $set_env.py: COVERAGE_DEBUG_FILE - Where to write debug output
463463
file_name = os.getenv("COVERAGE_DEBUG_FILE", FORCED_DEBUG_FILE)
464-
if file_name in ("stdout", "stderr"):
464+
if file_name in ["stdout", "stderr"]:
465465
fileobj = getattr(sys, file_name)
466466
elif file_name:
467467
fileobj = open(file_name, "a", encoding="utf-8")

tests/test_execfile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ def test_no_extra_file(self) -> None:
7676
def test_universal_newlines(self) -> None:
7777
# Make sure we can read any sort of line ending.
7878
pylines = """# try newlines|print('Hello, world!')|""".split('|')
79-
for nl in ('\n', '\r\n', '\r'):
80-
with open('nl.py', 'wb') as fpy:
81-
fpy.write(nl.join(pylines).encode('utf-8'))
82-
run_python_file(['nl.py'])
79+
for nl in ["\n", "\r\n", "\r"]:
80+
with open("nl.py", "wb") as fpy:
81+
fpy.write(nl.join(pylines).encode("utf-8"))
82+
run_python_file(["nl.py"])
8383
assert self.stdout() == "Hello, world!\n"*3
8484

8585
def test_missing_final_newline(self) -> None:

tests/test_xml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ def package_and_class_tags(self, cov: Coverage) -> Iterator[tuple[str, dict[str,
385385
cov.xml_report()
386386
dom = ElementTree.parse("coverage.xml")
387387
for node in dom.iter():
388-
if node.tag in ('package', 'class'):
389-
yield (node.tag, {a:v for a,v in node.items() if a in ('name', 'filename')})
388+
if node.tag in ["package", "class"]:
389+
yield (node.tag, {a:v for a,v in node.items() if a in ["name", "filename"]})
390390

391391
def assert_package_and_class_tags(self, cov: Coverage, result: Any) -> None:
392392
"""Check the XML package and class tags from `cov` match `result`."""

0 commit comments

Comments
 (0)