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

Method test_keep_default

numpy/lib/tests/test__iotools.py:224–236  ·  view source on GitHub ↗

Make sure we don't lose an explicit default

(self)

Source from the content-addressed store, hash-verified

222 assert_(hasattr(conv, 'default'))
223
224 def test_keep_default(self):
225 "Make sure we don't lose an explicit default"
226 converter = StringConverter(None, missing_values='',
227 default=-999)
228 converter.upgrade('3.14159265')
229 assert_equal(converter.default, -999)
230 assert_equal(converter.type, np.dtype(float))
231 #
232 converter = StringConverter(
233 None, missing_values='', default=0)
234 converter.upgrade('3.14159265')
235 assert_equal(converter.default, 0)
236 assert_equal(converter.type, np.dtype(float))
237
238 def test_keep_default_zero(self):
239 "Check that we don't lose a default of 0"

Callers

nothing calls this directly

Calls 4

upgradeMethod · 0.95
StringConverterClass · 0.90
assert_equalFunction · 0.90
dtypeMethod · 0.45

Tested by

no test coverage detected