diff options
Diffstat (limited to 'lib/fixtures/tests/_fixtures/test_monkeypatch.py')
-rw-r--r-- | lib/fixtures/tests/_fixtures/test_monkeypatch.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/fixtures/tests/_fixtures/test_monkeypatch.py b/lib/fixtures/tests/_fixtures/test_monkeypatch.py index b5977d3..1a84d7f 100644 --- a/lib/fixtures/tests/_fixtures/test_monkeypatch.py +++ b/lib/fixtures/tests/_fixtures/test_monkeypatch.py @@ -19,6 +19,11 @@ from fixtures import MonkeyPatch, TestWithFixtures reference = 23 +class C(object): + @staticmethod + def foo(): pass +def bar(): pass + class TestMonkeyPatch(testtools.TestCase, TestWithFixtures): def test_patch_and_restore(self): @@ -66,3 +71,13 @@ class TestMonkeyPatch(testtools.TestCase, TestWithFixtures): finally: fixture.cleanUp() self.assertFalse('new_attr' in globals()) + + def test_patch_staticmethod(self): + oldfoo = C.foo + fixture = MonkeyPatch( + 'fixtures.tests._fixtures.test_monkeypatch.C.foo', + bar) + with fixture: + pass + self.assertEqual(oldfoo, C.foo) + |