Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions coverage/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def __init__( # pylint: disable=too-many-arguments
self._warn_no_data = True
self._warn_unimported_source = True
self._warn_preimported_source = check_preimported
self._no_warn_slugs: list[str] = []
self._no_warn_slugs: set[str] = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initialization is still done with an empty list, should use an empty set instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, updated now, thanks for pointing that out

self._messages = messages

# A record of all the warnings that have been issued.
Expand Down Expand Up @@ -438,7 +438,7 @@ def _warn(self, msg: str, slug: str | None = None, once: bool = False) -> None:

"""
if not self._no_warn_slugs:
self._no_warn_slugs = list(self.config.disable_warnings)
self._no_warn_slugs = set(self.config.disable_warnings)

if slug in self._no_warn_slugs:
# Don't issue the warning
Expand All @@ -453,7 +453,7 @@ def _warn(self, msg: str, slug: str | None = None, once: bool = False) -> None:

if once:
assert slug is not None
self._no_warn_slugs.append(slug)
self._no_warn_slugs.add(slug)

def _message(self, msg: str) -> None:
"""Write a message to the user, if configured to do so."""
Expand Down
Loading