Skip to content

Commit 2590c1c

Browse files
committed
moved imports into functions instead of on top of the module tests/common.py to avoid import loop problems
1 parent 40c8dd9 commit 2590c1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

larray/tests/common.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
except ImportError:
1313
xw = None
1414

15-
from larray import LArray, isnan, aslarray, Metadata
16-
1715

1816
TESTDATADIR = os.path.dirname(__file__)
1917

@@ -38,6 +36,7 @@ def inputpath(relpath):
3836

3937
def assert_equal_factory(test_func):
4038
def assert_equal(a, b):
39+
from larray.core.array import LArray
4140
if isinstance(a, LArray) and isinstance(b, LArray) and a.axes != b.axes:
4241
raise AssertionError("axes differ:\n%s\n\nvs\n\n%s" % (a.axes.info, b.axes.info))
4342
if not isinstance(a, (np.ndarray, LArray)):
@@ -57,6 +56,7 @@ def assert_equal(a, b):
5756

5857
def assert_larray_equal_factory(test_func, convert=True, check_axes=False):
5958
def assert_equal(a, b):
59+
from larray.core.array import aslarray
6060
if convert:
6161
a = aslarray(a)
6262
b = aslarray(b)
@@ -88,6 +88,7 @@ def equal(a, b):
8888

8989

9090
def nan_equal(a, b):
91+
from larray.core.ufuncs import isnan
9192
return (a == b) | (isnan(a) & isnan(b))
9293

9394

@@ -121,6 +122,7 @@ def tmp_path(tmpdir, fname):
121122

122123
@pytest.fixture
123124
def meta():
125+
from larray.core.metadata import Metadata
124126
title = 'test array'
125127
description = 'Array used for testing'
126128
author = 'John Cleese'

0 commit comments

Comments
 (0)