Skip to content

Commit 605924b

Browse files
committed
Add a test data file containing value labels
1 parent 48f98f0 commit 605924b

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

+6-8
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,9 @@ def test_read_dta3(self, file, datapath):
225225

226226
tm.assert_frame_equal(parsed, expected)
227227

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

235233
expected = DataFrame.from_records(
@@ -271,11 +269,11 @@ def test_read_dta4(self, file, datapath):
271269
# stata doesn't save .category metadata
272270
tm.assert_frame_equal(parsed, expected)
273271

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

281279
expected = DataFrame.from_records(

0 commit comments

Comments
 (0)