Unable to mock old-style classes
Bug #702020 reported by
Giles Brown
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mocker |
Won't Fix
|
Undecided
|
Gustavo Niemeyer |
Bug Description
import unittest
import mocker
class OldStyle: pass
class NewStyle(object): pass
class TestCase(
def test_new_
mockedclass = self.mocker.
obj = NewStyle()
def test_old_
mockedclass = self.mocker.
obj = OldStyle()
if __name__ == '__main__':
unittest.main()
~
To post a comment you must log in.
The way in which Mocker works internally depends on new style classes for these features. Given that old style
classes are *really* old, and already went away entirely in the 3.X releases, this won't be changed.