Repository: modin-project/modin
Issue category: Feature Request

TEST: eval_general should assume by default that pandas does not throw an error
right now `eval_general` with default parameters will not raise an assertion if both pandas and modin raise an error, even if that error is due to a mistake in writing the test code. This is dangerous behavior and it has silently swallowed mistakes in test code before. We should have to explicitly state that we are looking for an error.

Right now it's possible to work around this by setting [`raising_exceptions=(Exception,)`](https://github.com/modin-project/modin/blob/0a9fe393281280c2f1ff29ecec15461e80a98572/modin/pandas/test/utils.py#L881), but that should be the default.

@modin-project/modin-contributors @modin-project/modin-core @anmyachev I would like your thoughts on this.


Functions to edit:
modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py:HdkOnNativeIO._read_csv_check_support

Patch:
diff --git a/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py b/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py
index 14eb2f0f3f7..c12dc8f18fd 100644
--- a/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py
+++ b/modin/experimental/core/execution/native/implementations/hdk_on_native/io/io.py
@@ -457,7 +457,10 @@ def _read_csv_check_support(
                     + "'infer' header values",
                 )
             if isinstance(parse_dates, list) and not set(parse_dates).issubset(names):
-                raise ValueError("Missing column provided to 'parse_dates'")
+                missing_columns = set(parse_dates) - set(names)
+                raise ValueError(
+                    f"Missing column provided to 'parse_dates': '{', '.join(missing_columns)}'"
+                )
 
             empty_pandas_df = pandas.read_csv(
                 **dict(

Test patch: diff --git a/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py b/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py
index 4cb3f54f1a6..08bd871fc43 100644
--- a/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py
+++ b/modin/experimental/core/execution/native/implementations/hdk_on_native/test/test_dataframe.py
@@ -296,6 +296,7 @@ def test_read_csv_datetime(
         engine,
         parse_dates,
         names,
+        request,
     ):
         parse_dates_unsupported = isinstance(parse_dates, dict) or (
             isinstance(parse_dates, list)
@@ -311,9 +312,27 @@ def test_read_csv_datetime(
         skip_exc_type_check = parse_dates_unsupported and engine == "arrow"
         if skip_exc_type_check:
             pytest.xfail(reason="https://github.com/modin-project/modin/issues/7012")
+
+        raising_exceptions = None
+        if "names1-parse_dates2" in request.node.callspec.id:
+            raising_exceptions = ValueError(
+                "Missing column provided to 'parse_dates': 'col2'"
+            )
+        elif (
+            "names1-parse_dates5-None" in request.node.callspec.id
+            or "names1-parse_dates4-None" in request.node.callspec.id
+        ):
+            raising_exceptions = ValueError(
+                "Missing column provided to 'parse_dates': 'col2, col3'"
+            )
+        elif "None-parse_dates3" in request.node.callspec.id:
+            raising_exceptions = ValueError(
+                "Missing column provided to 'parse_dates': 'c2'"
+            )
         eval_io(
             fn_name="read_csv",
             md_extra_kwargs={"engine": engine},
+            raising_exceptions=raising_exceptions,
             # read_csv kwargs
             filepath_or_buffer=pytest.csvs_names["test_read_csv_regular"],
             parse_dates=parse_dates,
@@ -509,7 +528,7 @@ def test_dup_names(self, names):
             ["i1", "i2", "a"],
         ],
     )
-    def test_reset_index(self, names):
+    def test_reset_index(self, names, request):
         index = pandas.MultiIndex.from_tuples(
             [(i, j, k) for i in range(2) for j in range(3) for k in range(4)],
             names=names,
@@ -519,7 +538,12 @@ def applier(lib):
             df = lib.DataFrame(self.data, index=index) + 1
             return df.reset_index()
 
-        eval_general(pd, pandas, applier)
+        raising_exceptions = None
+        if "names3" in request.node.callspec.id:
+            raising_exceptions = ValueError("cannot insert i1, already exists")
+        elif "names4" in request.node.callspec.id:
+            raising_exceptions = ValueError("cannot insert a, already exists")
+        eval_general(pd, pandas, applier, raising_exceptions=raising_exceptions)
 
     @pytest.mark.parametrize("is_multiindex", [True, False])
     def test_reset_index_multicolumns(self, is_multiindex):
@@ -1327,7 +1351,7 @@ def groupby(df, **kwargs):
     @pytest.mark.parametrize("n", [10, -10])
     @pytest.mark.parametrize("invert", [True, False])
     @pytest.mark.parametrize("select", [True, False])
-    @pytest.mark.parametrize("ascending", [None, True, False])
+    @pytest.mark.parametrize("ascending", [True, False])
     def test_head_tail(self, op, n, invert, select, ascending):
         def head(df, **kwargs):
             if invert:
diff --git a/modin/experimental/pandas/test/test_io_exp.py b/modin/experimental/pandas/test/test_io_exp.py
index ed091dee10a..5e77d13b3ed 100644
--- a/modin/experimental/pandas/test/test_io_exp.py
+++ b/modin/experimental/pandas/test/test_io_exp.py
@@ -228,6 +228,9 @@ def _pandas_read_csv_glob(path, storage_options):
         ).reset_index(drop=True)
         return pandas_df
 
+    raising_exceptions = None
+    if "anon" in storage_options_extra:
+        raising_exceptions = PermissionError("Forbidden")
     eval_general(
         pd,
         pandas,
@@ -237,6 +240,7 @@ def _pandas_read_csv_glob(path, storage_options):
             else _pandas_read_csv_glob(s3_path, **kwargs)
         ),
         storage_options=s3_storage_options | storage_options_extra,
+        raising_exceptions=raising_exceptions,
     )
 
 
diff --git a/modin/pandas/test/dataframe/test_binary.py b/modin/pandas/test/dataframe/test_binary.py
index 69ca719e2d4..48c0afd3318 100644
--- a/modin/pandas/test/dataframe/test_binary.py
+++ b/modin/pandas/test/dataframe/test_binary.py
@@ -49,7 +49,7 @@
 @pytest.mark.parametrize(
     "other",
     [
-        lambda df: 4,
+        lambda df, axis: 4,
         lambda df, axis: df.iloc[0] if axis == "columns" else list(df[df.columns[0]]),
         lambda df, axis: {
             label: idx + 1
@@ -114,14 +114,19 @@ def test___rdivmod__():
         *("truediv", "rtruediv", "mul", "rmul", "floordiv", "rfloordiv"),
     ],
 )
-def test_math_functions_fill_value(other, fill_value, op):
+def test_math_functions_fill_value(other, fill_value, op, request):
     data = test_data["int_data"]
     modin_df, pandas_df = pd.DataFrame(data), pandas.DataFrame(data)
 
+    raising_exceptions = None
+    if "check_different_index" in request.node.callspec.id and fill_value == 3.0:
+        raising_exceptions = NotImplementedError("fill_value 3.0 not supported.")
+
     eval_general(
         modin_df,
         pandas_df,
         lambda df: getattr(df, op)(other(df), axis=0, fill_value=fill_value),
+        raising_exceptions=raising_exceptions,
         # This test causes an empty slice to be generated thus triggering:
         # https://github.com/modin-project/modin/issues/5974
         comparator_kwargs={"check_dtypes": get_current_execution() != "BaseOnPython"},
@@ -178,7 +183,7 @@ def test_math_alias(math_op, alias):
 @pytest.mark.parametrize("other", ["as_left", 4, 4.0, "a"])
 @pytest.mark.parametrize("op", ["eq", "ge", "gt", "le", "lt", "ne"])
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
-def test_comparison(data, op, other):
+def test_comparison(data, op, other, request):
     def operation(df):
         df = getattr(df, op)(df if other == "as_left" else other)
         if other == "as_left" and StorageFormat.get() == "Hdk":
@@ -187,9 +192,20 @@ def operation(df):
             df = df.sort_index(axis=1)
         return df
 
+    raising_exceptions = None
+    if "int_data" in request.node.callspec.id and other == "a":
+        pytest.xfail(reason="https://github.com/modin-project/modin/issues/7019")
+    elif "float_nan_data" in request.node.callspec.id and other == "a":
+        raising_exceptions = TypeError(
+            "Invalid comparison between dtype=float64 and str"
+        )
+        if StorageFormat.get() == "Hdk":
+            pytest.xfail(reason="https://github.com/modin-project/modin/issues/7019")
+
     eval_general(
         *create_test_dfs(data),
         operation=operation,
+        raising_exceptions=raising_exceptions,
     )
 
 
@@ -344,6 +360,9 @@ def test_mismatched_row_partitions(is_idx_aligned, op_type, is_more_other_partit
             lambda df: (
                 df / modin_df1.a if isinstance(df, pd.DataFrame) else df / pandas_df1.a
             ),
+            raising_exceptions=ValueError(
+                "cannot reindex on an axis with duplicate labels"
+            ),
         )
         return
 
@@ -492,13 +511,40 @@ def test_non_commutative_multiply():
         pytest.param(3.5, id="float scalar"),
     ],
 )
-def test_arithmetic_with_tricky_dtypes(val1, val2, op):
+def test_arithmetic_with_tricky_dtypes(val1, val2, op, request):
     modin_df1, pandas_df1 = create_test_dfs(val1)
     modin_df2, pandas_df2 = (
         create_test_dfs(val2) if isinstance(val2, list) else (val2, val2)
     )
+
+    raising_exceptions = None
+    if (
+        "bool-bool" in request.node.callspec.id
+        or "bool scalar-bool" in request.node.callspec.id
+    ) and op in [
+        "pow",
+        "rpow",
+        "truediv",
+        "rtruediv",
+        "floordiv",
+        "rfloordiv",
+    ]:
+        op_name = op[1:] if op.startswith("r") else op
+        raising_exceptions = NotImplementedError(
+            f"operator '{op_name}' not implemented for bool dtypes"
+        )
+    elif (
+        "bool-bool" in request.node.callspec.id
+        or "bool scalar-bool" in request.node.callspec.id
+    ) and op in ["sub", "rsub"]:
+        raising_exceptions = TypeError(
+            "numpy boolean subtract, the `-` operator, is not supported, "
+            + "use the bitwise_xor, the `^` operator, or the logical_xor function instead."
+        )
+
     eval_general(
         (modin_df1, modin_df2),
         (pandas_df1, pandas_df2),
         lambda dfs: getattr(dfs[0], op)(dfs[1]),
+        raising_exceptions=raising_exceptions,
     )
diff --git a/modin/pandas/test/dataframe/test_join_sort.py b/modin/pandas/test/dataframe/test_join_sort.py
index d2b44741544..9cbac7e84f9 100644
--- a/modin/pandas/test/dataframe/test_join_sort.py
+++ b/modin/pandas/test/dataframe/test_join_sort.py
@@ -384,6 +384,7 @@ def test_merge(test_data, test_data2):
         pandas_df,
         lambda df: df.merge(ms if isinstance(df, pd.DataFrame) else ps),
         comparator=comparator,
+        raising_exceptions=ValueError("Cannot merge a Series without a name"),
     )
 
     # merge a Series with a name
@@ -538,9 +539,7 @@ def test_merge_on_single_index(left_index, right_index):
 
 
 @pytest.mark.parametrize("axis", [0, 1])
-@pytest.mark.parametrize(
-    "ascending", bool_arg_values, ids=arg_keys("ascending", bool_arg_keys)
-)
+@pytest.mark.parametrize("ascending", [False, True])
 @pytest.mark.parametrize("na_position", ["first", "last"], ids=["first", "last"])
 def test_sort_index(axis, ascending, na_position):
     data = test_data["float_nan_data"]
@@ -620,8 +619,10 @@ def test_sort_multiindex(sort_remaining):
 @pytest.mark.parametrize("axis", axis_values, ids=axis_keys)
 @pytest.mark.parametrize(
     "ascending",
-    bool_arg_values + ["list_first_True", "list_first_False"],
-    ids=arg_keys("ascending", bool_arg_keys + ["list_first_True", "list_first_False"]),
+    [False, True] + ["list_first_True", "list_first_False"],
+    ids=arg_keys(
+        "ascending", ["False", "True"] + ["list_first_True", "list_first_False"]
+    ),
 )
 @pytest.mark.parametrize(
     "inplace", bool_arg_values, ids=arg_keys("inplace", bool_arg_keys)
diff --git a/modin/pandas/test/dataframe/test_map_metadata.py b/modin/pandas/test/dataframe/test_map_metadata.py
index c389b66ab87..7e0da2b0072 100644
--- a/modin/pandas/test/dataframe/test_map_metadata.py
+++ b/modin/pandas/test/dataframe/test_map_metadata.py
@@ -1333,7 +1333,7 @@ def test_insert(data):
         eval_insert(
             pd.DataFrame(columns=list("ab")),
             pandas.DataFrame(columns=list("ab")),
-            col=lambda df: df.columns[0],
+            col="Series insert",
             value=lambda df: df[df.columns[0]],
         )
     eval_insert(
diff --git a/modin/pandas/test/dataframe/test_udf.py b/modin/pandas/test/dataframe/test_udf.py
index 91ce7c85abd..5993f10f5e2 100644
--- a/modin/pandas/test/dataframe/test_udf.py
+++ b/modin/pandas/test/dataframe/test_udf.py
@@ -15,7 +15,6 @@
 import numpy as np
 import pandas
 import pytest
-from pandas._libs.lib import no_default
 from pandas.core.dtypes.common import is_list_like
 
 import modin.pandas as pd
@@ -60,13 +59,13 @@
 def test_agg_dict():
     md_df, pd_df = create_test_dfs(test_data_values[0])
     agg_dict = {pd_df.columns[0]: "sum", pd_df.columns[-1]: ("sum", "count")}
-    eval_general(md_df, pd_df, lambda df: df.agg(agg_dict), raising_exceptions=True)
+    eval_general(md_df, pd_df, lambda df: df.agg(agg_dict))
 
     agg_dict = {
         "new_col1": (pd_df.columns[0], "sum"),
         "new_col2": (pd_df.columns[-1], "count"),
     }
-    eval_general(md_df, pd_df, lambda df: df.agg(**agg_dict), raising_exceptions=True)
+    eval_general(md_df, pd_df, lambda df: df.agg(**agg_dict))
 
 
 @pytest.mark.parametrize("axis", [0, 1])
@@ -76,10 +75,19 @@ def test_agg_dict():
     ids=agg_func_keys + agg_func_except_keys,
 )
 @pytest.mark.parametrize("op", ["agg", "apply"])
-def test_agg_apply(axis, func, op):
+def test_agg_apply(axis, func, op, request):
+    raising_exceptions = None
+    if "sum sum" in request.node.callspec.id:
+        raising_exceptions = pandas.errors.SpecificationError(
+            "Function names must be unique if there is no new column names assigned"
+        )
+    elif "should raise AssertionError" in request.node.callspec.id:
+        # FIXME: https://github.com/modin-project/modin/issues/7031
+        raising_exceptions = False
     eval_general(
         *create_test_dfs(test_data["float_nan_data"]),
         lambda df: getattr(df, op)(func, axis),
+        raising_exceptions=raising_exceptions,
     )
 
 
@@ -90,10 +98,19 @@ def test_agg_apply(axis, func, op):
     ids=agg_func_keys + agg_func_except_keys,
 )
 @pytest.mark.parametrize("op", ["agg", "apply"])
-def test_agg_apply_axis_names(axis, func, op):
+def test_agg_apply_axis_names(axis, func, op, request):
+    raising_exceptions = None
+    if "sum sum" in request.node.callspec.id:
+        raising_exceptions = pandas.errors.SpecificationError(
+            "Function names must be unique if there is no new column names assigned"
+        )
+    elif "should raise AssertionError" in request.node.callspec.id:
+        # FIXME: https://github.com/modin-project/modin/issues/7031
+        raising_exceptions = False
     eval_general(
         *create_test_dfs(test_data["int_data"]),
         lambda df: getattr(df, op)(func, axis),
+        raising_exceptions=raising_exceptions,
     )
 
 
@@ -130,23 +147,22 @@ def test_apply_key_error(func):
     eval_general(
         *create_test_dfs(test_data["int_data"]),
         lambda df: df.apply({"row": func}, axis=1),
+        raising_exceptions=KeyError("Column(s) ['row'] do not exist"),
     )
 
 
 @pytest.mark.parametrize("axis", [0, 1])
-@pytest.mark.parametrize("level", [no_default, None, -1, 0, 1])
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
 @pytest.mark.parametrize("func", ["kurt", "count", "sum", "mean", "all", "any"])
-def test_apply_text_func_with_level(level, data, func, axis):
-    func_kwargs = {"level": level, "axis": axis}
+def test_apply_text_func(data, func, axis):
+    func_kwargs = {"axis": axis}
     rows_number = len(next(iter(data.values())))  # length of the first data column
     level_0 = np.random.choice([0, 1, 2], rows_number)
     level_1 = np.random.choice([3, 4, 5], rows_number)
     index = pd.MultiIndex.from_arrays([level_0, level_1])
 
     eval_general(
-        pd.DataFrame(data, index=index),
-        pandas.DataFrame(data, index=index),
+        *create_test_dfs(data, index=index),
         lambda df, *args, **kwargs: df.apply(func, *args, **kwargs),
         **func_kwargs,
     )
@@ -448,8 +464,6 @@ def test_query_named_index():
     eval_general(
         *(df.set_index("col1") for df in create_test_dfs(test_data["int_data"])),
         lambda df: df.query("col1 % 2 == 0 | col3 % 2 == 1"),
-        # work around https://github.com/modin-project/modin/issues/6016
-        raising_exceptions=(Exception,),
     )
 
 
@@ -460,8 +474,6 @@ def test_query_named_multiindex():
             for df in create_test_dfs(test_data["int_data"])
         ),
         lambda df: df.query("col1 % 2 == 1 | col3 % 2 == 1"),
