diff options
| author | David Smith <smithdc@gmail.com> | 2023-02-01 07:13:39 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-02-01 11:37:29 +0100 |
| commit | 80aae8343939e849100db87b1c9615f32b38ea0b (patch) | |
| tree | 266b80026685000c0fff56a677e0f4973e1699cc /tests/cache | |
| parent | 8a7b22d4a623bcd95190d2f5a958472fb41e576d (diff) | |
[4.2.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
Diffstat (limited to 'tests/cache')
| -rw-r--r-- | tests/cache/tests.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/cache/tests.py b/tests/cache/tests.py index a01dba46d0..fcce9579d4 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)) @@ -514,23 +514,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) @@ -704,6 +704,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): @@ -802,7 +803,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)) @@ -1149,7 +1149,6 @@ class BaseCacheTests: ) ) class DBCacheTests(BaseCacheTests, TransactionTestCase): - available_apps = ["cache"] def setUp(self): @@ -1468,7 +1467,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 |
