We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f55036d commit 404405aCopy full SHA for 404405a
tests/conftest.py
@@ -1,7 +1,6 @@
1
import argparse
2
import random
3
import time
4
-import tracemalloc
5
from typing import Callable, TypeVar
6
from unittest import mock
7
from unittest.mock import Mock
@@ -78,9 +77,14 @@ def enable_tracemalloc():
78
77
"""
79
Enable tracemalloc while tests are being executed.
80
81
- tracemalloc.start()
82
- yield
83
- tracemalloc.stop()
+ try:
+ import tracemalloc
+
+ tracemalloc.start()
84
+ yield
85
+ tracemalloc.stop()
86
+ except ImportError:
87
88
89
90
def pytest_addoption(parser):
0 commit comments