Skip to content

Commit 2e89508

Browse files
authored
CLN: Removed duplicated test data (#34477)
1 parent be0b61c commit 2e89508

File tree

11 files changed

+14
-264
lines changed

11 files changed

+14
-264
lines changed

pandas/tests/io/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
@pytest.fixture
1111
def tips_file(datapath):
1212
"""Path to the tips dataset"""
13-
return datapath("io", "parser", "data", "tips.csv")
13+
return datapath("io", "data", "csv", "tips.csv")
1414

1515

1616
@pytest.fixture

pandas/tests/io/parser/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def csv_dir_path(datapath):
5353

5454

5555
@pytest.fixture
56-
def csv1(csv_dir_path):
56+
def csv1(datapath):
5757
"""
5858
The path to the data file "test1.csv" needed for parser tests.
5959
"""
60-
return os.path.join(csv_dir_path, "test1.csv")
60+
return os.path.join(datapath("io", "data", "csv"), "test1.csv")
6161

6262

6363
_cParserHighMemory = CParserHighMemory()

pandas/tests/io/parser/data/test1.csv

Lines changed: 0 additions & 8 deletions
This file was deleted.

pandas/tests/io/parser/data/tips.csv

Lines changed: 0 additions & 245 deletions
This file was deleted.

pandas/tests/io/parser/test_encoding.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,21 @@ def test_read_csv_utf_aliases(all_parsers, utf_value, encoding_fmt):
133133

134134

135135
@pytest.mark.parametrize(
136-
"fname,encoding",
136+
"file_path,encoding",
137137
[
138-
("test1.csv", "utf-8"),
139-
("unicode_series.csv", "latin-1"),
140-
("sauron.SHIFT_JIS.csv", "shiftjis"),
138+
(("io", "data", "csv", "test1.csv"), "utf-8"),
139+
(("io", "parser", "data", "unicode_series.csv"), "latin-1"),
140+
(("io", "parser", "data", "sauron.SHIFT_JIS.csv"), "shiftjis"),
141141
],
142142
)
143-
def test_binary_mode_file_buffers(all_parsers, csv_dir_path, fname, encoding):
143+
def test_binary_mode_file_buffers(
144+
all_parsers, csv_dir_path, file_path, encoding, datapath
145+
):
144146
# gh-23779: Python csv engine shouldn't error on files opened in binary.
145147
# gh-31575: Python csv engine shouldn't error on files opened in raw binary.
146148
parser = all_parsers
147149

148-
fpath = os.path.join(csv_dir_path, fname)
150+
fpath = datapath(*file_path)
149151
expected = parser.read_csv(fpath, encoding=encoding)
150152

151153
with open(fpath, mode="r", encoding=encoding) as fa:

pandas/tests/io/parser/test_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def check_compressed_urls(salaries_table, compression, extension, mode, engine):
4949
@pytest.fixture
5050
def tips_df(datapath):
5151
"""DataFrame with the tips dataset."""
52-
return read_csv(datapath("io", "parser", "data", "tips.csv"))
52+
return read_csv(datapath("io", "data", "csv", "tips.csv"))
5353

5454

5555
@pytest.mark.usefixtures("s3_resource")

pandas/tests/io/parser/test_textreader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class TestTextReader:
2121
@pytest.fixture(autouse=True)
2222
def setup_method(self, datapath):
2323
self.dirpath = datapath("io", "parser", "data")
24-
self.csv1 = os.path.join(self.dirpath, "test1.csv")
24+
csv1_dirpath = datapath("io", "data", "csv")
25+
self.csv1 = os.path.join(csv1_dirpath, "test1.csv")
2526
self.csv2 = os.path.join(self.dirpath, "test2.csv")
2627
self.xls1 = os.path.join(self.dirpath, "test.xls")
2728

0 commit comments

Comments
 (0)