def test_simple(self): # Import some stdlib module that has not been imported before module_name = 'colorsys' if module_name in sys.modules: # May have been imported during test discovery, remove it again del sys.modules[module_name] assert module_name not in sys.modules colorsys = LazyModule(module_name) hsv = colorsys.rgb_to_hsv(.3, .4, .2) self.assertEqual(hsv[0], 0.25)
def test_simple(self): # Import some stdlib module that has not been imported before self.assertNotIn("colorsys", sys.modules) colorsys = LazyModule("colorsys") hsv = colorsys.rgb_to_hsv(.3, .4, .2) self.assertEqual(hsv[0], 0.25)