Skip to content

Commit

Permalink
TEST-#2509: mark failed tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Myskov <[email protected]>
  • Loading branch information
amyskov committed Dec 11, 2020
1 parent 05f73e6 commit 88a2b4d
Showing 1 changed file with 53 additions and 14 deletions.
67 changes: 53 additions & 14 deletions modin/pandas/test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def test_read_csv_col_handling(
skip_blank_lines,
):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.xfail(
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)

Expand Down Expand Up @@ -662,7 +662,7 @@ def test_read_csv_parsing_1(
skipfooter,
):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.xfail(
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)

Expand Down Expand Up @@ -706,7 +706,7 @@ def test_read_csv_parsing_2(
if false_values or true_values and Engine.get() != "Python":
pytest.xfail("modin and pandas dataframes differs - issue #2446")
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.xfail(
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)

Expand Down Expand Up @@ -823,7 +823,7 @@ def test_read_csv_datetime(
cache_dates,
):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.xfail(
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)

Expand Down Expand Up @@ -921,7 +921,7 @@ def test_read_csv_file_format(
dialect,
):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.xfail(
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
elif Engine.get() != "Python" and lineterminator == "x":
Expand Down Expand Up @@ -1119,7 +1119,11 @@ 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):
def test_read_csv_categories(request, self):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
eval_io(
fn_name="read_csv",
# read_csv kwargs
Expand All @@ -1140,8 +1144,15 @@ def test_read_csv_categories(self):
],
)
def test_read_csv_parse_dates(
self, names, header, index_col, parse_dates, encoding
self, request, names, header, index_col, parse_dates, encoding
):
if (
parse_dates
and request.config.getoption("--simulate-cloud").lower() != "off"
):
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)

if names is not None and header == "infer":
pytest.xfail(
Expand Down Expand Up @@ -1190,7 +1201,11 @@ def test_read_csv_skiprows_names(self, names, skiprows):
skiprows=skiprows,
)

def test_read_csv_default_to_pandas(self):
def test_read_csv_default_to_pandas(self, request):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
with pytest.warns(UserWarning):
# This tests that we default to pandas on a buffer
from io import StringIO
Expand All @@ -1205,7 +1220,11 @@ def test_read_csv_default_to_pandas(self):
skiprows=lambda x: x in [0, 2],
)

def test_read_csv_default_to_pandas_url(self):
def test_read_csv_default_to_pandas_url(self, request):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
# We haven't implemented read_csv from https, but if it's implemented, then this needs to change
eval_io(
fn_name="read_csv",
Expand All @@ -1226,7 +1245,11 @@ def test_read_csv_newlines_in_quotes(self, nrows, skiprows):
cast_to_str=True,
)

def test_read_csv_sep_none(self):
def test_read_csv_sep_none(self, request):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
eval_io(
fn_name="read_csv",
modin_warning=ParserWarning,
Expand All @@ -1235,7 +1258,11 @@ def test_read_csv_sep_none(self):
sep=None,
)

def test_read_csv_incorrect_data(self):
def test_read_csv_incorrect_data(self, request):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
eval_io(
fn_name="read_csv",
# read_csv kwargs
Expand All @@ -1251,22 +1278,34 @@ def test_read_csv_incorrect_data(self):
{"names": [3, 1, 2, 5], "usecols": [4, 1, 3, 2]},
],
)
def test_read_csv_names_neq_num_cols(self, kwargs):
def test_read_csv_names_neq_num_cols(self, request, kwargs):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
eval_io(
fn_name="read_csv",
# read_csv kwargs
filepath_or_buffer="modin/pandas/test/data/issue_2074.csv",
**kwargs,
)

def test_dataframe_to_csv(self):
def test_dataframe_to_csv(self, request):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
pandas_df = pandas.read_csv(pytest.csvs_names["test_read_csv_regular"])
modin_df = pd.DataFrame(pandas_df)
eval_to_file(
modin_obj=modin_df, pandas_obj=pandas_df, fn="to_csv", extension="csv"
)

def test_series_to_csv(self):
def test_series_to_csv(self, request):
if request.config.getoption("--simulate-cloud").lower() != "off":
pytest.skip(
"The reason of tests fail in `cloud` mode is unknown for now - issue #2340"
)
pandas_s = pandas.read_csv(
pytest.csvs_names["test_read_csv_regular"], usecols=["col1"]
).squeeze()
Expand Down

0 comments on commit 88a2b4d

Please sign in to comment.