From 00e830080499c47a3e72f1b4adb2678758e388ee Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 17 Dec 2019 11:14:57 +0000 Subject: [PATCH] Ignore gnarly type check in WSGI implementation (#756) * Ignore gnarly type check in WSGI implementation * Linting --- starlette/middleware/wsgi.py | 2 +- tests/test_config.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/starlette/middleware/wsgi.py b/starlette/middleware/wsgi.py index f0c69c8d..b7530f45 100644 --- a/starlette/middleware/wsgi.py +++ b/starlette/middleware/wsgi.py @@ -88,7 +88,7 @@ class WSGIResponder: await run_in_threadpool(self.wsgi, environ, self.start_response) self.send_queue.append(None) self.send_event.set() - await asyncio.wait_for(sender, None) + await asyncio.wait_for(sender, None) # type: ignore if self.exc_info is not None: raise self.exc_info[0].with_traceback( self.exc_info[1], self.exc_info[2] diff --git a/tests/test_config.py b/tests/test_config.py index 6002bc1e..ae91f969 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,12 +1,11 @@ import os +from pathlib import Path import pytest from starlette.config import Config, Environ, EnvironError from starlette.datastructures import URL, Secret -from pathlib import Path - def test_config(tmpdir, monkeypatch): path = os.path.join(tmpdir, ".env") @@ -47,7 +46,7 @@ def test_config(tmpdir, monkeypatch): config.get("REQUEST_HOSTNAME", cast=bool) config = Config(Path(path)) - REQUEST_HOSTNAME= config("REQUEST_HOSTNAME") + REQUEST_HOSTNAME = config("REQUEST_HOSTNAME") assert REQUEST_HOSTNAME == "example.com" config = Config() @@ -60,6 +59,7 @@ def test_config(tmpdir, monkeypatch): with pytest.raises(ValueError): config.get("BOOL_AS_INT", cast=bool) + def test_environ(): environ = Environ()