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

Method test_converters_cornercases2

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

Source from the content-addressed store, hash-verified

1596 assert_equal(test, control)
1597
1598 def test_converters_cornercases2(self):
1599 # Test the conversion to datetime64.
1600 converter = {
1601 'date': lambda s: np.datetime64(strptime(s, '%Y-%m-%d %H:%M:%SZ'))}
1602 data = TextIO('2009-02-03 12:00:00Z, 72214.0')
1603 test = np.genfromtxt(data, delimiter=',', dtype=None,
1604 names=['date', 'stid'], converters=converter)
1605 control = np.array((datetime(2009, 2, 3), 72214.),
1606 dtype=[('date', 'datetime64[us]'), ('stid', float)])
1607 assert_equal(test, control)
1608
1609 def test_unused_converter(self):
1610 # Test whether unused converters are forgotten

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
strptimeFunction · 0.85
TextIOClass · 0.85

Tested by

no test coverage detected