Skip to content

Commit a1b2ac8

Browse files
committed
Use --cov-report=term-missing option for pytest
Quick (but proper) solutions to ever so slightly decrease the number of uncovered lines.
1 parent 53e063b commit a1b2ac8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ plugins = ["pydantic.mypy"]
7171

7272
[tool.pytest.ini_options]
7373
minversion = "7.4"
74-
addopts = "-rs --cov=s7 --cov-report=term"
74+
addopts = "-rs --cov=s7 --cov-report=term-missing"
7575
filterwarnings = [
7676
"error", # Fail on any warning
7777
]

s7/pydantic_models/soft7.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class GetData(Protocol):
3737
3838
"""
3939

40-
def __call__(self, soft7_property: str) -> Any:
40+
def __call__(self, soft7_property: str) -> Any: # pragma: no cover
4141
...
4242

4343

@@ -106,10 +106,8 @@ def parse_identity(identity: AnyUrl) -> tuple[AnyUrl, "Union[str, None]", str]:
106106
namespace += identity.host
107107

108108
if identity.port:
109-
# Remove default ports.
110-
if identity.scheme == "http" and identity.port == 80:
111-
pass
112-
elif identity.scheme == "https" and identity.port == 443:
109+
# Do not include default ports for http(s) schemes.
110+
if (identity.scheme, identity.port) in (("http", 80), ("https", 443)):
113111
pass
114112
else:
115113
namespace += f":{identity.port}"

0 commit comments

Comments
 (0)