We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 95d2667 commit 8b1430dCopy full SHA for 8b1430d
pandas/tests/test_algos.py
@@ -2418,10 +2418,16 @@ def test_diff_low_precision_int(self, dtype):
2418
tm.assert_numpy_array_equal(result, expected)
2419
2420
2421
-def test_union_with_duplicates():
+@pytest.mark.parametrize("op", [np.array, pd.array])
2422
+def test_union_with_duplicates(op):
2423
# GH#36289
- lvals = np.array([3, 1, 3, 4])
2424
- rvals = np.array([2, 3, 1, 1])
2425
- result = algos.union_with_duplicates(lvals, rvals)
2426
- expected = np.array([3, 3, 1, 1, 4, 2])
2427
- tm.assert_numpy_array_equal(result, expected)
+ lvals = op([3, 1, 3, 4])
+ rvals = op([2, 3, 1, 1])
+ expected = op([3, 3, 1, 1, 4, 2])
+ if isinstance(expected, np.ndarray):
2428
+ result = algos.union_with_duplicates(lvals, rvals)
2429
+ tm.assert_numpy_array_equal(result, expected)
2430
+ else:
2431
+ with tm.assert_produces_warning(RuntimeWarning):
2432
2433
+ tm.assert_extension_array_equal(result, expected)
0 commit comments