Skip to content

Commit e5d0c4e

Browse files
committed
Fix misleading coverage report.
Due to an optimization in CPython that is amended in 3.10, coverage.py is sometimes unable to determine the coverage of continue statements in branches. See: nedbat/coveragepy#198 Adding a no-op like a print or an empty statement would solve the coverage issue, but I've opted to just ignore the line. This should be tested and the line removed when the site is updated to Python 3.10.
1 parent ba9fe3f commit e5d0c4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pydis_site/apps/content/views/page_category.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ def get_context_data(self, **kwargs) -> t.Dict[str, t.Any]:
5757
entry_info["name"] = frontmatter.load(entry).metadata["title"]
5858
elif entry.is_dir():
5959
entry_info["name"] = utils.get_category(entry)["title"]
60-
else:
60+
else: # pragma: no cover
61+
# TODO: Remove coverage.py pragma in Python 3.10
62+
# See: https://github.com/nedbat/coveragepy/issues/198
6163
continue
6264
context["subarticles"].append(entry_info)
6365

0 commit comments

Comments
 (0)