diff --git a/pandas/tests/io/test_stata.py b/pandas/tests/io/test_stata.py index e63a32aff9546..05a6b3c360c61 100644 --- a/pandas/tests/io/test_stata.py +++ b/pandas/tests/io/test_stata.py @@ -31,6 +31,7 @@ StataMissingValue, StataReader, StataWriterUTF8, + ValueLabelTypeMismatch, read_stata, ) @@ -435,7 +436,7 @@ def test_read_write_dta11(self): formatted = formatted.astype(np.int32) with tm.ensure_clean() as path: - with tm.assert_produces_warning(io.stata.InvalidColumnName): + with tm.assert_produces_warning(InvalidColumnName): original.to_stata(path, None) written_and_read_again = self.read_dta(path) @@ -1022,7 +1023,7 @@ def test_categorical_warnings_and_errors(self): [original[col].astype("category") for col in original], axis=1 ) - with tm.assert_produces_warning(io.stata.ValueLabelTypeMismatch): + with tm.assert_produces_warning(ValueLabelTypeMismatch): original.to_stata(path) # should get a warning for mixed content @@ -1652,7 +1653,7 @@ def test_convert_strl_name_swap(self): ) original.index.name = "index" - with tm.assert_produces_warning(io.stata.InvalidColumnName): + with tm.assert_produces_warning(InvalidColumnName): with tm.ensure_clean() as path: original.to_stata(path, convert_strl=["long", 1], version=117) reread = self.read_dta(path)