Skip to content

TST: Add tests for old issues 2 #41493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 19, 2021
Prev Previous commit
Next Next commit
Ensure fixture is used
  • Loading branch information
mroeschke committed May 16, 2021
commit 239a2db32acb293f0a89adf5bc280d5e985a22d9
7 changes: 4 additions & 3 deletions pandas/tests/frame/methods/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,11 @@ def test_diff_readonly(self):
expected = DataFrame(np.array(df)).diff()
tm.assert_frame_equal(result, expected)

def test_diff_all_int_dtype(self, any_int_or_nullable_int_dtype):
def test_diff_all_int_dtype(self, any_int_dtype):
# GH 14773
df = DataFrame(range(5))
df = df.astype(np.int8)
df = df.astype(any_int_dtype)
result = df.diff()
expected = DataFrame([np.nan, 1.0, 1.0, 1.0, 1.0], dtype="float32")
expected_dtype = "float32" if any_int_dtype in ("int8", "int16") else "float64"
expected = DataFrame([np.nan, 1.0, 1.0, 1.0, 1.0], dtype=expected_dtype)
tm.assert_frame_equal(result, expected)