def test_spy_not_testing(self): "Trying to spy when not in testing mode" # Pretend the test ended bond_instance = bond.Bond.instance() old_test_framework_bridge = bond_instance.test_framework_bridge bond_instance.test_framework_bridge = None # We reach into the internal API self.assertFalse(bond.active()) bond.spy('first_observation', val=1) bond.spy('second_observation', val=2) # Just before the test ends, we restore current_python_test bond_instance.test_framework_bridge = old_test_framework_bridge # Has to allow the test to continue
def setUp(self): setup_bond_self_test(self, ()) self.assertTrue(bond.active())
def setUp(self): setup_bond_self_tests(self) self.assertTrue(bond.TESTING) self.assertTrue(bond.active())