-        # work around https://github.com/modin-project/modin/issues/6016
-        raising_exceptions=(Exception,),
     )
 
 
@@ -474,8 +486,6 @@ def make_df(without_index):
     eval_general(
         *(make_df(df) for df in create_test_dfs(test_data["int_data"])),
         lambda df: df.query("ilevel_0 % 2 == 0 | ilevel_1 % 2 == 1 | col4 % 2 == 1"),
-        # work around https://github.com/modin-project/modin/issues/6016
-        raising_exceptions=(Exception,),
     )
 
 
@@ -514,9 +524,9 @@ def test_query_with_element_access_issue_4580(engine):
 
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
 @pytest.mark.parametrize(
-    "func",
-    agg_func_values + agg_func_except_values,
-    ids=agg_func_keys + agg_func_except_keys,
+    "func", [lambda x: x + 1, [np.sqrt, np.exp]], ids=["lambda", "list_udfs"]
 )
-def test_transform(data, func):
+def test_transform(data, func, request):
+    if "list_udfs" in request.node.callspec.id:
+        pytest.xfail(reason="https://github.com/modin-project/modin/issues/6998")
     eval_general(*create_test_dfs(data), lambda df: df.transform(func))
diff --git a/modin/pandas/test/dataframe/test_window.py b/modin/pandas/test/dataframe/test_window.py
index ae5d83f1e57..78105ce4eb7 100644
--- a/modin/pandas/test/dataframe/test_window.py
+++ b/modin/pandas/test/dataframe/test_window.py
@@ -36,7 +36,6 @@
     quantiles_values,
     random_state,
     test_data,
