@@ -1165,28 +1165,13 @@ def test_categorical_writing(self, version, temp_file):
11651165
11661166 def test_categorical_warnings_and_errors (self , temp_file ):
11671167 # Warning for non-string labels
1168- # Error for labels too long
1169- original = DataFrame .from_records (
1170- [["a" * 10000 ], ["b" * 10000 ], ["c" * 10000 ], ["d" * 10000 ]],
1171- columns = ["Too_long" ],
1172- )
1173-
1174- original = original .astype ("category" )
1175- path = temp_file
1176- msg = (
1177- "Stata value labels for a single variable must have "
1178- r"a combined length less than 32,000 characters\."
1179- )
1180- with pytest .raises (ValueError , match = msg ):
1181- original .to_stata (path )
1182-
11831168 original = DataFrame .from_records (
11841169 [["a" ], ["b" ], ["c" ], ["d" ], [1 ]], columns = ["Too_long" ]
11851170 ).astype ("category" )
11861171
11871172 msg = "data file created has not lost information due to duplicate labels"
11881173 with tm .assert_produces_warning (ValueLabelTypeMismatch , match = msg ):
1189- original .to_stata (path )
1174+ original .to_stata (temp_file )
11901175 # should get a warning for mixed content
11911176
11921177 @pytest .mark .parametrize ("version" , [114 , 117 , 118 , 119 , None ])
0 commit comments