Esempio n. 1
0
 def test_is_enabled(self):
     import _vmprof
     tmpfile = open(self.tmpfilename, 'wb')
     assert _vmprof.is_enabled() is False
     _vmprof.enable(tmpfile.fileno(), 0.01, 0, 0, 0, 0)
     assert _vmprof.is_enabled() is True
     _vmprof.disable()
     assert _vmprof.is_enabled() is False
Esempio n. 2
0
def is_enabled():
    """ Indicates if vmprof has already been enabled for this process.
        Returns True or False. None is returned if the state is unknown.
    """
    if hasattr(_vmprof, 'is_enabled'):
        return _vmprof.is_enabled()
    raise NotImplementedError("is_enabled is not implemented on this platform")