Skip to content

Commit

Permalink
Adjust test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Aarni Koskela <[email protected]>
  • Loading branch information
akx committed Dec 31, 2023
1 parent 283fd26 commit ebdc9a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,13 @@ line-length = 167
"S105",
"S106",
]

[tool.coverage.report]
exclude_also = [
"@(abc\\.)?abstractmethod",
"def __repr__",
"except ImportError:",
"if TYPE_CHECKING:",
"raise AssertionError",
"raise NotImplementedError",
]
4 changes: 2 additions & 2 deletions tests/paho_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def expect_packet(sock, name, expected):
if len(data) == 0:
break
packet_recvd += data
except socket.timeout:
except socket.timeout: # pragma: no cover
pass

assert packet_matches(name, packet_recvd, expected)
Expand All @@ -88,7 +88,7 @@ def expect_no_packet(sock, delay=1):


def packet_matches(name, recvd, expected):
if recvd != expected:
if recvd != expected: # pragma: no cover
print(f"FAIL: Received incorrect {name}.")
dump_packet("Received", recvd)
dump_packet("Expected", expected)
Expand Down

0 comments on commit ebdc9a9

Please sign in to comment.