Skip to content

Commit 1628c8f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e9b389e commit 1628c8f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

debug_toolbar/middleware.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,6 @@ def _check_async_request(self, request) -> bool:
139139

140140
@staticmethod
141141
def _show_async_request_is_not_supported():
142-
print('-' * 10)
143-
print('Be caution, django-debug-toolbar does not support async requests!')
144-
print('-' * 10)
142+
print("-" * 10)
143+
print("Be caution, django-debug-toolbar does not support async requests!")
144+
print("-" * 10)

tests/test_integration.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -797,16 +797,17 @@ def test_ajax_refresh(self):
797797

798798

799799
@unittest.skipUnless(
800-
AsyncRequestFactory is not None, "Test valid only for django with async requests"
800+
AsyncRequestFactory is not None, "Test valid only for django with async requests"
801801
)
802802
@override_settings(DEBUG=True)
803803
class DebugToolbarAsyncTestCase(BaseTestCase):
804-
805804
@classmethod
806805
def setUpClass(cls):
807806
super().setUpClass()
808807
cls.async_rf = AsyncRequestFactory()
809-
cls.simple_get_response = lambda *args, **kwargs: HttpResponse("<html><body></body></html>")
808+
cls.simple_get_response = lambda *args, **kwargs: HttpResponse(
809+
"<html><body></body></html>"
810+
)
810811
cls._default_stdout = sys.stdout
811812

812813
def setUp(self):
@@ -823,14 +824,16 @@ def test_do_not_render_toolbar_if_it_was_async_request(self):
823824
captured_output = io.StringIO()
824825
sys.stdout = captured_output
825826

826-
request = self.async_rf.get('/')
827+
request = self.async_rf.get("/")
827828
response = DebugToolbarMiddleware(self.simple_get_response)(request)
828829

829830
self.assertEqual(response.content, b"<html><body></body></html>")
830831

831832
def test_prints_warning_async_is_not_supported(self):
832-
request = self.async_rf.get('/')
833+
request = self.async_rf.get("/")
833834
DebugToolbarMiddleware(self.simple_get_response)(request)
834835

835-
assert self.captured_output.getvalue() == "----------\nBe caution, django-debug-toolbar does not support async requests!\n----------\n"
836-
836+
assert (
837+
self.captured_output.getvalue()
838+
== "----------\nBe caution, django-debug-toolbar does not support async requests!\n----------\n"
839+
)

0 commit comments

Comments
 (0)