Open
Description
In enforcing the numeric_only / silent dropping of nuisance columns deprecations for 2.0, many of our tests now have the following pattern:
df = pd.DataFrame({'a': [1, 2, 3], 'b': ['x', 'y', 'z']})
with pytest.raises(TypeError, match=...):
df.mean()
result = df.mean(numeric_only=True)
expected = ...
tm.assert_series_equal(result, expected)
I think it would be better to consolidate these into a small group of tests, something like test_op_raises_on_invalid_type
, and remove the invalid types from the remainder of the tests.
cc @mroeschke