From 4227cb3e8ba8f4a7afbb90de8cce367df00d776c Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Thu, 3 Feb 2022 11:05:51 -0800 Subject: [PATCH] Backport PR #45786: TST: Skip flaky, crashing test in Windows --- pandas/tests/test_sorting.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandas/tests/test_sorting.py b/pandas/tests/test_sorting.py index d32c72b3df974..374944a4e17c9 100644 --- a/pandas/tests/test_sorting.py +++ b/pandas/tests/test_sorting.py @@ -1,10 +1,13 @@ from collections import defaultdict from datetime import datetime from itertools import product +import os import numpy as np import pytest +from pandas.compat import is_platform_windows + from pandas import ( DataFrame, MultiIndex, @@ -424,6 +427,11 @@ def test_codes(self, verify, codes, exp_codes, na_sentinel): tm.assert_numpy_array_equal(result, expected) tm.assert_numpy_array_equal(result_codes, expected_codes) + @pytest.mark.skipif( + is_platform_windows() and os.environ.get("PANDAS_CI", "0") == "1", + reason="In CI environment can crash thread with: " + "Windows fatal exception: access violation", + ) @pytest.mark.parametrize("na_sentinel", [-1, 99]) def test_codes_out_of_bound(self, na_sentinel): values = [3, 1, 2, 0, 4]