# HG changeset patch # User Rémi Cardona # Date 1442851462 -7200 # Node ID 1d0b5aef7523aa21472112ed988583d3bc46854e # Parent e9abbaa835f5c82dde95df5a68245d2e32168687 [tests] Stop counting pickle bytes in ResultSet tests Between python 2's pickle and cPickle implementations, the various protocol versions added in python 3, the length of the pickled string is completely unpredictable. Instead, do a simple round trip and test a few attributes. diff -r e9abbaa835f5 -r 1d0b5aef7523 test/unittest_rset.py --- a/test/unittest_rset.py Mon Sep 21 17:54:15 2015 +0200 +++ b/test/unittest_rset.py Mon Sep 21 18:04:22 2015 +0200 @@ -101,9 +101,11 @@ def test_pickle(self): del self.rset.req - # 373 for python 2.7's cPickle - # 376 for the old python pickle implementation - self.assertIn(len(pickle.dumps(self.rset)), (373, 376)) + rs2 = pickle.loads(pickle.dumps(self.rset)) + self.assertEqual(self.rset.rows, rs2.rows) + self.assertEqual(self.rset.rowcount, rs2.rowcount) + self.assertEqual(self.rset.rql, rs2.rql) + self.assertEqual(self.rset.description, rs2.description) def test_build_url(self): with self.admin_access.web_request() as req: