Test added by default · pandas-dev/pandas@ee7b457 (original) (raw)

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
1 +import subprocess
1 2 import pytest
2 3 from datetime import datetime, date
3 4
@@ -20,6 +21,15 @@ def test_timtetonum_accepts_unicode():
20 21
21 22 class TestRegistration(object):
22 23
24 +def test_register_by_default(self):
25 +# Run in subprocess to ensure a clean state
26 +code = ("'import matplotlib.units; "
27 +"import pandas as pd; "
28 +"units = dict(matplotlib.units.registry); "
29 +"assert pd.Timestamp in units)'")
30 +call = ['python', '-c', code]
31 +assert subprocess.check_call(call) == 0
32 +
23 33 def test_warns(self):
24 34 plt = pytest.importorskip("matplotlib.pyplot")
25 35 s = Series(range(12), index=date_range('2017', periods=12))