ENH: Provides a more descriptive error if market_open or market_close are provided a non-keyword argument that is not a datetime.timedelta

This commit is contained in:
Joe Jevnik
2014-10-20 17:17:34 -04:00
parent 76c32f2940
commit d360b9d9bd
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -74,6 +74,11 @@ class TestUtils(TestCase):
with self.assertRaises(ValueError):
_build_offset(datetime.timedelta(minutes=1), {'minutes': 1}, None)
def test_build_offset_exc(self):
with self.assertRaises(TypeError):
# object() is not an instance of a timedelta.
_build_offset(object(), {}, None)
def test_build_offset_kwargs(self):
kwargs = {'minutes': 1}
self.assertEqual(