From e565a5cd187197a6349e55d7a4c68a9e12e2fd20 Mon Sep 17 00:00:00 2001 From: David Smith Date: Wed, 1 Feb 2023 07:13:39 +0000 Subject: [4.0.x] Refs #33476 -- Applied Black's 2023 stable style. Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0 Backport of 097e3a70c1481ee7b042b2edd91b2be86fb7b5b6 from main. --- tests/cache/tests.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tests/cache/tests.py') diff --git a/tests/cache/tests.py b/tests/cache/tests.py index ab276eaea3..149c4bf330 100644 --- a/tests/cache/tests.py +++ b/tests/cache/tests.py @@ -209,7 +209,7 @@ class DummyCacheTests(SimpleTestCase): "Iñtërnâtiônàlizætiøn": "Iñtërnâtiônàlizætiøn2", "ascii2": {"x": 1}, } - for (key, value) in stuff.items(): + for key, value in stuff.items(): with self.subTest(key=key): cache.set(key, value) self.assertIsNone(cache.get(key)) @@ -524,23 +524,23 @@ class BaseCacheTests: "ascii2": {"x": 1}, } # Test `set` - for (key, value) in stuff.items(): + for key, value in stuff.items(): with self.subTest(key=key): cache.set(key, value) self.assertEqual(cache.get(key), value) # Test `add` - for (key, value) in stuff.items(): + for key, value in stuff.items(): with self.subTest(key=key): self.assertIs(cache.delete(key), True) self.assertIs(cache.add(key, value), True) self.assertEqual(cache.get(key), value) # Test `set_many` - for (key, value) in stuff.items(): + for key, value in stuff.items(): self.assertIs(cache.delete(key), True) cache.set_many(stuff) - for (key, value) in stuff.items(): + for key, value in stuff.items(): with self.subTest(key=key): self.assertEqual(cache.get(key), value) @@ -708,6 +708,7 @@ class BaseCacheTests: portable caching code without making it too difficult to use production backends with more liberal key rules. Refs #6447. """ + # mimic custom ``make_key`` method being defined since the default will # never show the below warnings def func(key, *args): @@ -806,7 +807,6 @@ class BaseCacheTests: self.assertIsNone(caches["v2"].get("answer4", version=2)) def test_cache_versioning_add(self): - # add, default version = 1, but manually override version = 2 self.assertIs(cache.add("answer1", 42, version=2), True) self.assertIsNone(cache.get("answer1", version=1)) @@ -1168,7 +1168,6 @@ class BaseCacheTests: ) ) class DBCacheTests(BaseCacheTests, TransactionTestCase): - available_apps = ["cache"] def setUp(self): @@ -1471,7 +1470,6 @@ redis_excluded_caches = {"cull", "zero_cull"} class BaseMemcachedTests(BaseCacheTests): - # By default it's assumed that the client doesn't clean up connections # properly, in which case the backend must do so after each request. should_disconnect_on_close = True -- cgit v1.3