Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 27, 2022
1 parent c5f1aba commit 8dff097
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 7 additions & 1 deletion tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,14 @@ def _(cache=cache):
assert result == TestResult(t, outcome=TestOutcome.DRYRUN)


@test("Test.run with async_library set as curio works", tags=["curio"], async_library="curio")
@test(
"Test.run with async_library set as curio works",
tags=["curio"],
async_library="curio",
)
async def _(cache=cache):
import curio # type: ignore

assert curio.meta.curio_running()


Expand Down Expand Up @@ -200,6 +205,7 @@ async def func():
def _(cache=cache):
async def func():
import curio # type: ignore

assert curio.meta.curio_running()

t = Test(fn=func, module_name=mod, async_library="curio")
Expand Down
6 changes: 2 additions & 4 deletions ward/_collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ def _build_package_data(module: ModuleType) -> PackageData:


def get_tests_in_modules(
modules: Iterable,
capture_output: bool = True,
async_library: str = "asyncio"
modules: Iterable, capture_output: bool = True, async_library: str = "asyncio"
) -> List[Test]:
tests = []
for mod in modules:
Expand All @@ -189,7 +187,7 @@ def get_tests_in_modules(
description=meta.description or "",
capture_output=capture_output,
tags=meta.tags or [],
async_library=meta.async_library or async_library
async_library=meta.async_library or async_library,
)
)
return tests
Expand Down
4 changes: 1 addition & 3 deletions ward/_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ def generate_test_runs(
yield test.fail_with_error(e)
continue
for generated_test in generated_tests:
result = generated_test.run(
self.cache, dry_run=dry_run
)
result = generated_test.run(self.cache, dry_run=dry_run)
teardown_results: List[
TeardownResult
] = self.cache.teardown_fixtures_for_scope(
Expand Down

0 comments on commit 8dff097

Please sign in to comment.