Skip to content

Commit 01c4c51

Browse files
authored
TST: Fix pandas.io.stata imports in test_stata.py (pandas-dev#40094)
1 parent 56c9346 commit 01c4c51

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/tests/io/test_stata.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
StataMissingValue,
3232
StataReader,
3333
StataWriterUTF8,
34+
ValueLabelTypeMismatch,
3435
read_stata,
3536
)
3637

@@ -435,7 +436,7 @@ def test_read_write_dta11(self):
435436
formatted = formatted.astype(np.int32)
436437

437438
with tm.ensure_clean() as path:
438-
with tm.assert_produces_warning(io.stata.InvalidColumnName):
439+
with tm.assert_produces_warning(InvalidColumnName):
439440
original.to_stata(path, None)
440441

441442
written_and_read_again = self.read_dta(path)
@@ -1022,7 +1023,7 @@ def test_categorical_warnings_and_errors(self):
10221023
[original[col].astype("category") for col in original], axis=1
10231024
)
10241025

1025-
with tm.assert_produces_warning(io.stata.ValueLabelTypeMismatch):
1026+
with tm.assert_produces_warning(ValueLabelTypeMismatch):
10261027
original.to_stata(path)
10271028
# should get a warning for mixed content
10281029

@@ -1652,7 +1653,7 @@ def test_convert_strl_name_swap(self):
16521653
)
16531654
original.index.name = "index"
16541655

1655-
with tm.assert_produces_warning(io.stata.InvalidColumnName):
1656+
with tm.assert_produces_warning(InvalidColumnName):
16561657
with tm.ensure_clean() as path:
16571658
original.to_stata(path, convert_strl=["long", 1], version=117)
16581659
reread = self.read_dta(path)

0 commit comments

Comments
 (0)