Skip to content

Commit f2e80f6

Browse files
hramezanibluetech
authored andcommitted
Fix isort errors.
1 parent d74114e commit f2e80f6

16 files changed

+41
-48
lines changed

pytest_django/asserts.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"""
22
Dynamically load all Django assertion cases and expose them for importing.
33
"""
4-
from typing import Any, Callable, Optional, Sequence, Set, Union
54
from functools import wraps
5+
from typing import Any, Callable, Optional, Sequence, Set, Union
66

77
from django.test import (
8-
TestCase, SimpleTestCase,
9-
LiveServerTestCase, TransactionTestCase
8+
LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase,
109
)
1110

1211
TYPE_CHECKING = False

pytest_django/fixtures.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
"""All pytest-django fixtures"""
2-
from typing import Any, Callable, Generator, Iterable, List, Optional, Tuple, Union
32
import os
43
from contextlib import contextmanager
54
from functools import partial
5+
from typing import (
6+
Any, Callable, Generator, Iterable, List, Optional, Tuple, Union,
7+
)
68

79
import pytest
810

911
from . import live_server_helper
1012
from .django_compat import is_django_unittest
11-
from .lazy_django import skip_if_no_django, get_django_version
13+
from .lazy_django import get_django_version, skip_if_no_django
1214

1315
TYPE_CHECKING = False
1416
if TYPE_CHECKING:
@@ -155,8 +157,8 @@ def _django_db_fixture_helper(
155157
django_db_blocker.unblock()
156158
request.addfinalizer(django_db_blocker.restore)
157159

158-
import django.test
159160
import django.db
161+
import django.test
160162

161163
if transactional:
162164
test_case_class = django.test.TransactionTestCase

pytest_django/lazy_django.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
22
Helpers to load Django lazily when Django settings can't be configured.
33
"""
4-
from typing import Any, Tuple
54
import os
65
import sys
6+
from typing import Any, Tuple
77

88
import pytest
99

pytest_django/live_server_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict, Any
1+
from typing import Any, Dict
22

33

44
class LiveServer:

pytest_django/plugin.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,42 @@
44
test database and provides some useful text fixtures.
55
"""
66

7-
from typing import Generator, List, Optional, Tuple, Union
87
import contextlib
98
import inspect
10-
from functools import reduce
119
import os
1210
import pathlib
1311
import sys
12+
from functools import reduce
13+
from typing import Generator, List, Optional, Tuple, Union
1414

1515
import pytest
1616

1717
from .django_compat import is_django_unittest # noqa
18-
from .fixtures import django_assert_num_queries # noqa
19-
from .fixtures import django_assert_max_num_queries # noqa
20-
from .fixtures import django_db_setup # noqa
21-
from .fixtures import django_db_use_migrations # noqa
22-
from .fixtures import django_db_keepdb # noqa
23-
from .fixtures import django_db_createdb # noqa
24-
from .fixtures import django_db_modify_db_settings # noqa
25-
from .fixtures import django_db_modify_db_settings_parallel_suffix # noqa
26-
from .fixtures import django_db_modify_db_settings_tox_suffix # noqa
27-
from .fixtures import django_db_modify_db_settings_xdist_suffix # noqa
28-
from .fixtures import django_capture_on_commit_callbacks # noqa
2918
from .fixtures import _live_server_helper # noqa
3019
from .fixtures import admin_client # noqa
3120
from .fixtures import admin_user # noqa
3221
from .fixtures import async_client # noqa
22+
from .fixtures import async_rf # noqa
3323
from .fixtures import client # noqa
3424
from .fixtures import db # noqa
25+
from .fixtures import django_assert_max_num_queries # noqa
26+
from .fixtures import django_assert_num_queries # noqa
27+
from .fixtures import django_capture_on_commit_callbacks # noqa
28+
from .fixtures import django_db_createdb # noqa
29+
from .fixtures import django_db_keepdb # noqa
30+
from .fixtures import django_db_modify_db_settings # noqa
31+
from .fixtures import django_db_modify_db_settings_parallel_suffix # noqa
32+
from .fixtures import django_db_modify_db_settings_tox_suffix # noqa
33+
from .fixtures import django_db_modify_db_settings_xdist_suffix # noqa
34+
from .fixtures import django_db_reset_sequences # noqa
35+
from .fixtures import django_db_setup # noqa
36+
from .fixtures import django_db_use_migrations # noqa
3537
from .fixtures import django_user_model # noqa
3638
from .fixtures import django_username_field # noqa
3739
from .fixtures import live_server # noqa
38-
from .fixtures import django_db_reset_sequences # noqa
39-
from .fixtures import async_rf # noqa
4040
from .fixtures import rf # noqa
4141
from .fixtures import settings # noqa
4242
from .fixtures import transactional_db # noqa
43-
4443
from .lazy_django import django_settings_is_configured, skip_if_no_django
4544

4645
TYPE_CHECKING = False
@@ -416,7 +415,9 @@ def django_test_environment(request) -> None:
416415
"""
417416
if django_settings_is_configured():
418417
_setup_django()
419-
from django.test.utils import setup_test_environment, teardown_test_environment
418+
from django.test.utils import (
419+
setup_test_environment, teardown_test_environment,
420+
)
420421

421422
debug_ini = request.config.getini("django_debug_mode")
422423
if debug_ini == "keep":

pytest_django_test/db_helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import os
2-
import subprocess
32
import sqlite3
3+
import subprocess
44

55
import pytest
6-
76
from django.conf import settings
87
from django.utils.encoding import force_str
98

10-
119
# Construct names for the "inner" database used in runpytest tests
1210
_settings = settings.DATABASES["default"]
1311

pytest_django_test/settings_mysql_innodb.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from .settings_base import * # noqa: F401 F403
44

5-
65
DATABASES = {
76
"default": {
87
"ENGINE": "django.db.backends.mysql",

pytest_django_test/settings_mysql_myisam.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from .settings_base import * # noqa: F401 F403
44

5-
65
DATABASES = {
76
"default": {
87
"ENGINE": "django.db.backends.mysql",

pytest_django_test/settings_sqlite.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from .settings_base import * # noqa: F401 F403
22

3-
43
DATABASES = {
54
"default": {
65
"ENGINE": "django.db.backends.sqlite3",

pytest_django_test/urls_overridden.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from django.urls import path
21
from django.http import HttpResponse
2+
from django.urls import path
33

44
urlpatterns = [
55
path("overridden_url/", lambda r: HttpResponse("Overridden urlconf works!"))

0 commit comments

Comments
 (0)