From 38bd10ff91b9a077c1511832ad0647b5d1c8d717 Mon Sep 17 00:00:00 2001 From: Shashwat Date: Thu, 22 Dec 2022 20:41:07 +0530 Subject: [PATCH 1/3] cln-remove-50393 --- pandas/tests/frame/methods/test_dtypes.py | 8 -------- pandas/tests/io/formats/test_format.py | 6 ------ pandas/tests/util/test_assert_frame_equal.py | 20 -------------------- 3 files changed, 34 deletions(-) diff --git a/pandas/tests/frame/methods/test_dtypes.py b/pandas/tests/frame/methods/test_dtypes.py index 87e6ed5b1b135..51a28d0d6d04b 100644 --- a/pandas/tests/frame/methods/test_dtypes.py +++ b/pandas/tests/frame/methods/test_dtypes.py @@ -14,14 +14,6 @@ ) import pandas._testing as tm - -def _check_cast(df, v): - """ - Check if all dtypes of df are equal to v - """ - assert all(s.dtype.name == v for _, s in df.items()) - - class TestDataFrameDataTypes: def test_empty_frame_dtypes(self): empty_df = DataFrame() diff --git a/pandas/tests/io/formats/test_format.py b/pandas/tests/io/formats/test_format.py index a75b2a427a80a..2ff1a5d66e0d1 100644 --- a/pandas/tests/io/formats/test_format.py +++ b/pandas/tests/io/formats/test_format.py @@ -105,12 +105,6 @@ def _assert_filepath_or_buffer_equals(expected): return _assert_filepath_or_buffer_equals - -def curpath(): - pth, _ = os.path.split(os.path.abspath(__file__)) - return pth - - def has_info_repr(df): r = repr(df) c1 = r.split("\n")[0].startswith(" Date: Thu, 22 Dec 2022 21:57:13 +0530 Subject: [PATCH 2/3] pre-commit issue solved --- pandas/tests/frame/methods/test_dtypes.py | 1 + pandas/tests/io/formats/test_format.py | 2 +- pandas/tests/util/test_assert_frame_equal.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/tests/frame/methods/test_dtypes.py b/pandas/tests/frame/methods/test_dtypes.py index 51a28d0d6d04b..f3b77c27d75bd 100644 --- a/pandas/tests/frame/methods/test_dtypes.py +++ b/pandas/tests/frame/methods/test_dtypes.py @@ -14,6 +14,7 @@ ) import pandas._testing as tm + class TestDataFrameDataTypes: def test_empty_frame_dtypes(self): empty_df = DataFrame() diff --git a/pandas/tests/io/formats/test_format.py b/pandas/tests/io/formats/test_format.py index 2ff1a5d66e0d1..f5aa481b2172e 100644 --- a/pandas/tests/io/formats/test_format.py +++ b/pandas/tests/io/formats/test_format.py @@ -11,7 +11,6 @@ import itertools import locale from operator import methodcaller -import os from pathlib import Path import re from shutil import get_terminal_size @@ -105,6 +104,7 @@ def _assert_filepath_or_buffer_equals(expected): return _assert_filepath_or_buffer_equals + def has_info_repr(df): r = repr(df) c1 = r.split("\n")[0].startswith(" Date: Thu, 22 Dec 2022 22:48:41 +0530 Subject: [PATCH 3/3] reverted back _check_cast() --- pandas/tests/frame/methods/test_dtypes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pandas/tests/frame/methods/test_dtypes.py b/pandas/tests/frame/methods/test_dtypes.py index f3b77c27d75bd..87e6ed5b1b135 100644 --- a/pandas/tests/frame/methods/test_dtypes.py +++ b/pandas/tests/frame/methods/test_dtypes.py @@ -15,6 +15,13 @@ import pandas._testing as tm +def _check_cast(df, v): + """ + Check if all dtypes of df are equal to v + """ + assert all(s.dtype.name == v for _, s in df.items()) + + class TestDataFrameDataTypes: def test_empty_frame_dtypes(self): empty_df = DataFrame()