-    test_data_diff_dtype,
     test_data_keys,
     test_data_values,
     test_data_with_duplicates_keys,
@@ -53,9 +52,7 @@
 
 
 @pytest.mark.parametrize("axis", [0, 1])
-@pytest.mark.parametrize(
-    "skipna", bool_arg_values, ids=arg_keys("skipna", bool_arg_keys)
-)
+@pytest.mark.parametrize("skipna", [False, True])
 @pytest.mark.parametrize("method", ["cumprod", "cummin", "cummax", "cumsum"])
 def test_cumprod_cummin_cummax_cumsum(axis, skipna, method):
     eval_general(
@@ -498,9 +495,7 @@ def test_fillna_datetime_columns():
 
 
 @pytest.mark.parametrize("axis", [0, 1])
-@pytest.mark.parametrize(
-    "skipna", bool_arg_values, ids=arg_keys("skipna", bool_arg_keys)
-)
+@pytest.mark.parametrize("skipna", [False, True])
 @pytest.mark.parametrize("method", ["median", "skew"])
 def test_median_skew(axis, skipna, method):
     eval_general(
@@ -518,15 +513,6 @@ def test_median_skew_transposed(axis, method):
     )
 
 
-@pytest.mark.parametrize("numeric_only", [True, False, None])
-@pytest.mark.parametrize("method", ["median", "skew", "std", "var", "rank", "sem"])
-def test_median_skew_std_var_rank_sem_specific(numeric_only, method):
-    eval_general(
-        *create_test_dfs(test_data_diff_dtype),
-        lambda df: getattr(df, method)(numeric_only=numeric_only),
-    )
-
-
 @pytest.mark.parametrize("method", ["median", "skew", "std", "var", "sem"])
 def test_median_skew_std_var_sem_1953(method):
     # See #1953 for details
@@ -540,10 +526,8 @@ def test_median_skew_std_var_sem_1953(method):
 
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
 @pytest.mark.parametrize("axis", axis_values, ids=axis_keys)
-@pytest.mark.parametrize(
-    "numeric_only", bool_arg_values, ids=arg_keys("numeric_only", bool_arg_keys)
-)
-def test_mode(request, data, axis, numeric_only):
+@pytest.mark.parametrize("numeric_only", [False, True])
+def test_mode(data, axis, numeric_only):
     modin_df = pd.DataFrame(data)
     pandas_df = pandas.DataFrame(data)
 
@@ -696,9 +680,7 @@ def test_rank_transposed(axis, na_option):
     )
 
 
