Skip to content

Commit 2ab8fda

Browse files
committed
Add a test data file containing value labels
1 parent 7fc8e22 commit 2ab8fda

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed
1.49 KB
Binary file not shown.

pandas/tests/io/test_stata.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,9 @@ def test_read_dta3(self, file, datapath):
224224

225225
tm.assert_frame_equal(parsed, expected)
226226

227-
@pytest.mark.parametrize(
228-
"file", ["stata4_111", "stata4_113", "stata4_114", "stata4_115", "stata4_117"]
229-
)
230-
def test_read_dta4(self, file, datapath):
231-
file = datapath("io", "data", "stata", f"{file}.dta")
227+
@pytest.mark.parametrize("version", [110, 111, 113, 114, 115, 117])
228+
def test_read_dta4(self, version, datapath):
229+
file = datapath("io", "data", "stata", f"stata4_{version}.dta")
232230
parsed = self.read_dta(file)
233231

234232
expected = DataFrame.from_records(
@@ -270,11 +268,11 @@ def test_read_dta4(self, file, datapath):
270268
# stata doesn't save .category metadata
271269
tm.assert_frame_equal(parsed, expected)
272270

273-
@pytest.mark.parametrize("file", ["stata4_105", "stata4_108"])
274-
def test_readold_dta4(self, file, datapath):
271+
@pytest.mark.parametrize("version", [105, 108])
272+
def test_readold_dta4(self, version, datapath):
275273
# This test is the same as test_read_dta4 above except that the columns
276274
# had to be renamed to match the restrictions in older file format
277-
file = datapath("io", "data", "stata", f"{file}.dta")
275+
file = datapath("io", "data", "stata", f"stata4_{version}.dta")
278276
parsed = self.read_dta(file)
279277

280278
expected = DataFrame.from_records(

0 commit comments

Comments
 (0)