added smoke test for bug fixed in 3716:dc080608b6d1

This commit is contained in:
uweschmitt 2014-08-19 12:57:37 +02:00
parent 224b3a2eda
commit d1bde69c1e
1 changed files with 10 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# note: py.io capture tests where copied from # note: py.io capture tests where copied from
# pylib 1.4.20.dev2 (rev 13d9af95547e) # pylib 1.4.20.dev2 (rev 13d9af95547e)
from __future__ import with_statement from __future__ import with_statement
import cPickle
import os import os
import sys import sys
import py import py
@ -1022,3 +1023,12 @@ def test_error_attribute_issue555(testdir):
""") """)
reprec = testdir.inline_run() reprec = testdir.inline_run()
reprec.assertoutcome(passed=1) reprec.assertoutcome(passed=1)
def test_pickling_and_unpickling_enocded_file():
# see
# https://bitbucket.org/hpk42/pytest/pull-request/194/fixed-strange-infinite-recursion-bug/diff
ef = capture.EncodedFile(None, None)
ef_as_str = cPickle.dumps(ef)
# this raises infinite recursion if EncodedFile.__getattr__ is not implemented properly:
cPickle.loads(ef_as_str)