File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -1985,14 +1985,11 @@ def test_n_error(self, df_strings):
1985
1985
columns_with_errors = {'category_string' , 'string' }
1986
1986
columns_without_errors = list (set (df ) - columns_with_errors )
1987
1987
for column in columns_with_errors :
1988
- with pytest .raises (TypeError ):
1989
- df .nsmallest (2 , column )
1990
- with pytest .raises (TypeError ):
1991
- df .nsmallest (2 , ['group' , column ])
1992
- with pytest .raises (TypeError ):
1993
- df .nlargest (2 , column )
1994
- with pytest .raises (TypeError ):
1995
- df .nlargest (2 , ['group' , column ])
1988
+ for columns in (column , ['group' , column ]):
1989
+ with pytest .raises (TypeError ):
1990
+ df .nsmallest (2 , columns )
1991
+ with pytest .raises (TypeError ):
1992
+ df .nlargest (2 , columns )
1996
1993
df .nsmallest (2 , columns_without_errors )
1997
1994
df .nsmallest (2 , ['int' , 'string' ]) # int column is unique => OK
1998
1995
You can’t perform that action at this time.
0 commit comments