sys.just_once

Here are the examples of the python api sys.just_once taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

Example 1

Project: astroid Source File: unittest_modutils.py
    def test_do_not_load_twice(self):
        modutils.load_module_from_modpath(['data', 'lmfp', 'foo'])
        modutils.load_module_from_modpath(['data', 'lmfp'])
        # pylint: disable=no-member; just-once is added by a test file dynamically.
        self.assertEqual(len(sys.just_once), 1)
        del sys.just_once