Skip to content

Commit 5c5e2bb

Browse files
committed
Add option to debug resource warnings in tests.
1 parent 6dfb604 commit 5c5e2bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import os
3+
import tracemalloc
34

45

56
format = "%(asctime)s %(levelname)s %(name)s %(message)s"
@@ -12,3 +13,7 @@
1213
level = logging.CRITICAL
1314

1415
logging.basicConfig(format=format, level=level)
16+
17+
if bool(os.environ.get("WEBSOCKETS_TRACE")): # pragma: no cover
18+
# Trace allocations to debug resource warnings.
19+
tracemalloc.start()

0 commit comments

Comments
 (0)