From d1bde69c1e7505b1074f4fbd5591ac31e24dbeaa Mon Sep 17 00:00:00 2001 From: uweschmitt Date: Tue, 19 Aug 2014 12:57:37 +0200 Subject: [PATCH] added smoke test for bug fixed in 3716:dc080608b6d1 --- testing/test_capture.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testing/test_capture.py b/testing/test_capture.py index 28199fb91..6ddbf7e6e 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -1,6 +1,7 @@ # note: py.io capture tests where copied from # pylib 1.4.20.dev2 (rev 13d9af95547e) from __future__ import with_statement +import cPickle import os import sys import py @@ -1022,3 +1023,12 @@ def test_error_attribute_issue555(testdir): """) reprec = testdir.inline_run() 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)