Skip to content

Commit

Permalink
RM-55 update to warn when below high water mark
Browse files Browse the repository at this point in the history
RM-55 update to warn when below high water mark

RM-55 apply autopep8

RM-55 shorten line

Revert "RM-55 test lowering mypy high water mark"

This reverts commit 099e56c.
  • Loading branch information
ryantimjohn committed Feb 16, 2023
1 parent 9167f38 commit 568320f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from distutils.cmd import Command
import os.path
import sys
import warnings

__version__: Optional[str] = None
# Read in and set version variable without the overhead/requirements
Expand Down Expand Up @@ -66,9 +67,9 @@ def run(self) -> None:
f"{self.type_of_coverage} coverage used to be {high_water_mark}; "
f"down to {new_coverage}%. Fix by viewing '{self.coverage_url}'")
elif new_coverage > high_water_mark:
with open(self.coverage_file, 'w') as f:
f.write(str(new_coverage))
print(f"Just ratcheted coverage up to {new_coverage}%")
warnings.warn(
f"WARNING: Your current coverage is higher than current high watermark.\n"
f"Consider increasing high watermark in {self.coverage_file} to {new_coverage}.")
else:
print(f"Code coverage steady at {new_coverage}%")

Expand Down

0 comments on commit 568320f

Please sign in to comment.