Skip to content

Commit 6de583b

Browse files
committed
skip tests that use tracemalloc if not available
1 parent b978d5a commit 6de583b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/tests/libs/test_hashtable.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
from contextlib import contextmanager
33
import re
44
import struct
5-
import tracemalloc
5+
try:
6+
import tracemalloc
7+
except ModuleNotFoundError:
8+
tracemalloc = None
69

710
import numpy as np
811
import pytest
@@ -16,6 +19,8 @@
1619

1720
@contextmanager
1821
def activated_tracemalloc() -> Generator[None, None, None]:
22+
if not tracemalloc:
23+
pytest.skip("no tracemalloc available")
1924
tracemalloc.start()
2025
try:
2126
yield

0 commit comments

Comments
 (0)