[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.
--- 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: