Skip to content

Commit 6fcdbfe

Browse files
committed
dont crash on pypy
1 parent 0139eb7 commit 6fcdbfe

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/test_connect.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,16 @@
2222

2323
@pytest.fixture(scope="module", autouse=True)
2424
def _enable_tracemalloc():
25-
import tracemalloc
26-
27-
tracemalloc.start()
25+
try:
26+
import tracemalloc
27+
except ModuleNotFoundError:
28+
# pypy
29+
tracemalloc = None
30+
if tracemalloc is not None:
31+
tracemalloc.start()
2832
yield
29-
tracemalloc.stop()
33+
if tracemalloc is not None:
34+
tracemalloc.stop()
3035

3136

3237
sample_info: dict = {

0 commit comments

Comments
 (0)