diff --git a/falcon/util/sync.py b/falcon/util/sync.py index 8065f0c51..38b2bd5d1 100644 --- a/falcon/util/sync.py +++ b/falcon/util/sync.py @@ -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)) diff --git a/pyproject.toml b/pyproject.toml index ad445ce55..5ed0c5fab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"