Skip to content

Commit

Permalink
Added graceful way of closing HTTP server for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiwo735 committed Feb 28, 2024
1 parent dc81ad1 commit 8fa3d72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,10 @@ def log_message(self, format, *args):

httpd = HTTPServer((host, port), Handler)
print(GREEN + "Serving coverage on" + RESET + f" http://{host}:{port}/ ... (Ctrl+C to exit)")
httpd.serve_forever()
try:
httpd.serve_forever()
except KeyboardInterrupt:
print(RED + "\nServer has been stopped!" + RESET)

def process_result(
result: Result,
Expand Down

0 comments on commit 8fa3d72

Please sign in to comment.