Skip to content

Commit 54ac00b

Browse files
committed
Coverage: Update exclude_also list to skip and skip Python314AssertionsMixin
Change-Id: I438647734891dcd12e9b9c69bdc2f9918f01ee46
1 parent d051965 commit 54ac00b

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

pyproject.toml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,27 @@ ignore_errors = true
124124
skip_empty = true
125125

126126
exclude_also = [
127-
# Have to re-enable the standard pragma
127+
"@(abc\\.)?abstractmethod",
128+
"@deprecated\\([^\\)]+\\)",
129+
"@unittest\\.skip",
130+
"class .+\\bProtocol\\):",
128131
"except ImportError",
129132
"except KeyboardInterrupt",
130133
"except OSError",
131-
"except \\w*ServerError",
132134
"except SyntaxError",
133-
"raise ImportError",
134-
"raise NotImplementedError",
135-
"raise unittest\\.SkipTest",
136-
"self\\.skipTest",
137-
"if __name__ == .__main__.:",
135+
"except \\w*ServerError",
136+
"if (0|False):",
138137
"if .+PYWIKIBOT_TEST_\\w+.+:",
138+
"if TYPE_CHECKING:",
139+
"if __debug__:",
140+
"if __name__ == .__main__.:",
139141
"if self\\.mw_version < .+:",
140-
"@(abc\\.)?abstractmethod",
141-
"@deprecated\\([^\\)]+\\)",
142-
"@unittest\\.skip",
143142
# Comments to turn coverage on and off:
144143
"no cover: start(?s:.)*?no cover: stop",
144+
"raise ImportError",
145+
"raise NotImplementedError",
146+
"raise unittest\\.SkipTest",
147+
"self\\.skipTest",
145148
]
146149

147150

tests/aspects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
pywikibot.bot.set_interface('buffer')
6666

6767

68-
class Python314AssertionsMixin:
68+
class Python314AssertionsMixin: # pragma: no cover
6969

7070
"""Mixin providing assertion methods added in Python 3.14 for unittest.
7171
@@ -779,7 +779,7 @@ def _reset_login(self, skip_if_login_fails: bool = False) -> None:
779779
continue
780780

781781
if not site.logged_in():
782-
site.login()
782+
site.login() # pragma: no cover
783783

784784
if skip_if_login_fails and not site.user(): # during setUp() only
785785
self.skipTest(

0 commit comments

Comments
 (0)