Skip to content

Commit

Permalink
Remove hack to register atexit handler
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalresistor committed Nov 16, 2024
1 parent 0e82766 commit 0e7bf65
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where=src
testing =
pytest
pytest-cov
coverage>=5.0
coverage>=7.6.0

docs =
Sphinx>=1.8.1
Expand Down
13 changes: 0 additions & 13 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,9 @@ def emit(self, record):
def start_server(app, svr, queue, **kwargs): # pragma: no cover
"""Run a fixture application."""
logging.getLogger("waitress").addHandler(NullHandler())
try_register_coverage()
svr(app, queue, **kwargs).run()


def try_register_coverage(): # pragma: no cover
# Hack around multiprocessing exiting early and not triggering coverage's
# atexit handler by always registering a signal handler

if "COVERAGE_PROCESS_START" in os.environ:

def sigterm(*args):
sys.exit(0)

signal.signal(signal.SIGTERM, sigterm)


class FixtureTcpWSGIServer(server.TcpWSGIServer):
"""A version of TcpWSGIServer that relays back what it's bound to."""

Expand Down

0 comments on commit 0e7bf65

Please sign in to comment.