Known subclasses: twisted.trial.test.test_tests.AsynchronousMonkeyPatchTests, twisted.trial.test.test_tests.SynchronousMonkeyPatchTests

Tests for the patch() helper method in unittest.TestCase.

Method setUp Setup our test case
Method test_patch Calling patch() on a test monkey patches the specified object and attribute.
Method test_patchRestoredAfterRun Any monkey patches introduced by a test using patch() are reverted after the test has run.
Method test_revertDuringTest patch() return a monkey.MonkeyPatcher object that can be used to restore the original values before the end of the test.
Method test_revertAndRepatch The returned monkey.MonkeyPatcher object can re-apply the patch during the test run.
Method test_successivePatches Successive patches are applied and reverted just like a single patch.
def setUp(self):

Setup our test case

def test_patch(self):

Calling patch() on a test monkey patches the specified object and attribute.

def test_patchRestoredAfterRun(self):

Any monkey patches introduced by a test using patch() are reverted after the test has run.

def test_revertDuringTest(self):

patch() return a monkey.MonkeyPatcher object that can be used to restore the original values before the end of the test.

def test_revertAndRepatch(self):

The returned monkey.MonkeyPatcher object can re-apply the patch during the test run.

def test_successivePatches(self):

Successive patches are applied and reverted just like a single patch.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.