-
-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pickling instances of nested classes fails in unittest.TestCase
for Python 2.7 and 3.4
#262
Comments
I have a similar issue. I am consider using import dill
class Type(enum.Enum):
class Subtype(enum.Enum):
D = 4
E = 54
F = 4
A = 0
B = 1
C = 3
class SomeClass:
def __init__(self):
self.type = Type.Subtype.value.E
sc = SomeClass()
with open('scsc', 'wb') as f:
dill.dump(sc, f) |
dill.dumps on the sc SomeClass object from the above comment gives me the following traceback Traceback (most recent call last): |
@kurt-rhee: please see my comment in #435 with regard to your traceback |
@aleneum: Not sure why this issue was ignored... but I am seeing the same behavior for nosetests on python2.7 (which will see EOL support this year), and not when run manually. Python3.4 is no longer supported. |
No worries, I dealt with it quite a while ago. This issue can be closed if there is no objection. |
closing. Other comments posted in this issue should be resolved in the other above-noted issues. |
The code below throws a
for Python 2.7.14_3 und 3.4.8 but not for 3.5.5 and 3.6.4 (3.3.x untested).
Interestingly, the error appears only in unit tests executed with
nostetests
. WhenDillTest
is derived fromobject
andsetUp
andtest_pickle_model
are executed manually, there is no issue.dill version is
0.2.7.1
installed via pip.trace
Update 16.04.2018: Simplified a bit.
The text was updated successfully, but these errors were encountered: