Skip to content

Commit 96b2997

Browse files
Merge pull request #4508 from chrishavlin/yt_testing_pytest_import
2 parents ecbf2e9 + d5af434 commit 96b2997

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

yt/testing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import matplotlib
1515
import numpy as np
16-
import pytest
1716
from more_itertools import always_iterable
1817
from numpy.random import RandomState
1918
from unyt.exceptions import UnitOperationError
@@ -939,6 +938,9 @@ def requires_module_pytest(*module_names):
939938
940939
So that it can be later renamed to `requires_module`.
941940
"""
941+
# note: import pytest here so that it is not a hard requirement for
942+
# importing yt.testing see https://github.com/yt-project/yt/issues/4507
943+
import pytest
942944

943945
def deco(func):
944946
missing = [name for name in module_names if find_spec(name) is None]

0 commit comments

Comments
 (0)