Skip to content

Commit 2a8f098

Browse files
author
tp
committed
changed tests to have ordered arguments for TimeGrouper
1 parent 236b12d commit 2a8f098

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

pandas/tests/groupby/test_groupby.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,8 @@ def test_grouper_repr(self):
136136
assert result == "Grouper(key='A')"
137137

138138
result = repr(pd.Grouper(key='key', freq='50Min', label='right'))
139-
cls_name_result, attrib_result = result.split('(')
140-
attrib_result = set(attrib_result.rstrip(')').split(', '))
141-
assert cls_name_result == 'TimeGrouper'
142-
assert attrib_result == {"key='key'", "freq='50T'", "label='right'"}
139+
expected = "TimeGrouper(key='key', freq='50T', label='right')"
140+
assert result == expected
143141

144142
def test_grouper_multilevel_freq(self):
145143

pandas/tests/test_resample.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,10 +3160,8 @@ def setup_method(self, method):
31603160
def test_timegrouper_repr(self):
31613161
# Added in GH17727
31623162
result = repr(TimeGrouper(key='key', freq='50Min', label='right'))
3163-
cls_name_result, attrib_result = result.split('(')
3164-
attrib_result = set(attrib_result.rstrip(')').split(', '))
3165-
assert cls_name_result == 'TimeGrouper'
3166-
assert attrib_result == {"key='key'", "freq='50T'", "label='right'"}
3163+
expected = "TimeGrouper(key='key', freq='50T', label='right')"
3164+
assert result == expected
31673165

31683166
def test_apply(self):
31693167
with tm.assert_produces_warning(FutureWarning,

0 commit comments

Comments
 (0)