Put coverage ignore patterns in coveragerc

This commit is contained in:
Jeff Epler 2024-07-14 14:34:03 -05:00
parent 77beefcf9e
commit f6ac384455
10 changed files with 23 additions and 15 deletions

View file

@ -1,7 +1,15 @@
# SPDX-FileCopyrightText: 2021 Jeff Epler
#
# SPDX-License-Identifier: GPL-3.0-only
[run]
omit =
*/site-packages/*
test*.py
[report]
exclude_also =
def __repr__
if self.debug:
if settings.DEBUG
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
if TYPE_CHECKING:
class .*\bProtocol\):
@(abc\.)?abstractmethod

View file

@ -17,7 +17,7 @@ from typing import TYPE_CHECKING, Any, NamedTuple, TextIO, TypeVar
from . import iersdata
from .tz import Mountain
if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from collections.abc import Generator
HOUR = datetime.timedelta(seconds=3600)

View file

@ -10,7 +10,7 @@ from typing import TYPE_CHECKING
import wwvb
if TYPE_CHECKING: # pragma: no cover
if TYPE_CHECKING:
from collections.abc import Generator
# State 1: Unsync'd
@ -89,5 +89,5 @@ def main() -> None:
print(w)
if __name__ == "__main__": # pragma no cover
if __name__ == "__main__":
main()

View file

@ -28,5 +28,5 @@ def main() -> None:
print(date)
if __name__ == "__main__": # pragma no branch
if __name__ == "__main__":
main()

View file

@ -124,5 +124,5 @@ def main(
print_timecodes(w, minutes, channel, style, all_timecodes=all_timecodes, file=sys.stdout)
if __name__ == "__main__": # pragma no branch
if __name__ == "__main__":
main()

View file

@ -17,9 +17,9 @@ from .iersdata_dist import DUT1_DATA_START, DUT1_OFFSETS
for location in [
platformdirs.user_data_dir("wwvbpy", "unpythonic.net"),
platformdirs.site_data_dir("wwvbpy", "unpythonic.net"),
]: # pragma no cover
]:
path = pathlib.Path(location) / "wwvbpy_iersdata.py"
if path.exists():
if path.exists(): # pragma no cover
exec(path.read_text(encoding="utf-8"), globals(), globals())
break

View file

@ -57,5 +57,5 @@ class TestLeapSecond(unittest.TestCase):
self.assertEqual(leap, bench)
if __name__ == "__main__": # pragma: no cover
if __name__ == "__main__":
unittest.main()

View file

@ -29,5 +29,5 @@ class TestPhaseModulation(unittest.TestCase):
self.assertEqual(ref_pm, test_pm)
if __name__ == "__main__": # pragma: no cover
if __name__ == "__main__":
unittest.main()

View file

@ -216,5 +216,5 @@ class WWVBRoundtrip(unittest.TestCase):
)
if __name__ == "__main__": # pragma no cover
if __name__ == "__main__":
unittest.main()

View file

@ -397,5 +397,5 @@ class WWVBRoundtrip(unittest.TestCase):
self.assertEqual(WWVBMinute2k(2099, 1, 1, 0, 0).year, 2099)
if __name__ == "__main__": # pragma no cover
if __name__ == "__main__":
unittest.main()