diff --git a/pandas/tests/config/test_localization.py b/pandas/tests/config/test_localization.py index 3907f557d1075..844f67cd2d0ea 100644 --- a/pandas/tests/config/test_localization.py +++ b/pandas/tests/config/test_localization.py @@ -15,7 +15,6 @@ import pandas as pd _all_locales = get_locales() -_current_locale = locale.setlocale(locale.LC_ALL) # getlocale() is wrong, see GH#46595 # Don't run any of these tests if we have no locales. pytestmark = pytest.mark.skipif(not _all_locales, reason="Need locales") diff --git a/pandas/tests/frame/indexing/test_xs.py b/pandas/tests/frame/indexing/test_xs.py index 535137edd16cf..80b4635b94d3b 100644 --- a/pandas/tests/frame/indexing/test_xs.py +++ b/pandas/tests/frame/indexing/test_xs.py @@ -36,10 +36,7 @@ def four_level_index_dataframe(): class TestXS: - def test_xs( - self, float_frame, datetime_frame, using_copy_on_write, warn_copy_on_write - ): - float_frame_orig = float_frame.copy() + def test_xs(self, float_frame): idx = float_frame.index[5] xs = float_frame.xs(idx) for item, value in xs.items(): @@ -48,6 +45,7 @@ def test_xs( else: assert value == float_frame[item][idx] + def test_xs_mixed(self): # mixed-type xs test_data = {"A": {"1": 1, "2": 2}, "B": {"1": "1", "2": "2", "3": "3"}} frame = DataFrame(test_data) @@ -56,11 +54,14 @@ def test_xs( assert xs["A"] == 1 assert xs["B"] == "1" + def test_xs_dt_error(self, datetime_frame): with pytest.raises( KeyError, match=re.escape("Timestamp('1999-12-31 00:00:00')") ): datetime_frame.xs(datetime_frame.index[0] - BDay()) + def test_xs_other(self, float_frame, using_copy_on_write, warn_copy_on_write): + float_frame_orig = float_frame.copy() # xs get column series = float_frame.xs("A", axis=1) expected = float_frame["A"] diff --git a/pandas/tests/indexes/datetimes/test_constructors.py b/pandas/tests/indexes/datetimes/test_constructors.py index 7fdf17c797213..97e768b348d55 100644 --- a/pandas/tests/indexes/datetimes/test_constructors.py +++ b/pandas/tests/indexes/datetimes/test_constructors.py @@ -1042,7 +1042,7 @@ def test_dti_constructor_with_non_nano_now_today(self): # result may not exactly match [now, today] so we'll test it up to a tolerance. # (it *may* match exactly due to rounding) - tolerance = pd.Timedelta(microseconds=1) + tolerance = pd.Timedelta(seconds=1) diff0 = result[0] - now.as_unit("s") assert diff0 >= pd.Timedelta(0), f"The difference is {diff0}"