Skip to content

Commit a1a3399

Browse files
Addressed Code Checks errors
1 parent b526058 commit a1a3399

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/tests/groupby/aggregate/test_aggregate.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -886,11 +886,12 @@ def test_groupby_aggregation_empty_group():
886886
# https://github.com/pandas-dev/pandas/issues/18869
887887
def f(x):
888888
if len(x) == 0:
889-
sys.exit(1)
889+
raise ValueError("length must not be 0")
890890
return len(x)
891891

892892
df = DataFrame({"A": pd.Categorical(['a', 'a'], categories=['a', 'b', 'c']), "B": [1, 1]})
893-
with pytest.raises(SystemExit):
893+
msg = 'length must not be 0'
894+
with pytest.raises(ValueError, match=msg):
894895
df.groupby('A').agg(f)
895896

896897
def test_agg_namedtuple(self):

0 commit comments

Comments
 (0)