MCPcopy Create free account
hub / github.com/numpy/numpy / test_converters_cornercases

Method test_converters_cornercases

numpy/lib/tests/test_io.py:1587–1596  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1585 assert_equal(test, control)
1586
1587 def test_converters_cornercases(self):
1588 # Test the conversion to datetime.
1589 converter = {
1590 'date': lambda s: strptime(s, '%Y-%m-%d %H:%M:%SZ')}
1591 data = TextIO('2009-02-03 12:00:00Z, 72214.0')
1592 test = np.genfromtxt(data, delimiter=',', dtype=None,
1593 names=['date', 'stid'], converters=converter)
1594 control = np.array((datetime(2009, 2, 3), 72214.),
1595 dtype=[('date', np.object_), ('stid', float)])
1596 assert_equal(test, control)
1597
1598 def test_converters_cornercases2(self):
1599 # Test the conversion to datetime64.

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
strptimeFunction · 0.85
TextIOClass · 0.85

Tested by

no test coverage detected