1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

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
This commit is contained in:
David Smith
2023-02-01 07:13:39 +00:00
committed by Mariusz Felisiak
parent 8c660fb592
commit 097e3a70c1
238 changed files with 36 additions and 280 deletions

View File

@@ -319,7 +319,6 @@ class AtomicMergeTests(TransactionTestCase):
@skipUnlessDBFeature("uses_savepoints")
class AtomicErrorsTests(TransactionTestCase):
available_apps = ["transactions"]
forbidden_atomic_msg = "This is forbidden when an 'atomic' block is active."
@@ -392,7 +391,6 @@ class AtomicErrorsTests(TransactionTestCase):
@skipUnlessDBFeature("uses_savepoints")
@skipUnless(connection.vendor == "mysql", "MySQL-specific behaviors")
class AtomicMySQLTests(TransactionTestCase):
available_apps = ["transactions"]
@skipIf(threading is None, "Test requires threading")
@@ -433,7 +431,6 @@ class AtomicMySQLTests(TransactionTestCase):
class AtomicMiscTests(TransactionTestCase):
available_apps = ["transactions"]
def test_wrap_callable_instance(self):
@@ -453,13 +450,10 @@ class AtomicMiscTests(TransactionTestCase):
# Expect an error when rolling back a savepoint that doesn't exist.
# Done outside of the transaction block to ensure proper recovery.
with self.assertRaises(Error):
# Start a plain transaction.
with transaction.atomic():
# Swallow the intentional error raised in the sub-transaction.
with self.assertRaisesMessage(Exception, "Oops"):
# Start a sub-transaction with a savepoint.
with transaction.atomic():
sid = connection.savepoint_ids[-1]
@@ -470,14 +464,11 @@ class AtomicMiscTests(TransactionTestCase):
def test_mark_for_rollback_on_error_in_transaction(self):
with transaction.atomic(savepoint=False):
# Swallow the intentional error raised.
with self.assertRaisesMessage(Exception, "Oops"):
# Wrap in `mark_for_rollback_on_error` to check if the
# transaction is marked broken.
with transaction.mark_for_rollback_on_error():
# Ensure that we are still in a good state.
self.assertFalse(transaction.get_rollback())
@@ -500,11 +491,9 @@ class AtomicMiscTests(TransactionTestCase):
# Swallow the intentional error raised.
with self.assertRaisesMessage(Exception, "Oops"):
# Wrap in `mark_for_rollback_on_error` to check if the transaction
# is marked broken.
with transaction.mark_for_rollback_on_error():
# Ensure that we are still in a good state.
self.assertFalse(transaction.get_connection().needs_rollback)
@@ -519,7 +508,6 @@ class AtomicMiscTests(TransactionTestCase):
class NonAutocommitTests(TransactionTestCase):
available_apps = []
def setUp(self):