Repository: modin-project/modin
Pull request: Moving the `xfail` in the `test_io` file from the test code to the decorator
## What do these changes do?

<!-- Please give a short brief about these changes. -->

- [X] commit message follows format outlined [here](https://modin.readthedocs.io/en/latest/contributing.html)
- [X] passes `flake8 modin`
- [X] passes `black --check modin`
- [X] signed commit with `git commit -s` <!-- you can amend your commit with a signature via `git commit -amend -s` -->
- [X] Resolves #3295?
- [X] tests added and passing
- [X] module layout described at `docs/developer/architecture.rst` is up-to-date <!-- if you have added, renamed or removed files or directories please update the documentation accordingly -->

In the file `modin/pandas/test/test_io.py` many tests are marked as `xfail` in `"modin in the cloud"` mode. In addition, these `xfail` are located in the `if` blocks in the test body itself. This is wrong, as if this test somehow works, then there is no way to find out about it.

I looked through the entire file and rearranged `xfail` into the decorators. More information about the solution is written in https://github.com/modin-project/modin/issues/3295.

Problem statement:
Some marked as xfail tests pass in "cloud" mode
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Windows 10
- **Modin version** (`modin.__version__`): 0.10.0
- **Python version**: 3.8.10 64-bit

### Describe the problem
There are tests that are marked as xfail in the `"modin in the cloud"` mode, which actually pass. One needs to find such tests and enable them, for maximum verification of the functionality of the mode.

Some tests are marked as `xfail` in the test code itself. Because of how `pytest.xfail` works (it actually never runs the test), we will not know that the xfail-ed test is really passing (for decorator-implemented `xfail` we receive a `xpass` error). In such tests, you need to transfer xfail from the test itself to the decorator.

Hints from issue discussion:
I have found that it's possible to transfer in-function `xfail` with check to decorator form, to get proper `xpass` errors if tests are actually passing (which some of them really do now).

Example diff is below:

```diff
diff --git a/modin/pandas/test/test_io.py b/modin/pandas/test/test_io.py
index 33924218..b5339aba 100644
--- a/modin/pandas/test/test_io.py
+++ b/modin/pandas/test/test_io.py
@@ -496,9 +496,12 @@ class TestCsv:
     )
     @pytest.mark.parametrize("dayfirst", [True, False])
     @pytest.mark.parametrize("cache_dates", [True, False])
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
     def test_read_csv_datetime(
         self,
-        request,
         parse_dates,
         infer_datetime_format,
         keep_date_col,
@@ -506,11 +509,6 @@ class TestCsv:
         dayfirst,
         cache_dates,
     ):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
-
         if (
             Backend.get() == "Omnisci"
             and isinstance(parse_dates, list)
```

Commit message: REFACTOR-#3295: Update reference in issue

Signed-off-by: aleksandr.lozovskii <aleksandr.lozovskii@intel.com>

Patch to review:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7d5985c9490..24bde19abda 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -558,7 +558,7 @@ jobs:
           conda info
           conda list
       - shell: bash -l {0}
-        run: python -m pytest --simulate-cloud=normal modin/pandas/test/test_io.py::TestCsv
+        run: python -m pytest --simulate-cloud=normal modin/pandas/test/test_io.py
       - shell: bash -l {0}
       # When running without parameters, some of the tests fail
         run: python -m pytest --simulate-cloud=normal modin/pandas/test/dataframe/test_binary.py::test_math_functions[add-rows-scalar]
diff --git a/modin/pandas/test/test_io.py b/modin/pandas/test/test_io.py
index ee2760e31d9..310a97a5b31 100644
--- a/modin/pandas/test/test_io.py
+++ b/modin/pandas/test/test_io.py
@@ -263,7 +263,6 @@ def test_read_csv_delimiters(
     @pytest.mark.parametrize("skip_blank_lines", [True, False])
     def test_read_csv_col_handling(
         self,
-        request,
         header,
         index_col,
         prefix,
@@ -271,10 +270,6 @@ def test_read_csv_col_handling(
         usecols,
         skip_blank_lines,
     ):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
         if names is lib.no_default:
             pytest.skip("some parameters combiantions fails: issue #2312")
         eval_io(
@@ -313,16 +308,11 @@ def test_from_csv_with_callable_usecols(self, usecols):
     @pytest.mark.parametrize("skipfooter", [0, 10])
     def test_read_csv_parsing_1(
         self,
-        request,
         dtype,
         engine,
         converters,
         skipfooter,
     ):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
 
         if dtype:
             dtype = {
@@ -353,7 +343,6 @@ def test_read_csv_parsing_1(
     @pytest.mark.parametrize("names", [["c1", "c2", "c3", "c4"], None])
     def test_read_csv_parsing_2(
         self,
-        request,
         true_values,
         false_values,
         skiprows,
@@ -381,10 +370,6 @@ def test_read_csv_parsing_2(
             pytest.xfail(
                 "read_csv fails because of duplicated columns names - issue #3080"
             )
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
 
         eval_io(
             fn_name="read_csv",
@@ -433,7 +418,7 @@ def test_read_csv_skipinitialspace(self):
     def test_read_csv_squeeze(self, request, test_case):
         if request.config.getoption("--simulate-cloud").lower() != "off":
             pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
+                reason="Error EOFError: stream has been closed in `modin in the cloud` mode - issue #3329"
             )
         unique_filename = get_unique_filename()
 
@@ -498,7 +483,6 @@ def test_read_csv_nans_handling(
     @pytest.mark.parametrize("cache_dates", [True, False])
     def test_read_csv_datetime(
         self,
-        request,
         parse_dates,
         infer_datetime_format,
         keep_date_col,
@@ -506,11 +490,6 @@ def test_read_csv_datetime(
         dayfirst,
         cache_dates,
     ):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
-
         if (
             Backend.get() == "Omnisci"
             and isinstance(parse_dates, list)
@@ -623,7 +602,6 @@ def test_read_csv_compression(self, make_csv_file, compression, encoding, engine
     @pytest.mark.parametrize("dialect", ["test_csv_dialect", None])
     def test_read_csv_file_format(
         self,
-        request,
         make_csv_file,
         thousands,
         decimal,
@@ -631,11 +609,7 @@ def test_read_csv_file_format(
         escapechar,
         dialect,
     ):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
-        elif Engine.get() != "Python" and lineterminator == "x":
+        if Engine.get() != "Python" and lineterminator == "x":
             pytest.xfail("read_csv with Ray engine outputs empty frame - issue #2493")
         elif Engine.get() != "Python" and escapechar:
             pytest.xfail(
@@ -834,11 +808,7 @@ def test_read_csv_bad_quotes(self, nrows):
 
         eval_io_from_str(csv_bad_quotes, unique_filename, nrows=nrows)
 
-    def test_read_csv_categories(self, request):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    def test_read_csv_categories(self):
         eval_io(
             fn_name="read_csv",
             # read_csv kwargs
@@ -860,16 +830,8 @@ def test_read_csv_categories(self, request):
         ],
     )
     def test_read_csv_parse_dates(
-        self, request, names, header, index_col, parse_dates, encoding, encoding_errors
+        self, names, header, index_col, parse_dates, encoding, encoding_errors
     ):
-        if (
-            parse_dates
-            and request.config.getoption("--simulate-cloud").lower() != "off"
-        ):
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
-
         if names is not None and header == "infer":
             pytest.xfail(
                 "read_csv with Ray engine works incorrectly with date data and names parameter provided - issue #2509"
@@ -912,11 +874,11 @@ def test_read_csv_skiprows_names(self, names, skiprows):
             skiprows=skiprows,
         )
 
-    def test_read_csv_default_to_pandas(self, request):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
+    def test_read_csv_default_to_pandas(self):
         with pytest.warns(UserWarning):
             # This tests that we default to pandas on a buffer
             from io import StringIO
@@ -931,11 +893,11 @@ def test_read_csv_default_to_pandas(self, request):
                 skiprows=lambda x: x in [0, 2],
             )
 
-    def test_read_csv_default_to_pandas_url(self, request):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
+    def test_read_csv_default_to_pandas_url(self):
         # We haven't implemented read_csv from https, but if it's implemented, then this needs to change
         eval_io(
             fn_name="read_csv",
@@ -956,11 +918,7 @@ def test_read_csv_newlines_in_quotes(self, nrows, skiprows):
             cast_to_str=Backend.get() != "Omnisci",
         )
 
-    def test_read_csv_sep_none(self, request):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    def test_read_csv_sep_none(self):
         eval_io(
             fn_name="read_csv",
             modin_warning=ParserWarning,
@@ -969,11 +927,11 @@ def test_read_csv_sep_none(self, request):
             sep=None,
         )
 
-    def test_read_csv_incorrect_data(self, request):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
+    def test_read_csv_incorrect_data(self):
         eval_io(
             fn_name="read_csv",
             # read_csv kwargs
@@ -989,11 +947,7 @@ def test_read_csv_incorrect_data(self, request):
             {"names": [3, 1, 2, 5], "usecols": [4, 1, 3, 2]},
         ],
     )
-    def test_read_csv_names_neq_num_cols(self, request, kwargs):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    def test_read_csv_names_neq_num_cols(self, kwargs):
         eval_io(
             fn_name="read_csv",
             # read_csv kwargs
@@ -1018,11 +972,11 @@ def test_read_csv_wrong_path(self):
     )
     @pytest.mark.parametrize("header", [False, True])
     @pytest.mark.parametrize("mode", ["w", "wb+"])
-    def test_to_csv(self, request, header, mode):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
+    def test_to_csv(self, header, mode):
 
         pandas_df = generate_dataframe()
         modin_df = pd.DataFrame(pandas_df)
@@ -1040,11 +994,11 @@ def test_to_csv(self, request, header, mode):
         Backend.get() == "Omnisci",
         reason="to_csv is not implemented with OmniSci backend yet - issue #3082",
     )
-    def test_dataframe_to_csv(self, request):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
+    def test_dataframe_to_csv(self):
         pandas_df = pandas.read_csv(pytest.csvs_names["test_read_csv_regular"])
         modin_df = pd.DataFrame(pandas_df)
         eval_to_file(
@@ -1055,11 +1009,11 @@ def test_dataframe_to_csv(self, request):
         Backend.get() == "Omnisci",
         reason="to_csv is not implemented with OmniSci backend yet - issue #3082",
     )
-    def test_series_to_csv(self, request):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail(
-                reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
-            )
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
+    def test_series_to_csv(self):
         pandas_s = pandas.read_csv(
             pytest.csvs_names["test_read_csv_regular"], usecols=["col1"]
         ).squeeze()
@@ -1086,10 +1040,20 @@ def wrapped_read_csv(file, method):
 
         df_equals(modin_df, pandas_df)
 
-    @pytest.mark.parametrize("read_mode", ["r", "rb"])
-    def test_read_csv_file_handle(self, request, read_mode, make_csv_file):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail("Cannot pickle file handles. See comments in PR #2625")
+    @pytest.mark.parametrize(
+        "read_mode",
+        [
+            "r",
+            pytest.param(
+                "rb",
+                marks=pytest.mark.xfail(
+                    condition="config.getoption('--simulate-cloud').lower() != 'off'",
+                    reason="Cannot pickle file handles. See comments in PR #2625",
+                ),
+            ),
+        ],
+    )
+    def test_read_csv_file_handle(self, read_mode, make_csv_file):
 
         unique_filename = get_unique_filename()
         make_csv_file(filename=unique_filename)
@@ -1177,6 +1141,10 @@ def test_read_table_empty_frame(self, make_csv_file):
 
 class TestParquet:
     @pytest.mark.parametrize("columns", [None, ["col1"]])
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_parquet(self, make_parquet_file, columns):
         unique_filename = get_unique_filename(extension="parquet")
         make_parquet_file(filename=unique_filename)
@@ -1189,6 +1157,10 @@ def test_read_parquet(self, make_parquet_file, columns):
         )
 
     @pytest.mark.parametrize("columns", [None, ["col1"]])
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_parquet_directory(self, make_parquet_file, columns):  #
 
         unique_filename = get_unique_filename(extension=None)
@@ -1201,6 +1173,10 @@ def test_read_parquet_directory(self, make_parquet_file, columns):  #
         )
 
     @pytest.mark.parametrize("columns", [None, ["col1"]])
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
     def test_read_parquet_partitioned_directory(self, make_parquet_file, columns):
         unique_filename = get_unique_filename(extension=None)
         make_parquet_file(filename=unique_filename, partitioned_columns=["col1"])
@@ -1212,6 +1188,10 @@ def test_read_parquet_partitioned_directory(self, make_parquet_file, columns):
             columns=columns,
         )
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
     def test_read_parquet_pandas_index(self):
         # Ensure modin can read parquet files written by pandas with a non-RangeIndex object
         unique_filename = get_unique_filename(extension="parquet")
@@ -1237,6 +1217,10 @@ def test_read_parquet_pandas_index(self):
         finally:
             os.remove(unique_filename)
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
     def test_read_parquet_pandas_index_partitioned(self):
         # Ensure modin can read parquet files written by pandas with a non-RangeIndex object
         unique_filename = get_unique_filename(extension="parquet")
@@ -1257,6 +1241,10 @@ def test_read_parquet_pandas_index_partitioned(self):
         finally:
             shutil.rmtree(unique_filename)
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_parquet_hdfs(self):
         eval_io(
             fn_name="read_parquet",
@@ -1283,6 +1271,10 @@ def test_read_parquet_s3(self):
         modin_df_s3 = pd.read_parquet(dataset_url)
         df_equals(pandas_df, modin_df_s3)
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_parquet_without_metadata(self):
         """Test that Modin can read parquet files not written by pandas."""
         from pyarrow import csv
@@ -1305,6 +1297,10 @@ def test_read_parquet_without_metadata(self):
 
         df_equals(pd.read_parquet(parquet_fname), pandas.read_parquet(parquet_fname))
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_to_parquet(self):
         modin_df, pandas_df = create_test_dfs(TEST_DATA)
         eval_to_file(
@@ -1314,6 +1310,10 @@ def test_to_parquet(self):
             extension="parquet",
         )
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
     def test_read_parquet_2462(self):
         test_df = pd.DataFrame(
             {
@@ -1357,6 +1357,10 @@ def test_read_json_categories(self):
         "data",
         [json_short_string, json_short_bytes, json_long_string, json_long_bytes],
     )
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_json_string_bytes(self, data):
         with pytest.warns(UserWarning):
             modin_df = pd.read_json(data)
@@ -1371,10 +1375,20 @@ def test_to_json(self):
             modin_obj=modin_df, pandas_obj=pandas_df, fn="to_json", extension="json"
         )
 
-    @pytest.mark.parametrize("read_mode", ["r", "rb"])
-    def test_read_json_file_handle(self, request, read_mode):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail("Cannot pickle file handles. See comments in PR #2625")
+    @pytest.mark.parametrize(
+        "read_mode",
+        [
+            "r",
+            pytest.param(
+                "rb",
+                marks=pytest.mark.xfail(
+                    condition="config.getoption('--simulate-cloud').lower() != 'off'",
+                    reason="Cannot pickle file handles. See comments in PR #2625",
+                ),
+            ),
+        ],
+    )
+    def test_read_json_file_handle(self, read_mode):
         unique_filename = get_unique_filename(extension="json")
         try:
             setup_json_file(filename=unique_filename)
@@ -1386,6 +1400,10 @@ def test_read_json_file_handle(self, request, read_mode):
         finally:
             teardown_test_files([unique_filename])
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_json_metadata(self):
         unique_filename = get_unique_filename(extension="json")
         try:
@@ -1422,6 +1440,10 @@ def test_read_excel(self):
             teardown_test_files([unique_filename])
 
     @check_file_leaks
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_excel_engine(self):
         unique_filename = get_unique_filename(extension="xlsx")
         try:
@@ -1437,6 +1459,10 @@ def test_read_excel_engine(self):
             teardown_test_files([unique_filename])
 
     @check_file_leaks
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_excel_index_col(self):
         unique_filename = get_unique_filename(extension="xlsx")
         try:
@@ -1453,6 +1479,10 @@ def test_read_excel_index_col(self):
             teardown_test_files([unique_filename])
 
     @check_file_leaks
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_excel_all_sheets(self):
         unique_filename = get_unique_filename(extension="xlsx")
         try:
@@ -1511,6 +1541,10 @@ def test_read_excel_sheet_name(self, sheet_name):
             sheet_name=sheet_name,
         )
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="TypeError: Expected list, got type - issue #3284",
+    )
     def test_ExcelFile(self):
         unique_filename = get_unique_filename(extension="xlsx")
         try:
@@ -1552,6 +1586,10 @@ def test_to_excel(self):
         Engine.get() != "Python", reason="Test fails because of issue 3305"
     )
     @check_file_leaks
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_excel_empty_frame(self):
         unique_filename = get_unique_filename(extension="xlsx")
         try:
@@ -1571,6 +1609,10 @@ def test_read_excel_empty_frame(self):
 
 class TestHdf:
     @pytest.mark.parametrize("format", [None, "table"])
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_hdf(self, format):
         unique_filename = get_unique_filename(extension="hdf")
         try:
@@ -1584,6 +1626,10 @@ def test_read_hdf(self, format):
         finally:
             teardown_test_files([unique_filename])
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_HDFStore(self):
         try:
             unique_filename_modin = get_unique_filename(extension="hdf")
@@ -1618,6 +1664,10 @@ def test_HDFStore(self):
 
 
 class TestSql:
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_sql(self, make_sql_connection):
         filename = get_unique_filename(extension="db")
         table = "test_read_sql"
@@ -1663,6 +1713,10 @@ def test_read_sql(self, make_sql_connection):
             con=conn,
         )
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_sql_with_chunksize(self, make_sql_connection):
         filename = get_unique_filename(extension="db")
         table = "test_read_sql_with_chunksize"
@@ -1926,10 +1980,20 @@ def test_fwf_file_parse_dates(self):
         finally:
             teardown_test_files([unique_filename])
 
-    @pytest.mark.parametrize("read_mode", ["r", "rb"])
-    def test_read_fwf_file_handle(self, request, read_mode):
-        if request.config.getoption("--simulate-cloud").lower() != "off":
-            pytest.xfail("Cannot pickle file handles. See comments in PR #2625")
+    @pytest.mark.parametrize(
+        "read_mode",
+        [
+            "r",
+            pytest.param(
+                "rb",
+                marks=pytest.mark.xfail(
+                    condition="config.getoption('--simulate-cloud').lower() != 'off'",
+                    reason="Cannot pickle file handles. See comments in PR #2625",
+                ),
+            ),
+        ],
+    )
+    def test_read_fwf_file_handle(self, read_mode):
         unique_filename = get_unique_filename(extension="txt")
         try:
             setup_fwf_file(filename=unique_filename)
@@ -1942,6 +2006,10 @@ def test_read_fwf_file_handle(self, request, read_mode):
         finally:
             teardown_test_files([unique_filename])
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+    )
     def test_read_fwf_empty_frame(self):
         kwargs = {
             "usecols": [0],
@@ -1999,6 +2067,10 @@ def test_to_stata(self):
 
 
 class TestFeather:
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
     def test_read_feather(self):
         unique_filename = get_unique_filename(extension="feather")
         try:
@@ -2012,6 +2084,10 @@ def test_read_feather(self):
         finally:
             teardown_test_files([unique_filename])
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
+    )
     def test_to_feather(self):
         modin_df, pandas_df = create_test_dfs(TEST_DATA)
         eval_to_file(
@@ -2056,6 +2132,10 @@ def test_read_pickle(self):
         finally:
             teardown_test_files([unique_filename])
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="There is no point in reading from local files.",
+    )
     def test_to_pickle(self):
         modin_df, pandas_df = create_test_dfs(TEST_DATA)
         eval_to_file(
@@ -2073,12 +2153,20 @@ def test_to_pickle(self):
             teardown_test_files([unique_filename_modin, unique_filename_pandas])
 
 
+@pytest.mark.xfail(
+    condition="config.getoption('--simulate-cloud').lower() != 'off'",
+    reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+)
 def test_from_arrow():
     _, pandas_df = create_test_dfs(TEST_DATA)
     modin_df = from_arrow(pa.Table.from_pandas(pandas_df))
     df_equals(modin_df, pandas_df)
 
 
+@pytest.mark.xfail(
+    condition="config.getoption('--simulate-cloud').lower() != 'off'",
+    reason="The reason of tests fail in `cloud` mode is unknown for now - issue #3264",
+)
 def test_to_dense():
     modin_df, pandas_df = create_test_dfs({"col1": pandas.SparseArray([0, 1, 0])})
     df_equals(modin_df.sparse.to_dense(), pandas_df.sparse.to_dense())


Code review comments:
diff_hunk: @@ -2056,6 +2132,10 @@ def test_read_pickle(self):
         finally:
             teardown_test_files([unique_filename])
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="There is no point in reading from local files.",
path: modin/pandas/test/test_io.py
text: @user1:
```suggestion
        reason="There is no point in writing to local files.",
```
?

@author:
I'm not sure if it's correct to read/write to local files remotely? It may be worth creating a separate problem to skip tests where reading/writing to local files is carried out in the `"modin in the cloud"` mode. And in this problem, correct the reason and replace `xfail` with `skip`.

@user1:
> I'm not sure if it's correct to read/write to local files remotely?

We read/write to local files for `ExperimentalPandasOnCloudpython` backend.

@author:
Good. Then I will correct for what you suggested.

@user1:
Actually, I have this test passed locally. Why did you disable it?

@user1:
Discussed offline, decided to leave as it is because the test fails when running the whole test_io.py.

diff_hunk: @@ -2012,6 +2084,10 @@ def test_read_feather(self):
         finally:
             teardown_test_files([unique_filename])
 
+    @pytest.mark.xfail(
+        condition="config.getoption('--simulate-cloud').lower() != 'off'",
+        reason="The reason of tests fail in `cloud` mode is unknown for now - issue #2340",
path: modin/pandas/test/test_io.py
text: @user1:
Should #2340 be rephrased since not only read_csv tests should be enabled? Or we can replace a ref #2340 to #3264?

@author:
Tests that are marked https://github.com/modin-project/modin/issues/2340 are already linked to this error. If you assign these tests to https://github.com/modin-project/modin/issues/3264, you may have to search for the error again. I haven't checked to see if this error is reproducible now. 

It seems to me that for now it is possible to leave the problem https://github.com/modin-project/modin/issues/2340, where it is already indicated. When we fix these errors, we will specify the error number exactly (or remove xfail as we will solve the problem).

@user1:
Not sure I understand. #2340 is about enabling `read_csv` tests, but this test is about `to_feather`.

@author:
Yes, I agree. I thought that https://github.com/modin-project/modin/issues/2340 was not the reason given by me. 

I'll fix it, thank you.

@user1:
I still see that you are linking #2340 to different tests such as `test_read_parquet_2462`, `test_read_parquet_pandas_index_partitioned`, `test_read_parquet_pandas_index`, `test_read_parquet_partitioned_directory`. 

@author:
Yes, you're right, I didn't see it.Thanks.