-@pytest.mark.parametrize(
-    "skipna", bool_arg_values, ids=arg_keys("skipna", bool_arg_keys)
-)
+@pytest.mark.parametrize("skipna", [False, True])
 @pytest.mark.parametrize("ddof", int_arg_values, ids=arg_keys("ddof", int_arg_keys))
 def test_sem_float_nan_only(skipna, ddof):
     eval_general(
@@ -717,22 +699,24 @@ def test_sem_int_only(axis, ddof):
 
 
 @pytest.mark.parametrize("axis", [0, 1])
-@pytest.mark.parametrize(
-    "skipna", bool_arg_values, ids=arg_keys("skipna", bool_arg_keys)
-)
-@pytest.mark.parametrize("method", ["std", "var", "rank"])
-def test_std_var_rank(axis, skipna, method):
+@pytest.mark.parametrize("skipna", [False, True])
+@pytest.mark.parametrize("method", ["std", "var"])
+def test_std_var(axis, skipna, method):
     eval_general(
         *create_test_dfs(test_data["float_nan_data"]),
         lambda df: getattr(df, method)(axis=axis, skipna=skipna),
     )
 
 
-def test_rank_except():
+@pytest.mark.parametrize("axis", [0, 1, None])
+def test_rank(axis):
+    raising_exceptions = None
+    if axis is None:
+        raising_exceptions = ValueError("No axis named None for object type DataFrame")
     eval_general(
         *create_test_dfs(test_data["float_nan_data"]),
-        lambda df: df.rank(axis=None),
-        raising_exceptions=ValueError("No axis named None for object type DataFrame"),
+        lambda df: df.rank(axis=axis),
+        raising_exceptions=raising_exceptions,
     )
 
 
diff --git a/modin/pandas/test/test_general.py b/modin/pandas/test/test_general.py
index abe689aa74b..6193d6e87dd 100644
--- a/modin/pandas/test/test_general.py
+++ b/modin/pandas/test/test_general.py
@@ -946,10 +946,20 @@ def test_empty_series():
     [[1, 2], ["a"], 1, "a"],
     ids=["list_of_ints", "list_of_invalid_strings", "scalar", "invalid_scalar"],
 )
