Skip to content

Commit 4bc1f04

Browse files
committed
refactor
1 parent b20ab3a commit 4bc1f04

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

python/pyspark/tests.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,15 +205,11 @@ def __getattr__(self, item):
205205
getter2 = ser.loads(ser.dumps(getter))
206206
self.assertEqual(getter(d), getter2(d))
207207

208-
209-
# Regression test for SPARK-3415
210-
class CloudPickleTest(unittest.TestCase):
208+
# Regression test for SPARK-3415
211209
def test_pickling_file_handles(self):
212-
from pyspark.cloudpickle import dumps
213-
from StringIO import StringIO
214-
from pickle import load
210+
ser = CloudPickleSerializer()
215211
out1 = sys.stderr
216-
out2 = load(StringIO(dumps(out1)))
212+
out2 = ser.loads(ser.dumps(out1))
217213
self.assertEquals(out1, out2)
218214

219215

0 commit comments

Comments
 (0)