

def test_numpy_validators_loaded_if_numpy_present(self):
    try:
        import numpy
    except ImportError:
        self.skipTest('numpy library not found.')
    import sys
    del sys.modules['numpy']
    for k in list(sys.modules):
        if k.startswith('numpy.'):
            del sys.modules[k]
    from traits.trait_types import float_fast_validate
    import numpy
    self.assertIn(numpy.floating, float_fast_validate)

dataset/ETHPy150Open enthought/traits/traits/tests/test_trait_types.py TraitTypesTest.test_numpy_validators_loaded_if_numpy_present/original