starlette/tests
Thomas Grainger 254d0d97e4
ensure TestClient requests run in the same EventLoop as lifespan (#1213)
* ensure TestClient requests run in the same EventLoop as lifespan

* for lifespan task verification, use native task identity rather than anyio.abc.TaskInfo equality

https://github.com/agronholm/anyio/issues/324

* remove redundant pragma: no cover

* it's now a loop_id not a threading.ident

* replace Protocol with plain Callable TypeAlias

* use lifespan_context to actually open a task group

trio should complain if used incorrectly here.

* assign self.portal once, schedule reset immediately after assignment

* inline apps into their tests

* make task/loop trackers nonlocals
2021-07-03 17:39:25 +01:00
..
middleware TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
statics Staticfiles packages (#415) 2019-02-26 14:38:05 +00:00
__init__.py Staticfiles packages (#415) 2019-02-26 14:38:05 +00:00
conftest.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_applications.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_authentication.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_background.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_concurrency.py anyio integration (#1157) 2021-06-18 15:48:43 +01:00
test_config.py Ignore gnarly type check in WSGI implementation (#756) 2019-12-17 11:14:57 +00:00
test_database.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_datastructures.py anyio integration (#1157) 2021-06-18 15:48:43 +01:00
test_endpoints.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_exceptions.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_formparsers.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_graphql.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_requests.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_responses.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_routing.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_schemas.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_staticfiles.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_templates.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00
test_testclient.py ensure TestClient requests run in the same EventLoop as lifespan (#1213) 2021-07-03 17:39:25 +01:00
test_websockets.py TestClient accepts backend and backend_options as arguments to constructor (#1211) 2021-06-28 21:36:13 +01:00