Skip to content

Commit b4157f0

Browse files
Added test for pandas-dev#45929 and removed superfluous single_cpu mark
The `single_cpu` attribute for `test_unique_bad_unicode` was likely an attempt to cover over the underlying bug fixed with this commit. We can now run this test in the usual fashion. Added a test case for the problem reported in 45929. Signed-off-by: Michael Tiemann <[email protected]>
1 parent c300b46 commit b4157f0

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

pandas/tests/base/test_unique.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def test_nunique_null(null_obj, index_or_series_obj):
9797
assert obj.nunique(dropna=False) == max(0, num_unique_values)
9898

9999

100-
@pytest.mark.single_cpu
101100
def test_unique_bad_unicode(index_or_series):
102101
# regression test for #34550
103102
uval = "\ud83d" # smiley emoji
@@ -113,6 +112,24 @@ def test_unique_bad_unicode(index_or_series):
113112
tm.assert_numpy_array_equal(result, expected)
114113

115114

115+
def test_unique_45929(index_or_series):
116+
# regression test for #45929
117+
data_list = [
118+
"1 \udcd6a NY",
119+
"2 \udcd6b NY",
120+
"3 \ud800c NY",
121+
"4 \udcd6d NY",
122+
"5 \udcc3e NY",
123+
]
124+
125+
obj = index_or_series(data_list)
126+
assert len(obj.unique()) == len(data_list)
127+
assert len(obj.value_counts()) == len(data_list)
128+
assert len(np.unique(data_list)) == len(data_list)
129+
assert len(set(data_list)) == len(data_list)
130+
assert obj.is_unique
131+
132+
116133
@pytest.mark.parametrize("dropna", [True, False])
117134
def test_nunique_dropna(dropna):
118135
# GH37566

0 commit comments

Comments
 (0)