Skip to content

Commit 0241333

Browse files
committed
using null fixtures for tests in test_algos.py
1 parent b91e0b7 commit 0241333

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pandas/tests/test_algos.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -538,14 +538,17 @@ def test_first_nan_kept(self):
538538
struct.pack("d", result[0]))[0]
539539
assert result_nan_bits == bits_for_nan1
540540

541-
def test_do_not_mangle_na_values(self):
541+
def test_do_not_mangle_na_values(self, unique_nulls_fixture,
542+
unique_nulls_fixture2):
542543
# GH 22295
543-
a = np.array([None, np.nan, pd.NaT], dtype=np.object)
544+
if unique_nulls_fixture is unique_nulls_fixture2:
545+
return # skip it, values not unique
546+
a = np.array([unique_nulls_fixture,
547+
unique_nulls_fixture2], dtype=np.object)
544548
result = pd.unique(a)
545-
assert result.size == 3
546-
assert a[0] is None
547-
assert np.isnan(a[1])
548-
assert a[2] is pd.NaT
549+
assert result.size == 2
550+
assert a[0] is unique_nulls_fixture
551+
assert a[1] is unique_nulls_fixture2
549552

550553

551554
class TestIsin(object):

0 commit comments

Comments
 (0)