def setup_class(cls): """Ensure that virtualtime is disabled when running these tests""" cls.virtual_time_enabled = virtualtime.enabled() assert not virtualtime.enabled()
def setUp(self): while virtualtime.enabled(): virtualtime.disable()
def tearDown(self): """Ensure that virtualtime is disabled after running each test""" while virtualtime.enabled(): virtualtime.disable()
def teardown_class(cls): """Ensure that virtualtime is disabled after running these tests""" del cls.virtual_time_enabled assert not virtualtime.enabled()
def teardown_class(cls): """Ensure that virtualtime was enabled when running these tests, but disabled after""" del cls.virtual_time_enabled assert virtualtime.enabled() virtualtime.disable() assert not virtualtime.enabled()
def setup_class(cls): """Ensure that virtualtime is disabled before, then enabled when running these tests""" assert not virtualtime.enabled() virtualtime.enable() cls.virtual_time_enabled = virtualtime.enabled() assert cls.virtual_time_enabled