-def test_to_timedelta(arg):
+def test_to_timedelta(arg, request):
     # This test case comes from
     # https://github.com/modin-project/modin/issues/4966
-    eval_general(pd, pandas, lambda lib: lib.to_timedelta(arg))
+    raising_exceptions = None
+    if request.node.callspec.id == "list_of_invalid_strings":
+        raising_exceptions = ValueError("Could not convert 'a' to NumPy timedelta")
+    elif request.node.callspec.id == "invalid_scalar":
+        raising_exceptions = ValueError("unit abbreviation w/o a number")
+    eval_general(
+        pd,
+        pandas,
+        lambda lib: lib.to_timedelta(arg),
+        raising_exceptions=raising_exceptions,
+    )
 
 
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
diff --git a/modin/pandas/test/utils.py b/modin/pandas/test/utils.py
index ba71469a245..ff01481bf68 100644
--- a/modin/pandas/test/utils.py
+++ b/modin/pandas/test/utils.py
@@ -279,7 +279,7 @@
 test_string_list_data_values = list(test_string_list_data.values())
 test_string_list_data_keys = list(test_string_list_data.keys())
 
-string_seperators = {"empty sep": "", "comma sep": ",", "None sep": None}
+string_seperators = {"comma sep": ","}
 
 string_sep_values = list(string_seperators.values())
 string_sep_keys = list(string_seperators.keys())
