Skip to content

Instantly share code, notes, and snippets.

@bkabrda
Created February 12, 2012 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkabrda/1810789 to your computer and use it in GitHub Desktop.
Save bkabrda/1810789 to your computer and use it in GitHub Desktop.
flexmock reproducer
from flexmock import flexmock
import unittest
class A:
def x(self):
return 'a'
class B(A):
def x(self):
return 'b'
class TC(unittest.TestCase):
def setUp(self):
self.b = B()
def test_1(self):
flexmock(B).should_receive('x').and_return('1')
print self.b.x()
def test_2(self):
print self.b.x()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment