1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
From: Kovid Goyal <kovid@kovidgoyal.net>
Date: Tue, 24 May 2022 17:54:50 +0530
Subject: DRYer
---
test/test_cookies.py | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/test/test_cookies.py b/test/test_cookies.py
index e699e3e..20055d8 100644
--- a/test/test_cookies.py
+++ b/test/test_cookies.py
@@ -1025,14 +1025,9 @@ class CookieTests(unittest.TestCase):
# sequential iteration
for i in range(4):
- i = 0
- for c in cs:
+ for c, expected in zip(cs, zip(versions, names, domains, paths)):
# assert isinstance(c, Cookie)
- self.assertEqual(c.version, versions[i])
- self.assertEqual(c.name, names[i])
- self.assertEqual(c.domain, domains[i])
- self.assertEqual(c.path, paths[i])
- i = i + 1
+ self.assertEqual((c.version, c.name, c.domain, c.path), expected)
self.assertRaises(IndexError, lambda cs=cs: cs[5])
|