@@ -331,7 +331,7 @@
     "sum of certain elements": lambda axis: (
         axis.iloc[0] + axis.iloc[-1] if isinstance(axis, pandas.Series) else axis + axis
     ),
-    "should raise TypeError": 1,
+    "should raise AssertionError": 1,
 }
 agg_func_keys = list(agg_func.keys())
 agg_func_values = list(agg_func.values())
@@ -906,11 +906,7 @@ def execute_callable(fn, inplace=False, md_kwargs={}, pd_kwargs={}):
                 ), "Got Modin Exception type {}, but pandas Exception type {} was expected".format(
                     type(md_e), type(pd_e)
                 )
-                if raising_exceptions and isinstance(raising_exceptions, (list, tuple)):
-                    assert not isinstance(
-                        md_e, tuple(raising_exceptions)
-                    ), f"not acceptable exception type: {md_e}"
-                elif raising_exceptions and type(raising_exceptions) is not type:
+                if raising_exceptions:
                     if Engine.get() == "Ray":
                         from ray.exceptions import RayTaskError
 
@@ -924,6 +920,8 @@ def execute_callable(fn, inplace=False, md_kwargs={}, pd_kwargs={}):
                     assert (
                         pd_e.args == raising_exceptions.args
                     ), f"not acceptable Pandas' exception: [{repr(pd_e)}]"
