From 11bd18ec5bbb560c982f5ae3ad5460642dac4ce1 Mon Sep 17 00:00:00 2001 From: AA Turner <9087854+AA-Turner@users.noreply.github.com> Date: Fri, 26 Feb 2021 22:27:13 +0000 Subject: [PATCH] TST: Fix pandas.io.stata imports in test_stata.py --- pandas/tests/io/test_stata.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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)