Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions webtest/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import select
import socket
import time
from typing import Literal
import os

from http import client
Expand Down Expand Up @@ -89,11 +90,12 @@ def run(self):
if not self.was_shutdown:
raise

def shutdown(self):
def shutdown(self, debug:bool=False) -> Literal[True]:
"""Shutdown the server"""
# avoid showing traceback related to asyncore
self.was_shutdown = True
self.logger.setLevel(logging.FATAL)
if not debug:
self.logger.setLevel(logging.FATAL)
while self._map:
triggers = list(self._map.values())
for trigger in triggers:
Expand Down