Skip to content

Commit 68b0cdd

Browse files
committed
refac: isort, flatten imports
1 parent ccfd329 commit 68b0cdd

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

pytest_asyncio_cooperative/fixtures.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import asyncio
22
import inspect
3-
from typing import List, Union
4-
5-
from _pytest.fixtures import (
6-
FixtureDef,
7-
FixtureRequest,
8-
FuncFixtureInfo,
9-
resolve_fixture_function,
10-
)
3+
from typing import List
4+
from typing import Union
5+
6+
from _pytest.fixtures import FixtureDef
7+
from _pytest.fixtures import FixtureRequest
8+
from _pytest.fixtures import FuncFixtureInfo
9+
from _pytest.fixtures import resolve_fixture_function
1110
from _pytest.nodes import Item
1211

1312

pytest_asyncio_cooperative/plugin.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import threading
21
import asyncio
32
import collections.abc
43
import functools
54
import inspect
5+
import threading
66
import time
77
from sys import version_info as sys_version_info
88

99
import pytest
10-
11-
from _pytest.runner import call_and_report
12-
from _pytest.skipping import Skip, evaluate_skip_marks
10+
from _pytest.skipping import Skip
11+
from _pytest.skipping import evaluate_skip_marks
1312

1413
from .assertion import activate_assert_rewrite
1514
from .fixtures import fill_fixtures
@@ -297,23 +296,25 @@ async def run_tests(tasks, max_tasks: int):
297296
def wrap_in_sync():
298297
def sync_wrapper():
299298
new_task = item_to_task(item)
300-
299+
301300
# We use a new thread because we can't block for an async function
302301
# in the same thread as the current running event loop, nor
303302
# we can nest event loops
304303
result = None
304+
305305
def run_in_thread():
306306
nonlocal result
307307
try:
308308
result = asyncio.run(new_task)
309309
except Exception as e:
310310
result = e
311+
311312
thread = threading.Thread(target=run_in_thread)
312313
thread.start()
313314
thread.join()
314315

315316
if isinstance(result, Exception):
316-
raise result # type: ignore
317+
raise result # type: ignore
317318

318319
return result
319320

0 commit comments

Comments
 (0)