+                elif raising_exceptions is not False:
+                    raise pd_e
             else:
                 raise NoModinException(
                     f"Modin doesn't throw an exception, while pandas does: [{repr(pd_e)}]"
@@ -1030,22 +1028,14 @@ def eval_io_from_str(csv_str: str, unique_filename: str, **kwargs):
     unique_filename: str
         csv file name.
     """
-    try:
-        with open(unique_filename, "w") as f:
-            f.write(csv_str)
+    with open(unique_filename, "w") as f:
+        f.write(csv_str)
 
-        eval_io(
-            filepath_or_buffer=unique_filename,
-            fn_name="read_csv",
-            **kwargs,
-        )
-
-    finally:
-        if os.path.exists(unique_filename):
-            try:
-                os.remove(unique_filename)
-            except PermissionError:
-                pass
+    eval_io(
+        filepath_or_buffer=unique_filename,
+        fn_name="read_csv",
+        **kwargs,
+    )
 
 
 def create_test_dfs(*args, **kwargs):
@@ -1420,7 +1410,7 @@ def _csv_file_maker(
                     value=[char if (x + 2) == 0 else x for x in range(row_size)],
                 )
 
-            if thousands_separator:
+            if thousands_separator is not None:
                 for col_id in ["col1", "col3"]:
                     df[col_id] = df[col_id].apply(
                         lambda x: f"{x:,d}".replace(",", thousands_separator)