Skip to content

Commit

Permalink
TST: Correct tests using np.timedelta64
Browse files Browse the repository at this point in the history
The second argument is positional and not keyword. Numpy v1.19.0
complains.
  • Loading branch information
has2k1 committed Oct 28, 2020
1 parent 3eb9eeb commit 6dcffd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mizani/tests/test_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def diff(x):
diff(result) == diff(limits) + 30*one_day

# timedelta64
one_day = np.timedelta64(1, unit='D')
one_day = np.timedelta64(1, 'D')
limits = np.timedelta64(1, 'D'), np.timedelta64(10, 'D')
result = expand_range(limits, add=one_day, zero_width=30*one_day)
diff(result) == diff(limits) + 2*one_day
Expand Down
2 changes: 1 addition & 1 deletion mizani/tests/test_breaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_timedelta_breaks():
minutes, [0, 2, 4, 6, 8])

# numpy
x = [np.timedelta64(i*10, unit='D') for i in range(1, 10)]
x = [np.timedelta64(i*10, 'D') for i in range(1, 10)]
limits = min(x), max(x)
with pytest.raises(ValueError):
breaks(limits)
Expand Down

0 comments on commit 6dcffd6

Please sign in to comment.