Skip to content

Commit

Permalink
chore(sync): exempt a line from coverage as it can only be hit on 3.11+
Browse files Browse the repository at this point in the history
  • Loading branch information
vytas7 committed Mar 20, 2024
1 parent dd9210a commit 6141517
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions falcon/util/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,12 @@ def async_to_sync(
Keyword Args:
**kwargs: Additional args are passed through to the coroutine function.
"""
global _runner
# NOTE(vytas): Sometimes our runner's loop can get picked and consumed by
# other utilities and test methods. If that happens, recreate the runner.
global _runner
if _runner.get_loop().is_closed():
_runner = _runner_cls()
# NOTE(vytas): This condition is never hit on _DummyRunner.
_runner = _runner_cls() # pragma: nocover
return _runner.run(coroutine(*args, **kwargs))


Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ filterwarnings = [
"ignore:.cgi. is deprecated and slated for removal:DeprecationWarning",
"ignore:path is deprecated\\. Use files\\(\\) instead:DeprecationWarning",
"ignore:This process \\(.+\\) is multi-threaded",
"ignore:There is no current event loop",
]
testpaths = [
"tests"
Expand Down

0 comments on commit 6141517

Please sign in to comment.