File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
- """
1
+ """ Configuration required for tests to run
2
+
3
+ Note that fastapi makes available a test client that can be used to
4
+ test the API endpoints. This will call the endpoints internally.
2
5
6
+ For the taskiq to work we have configured it to use the InMemoryBroker
7
+ otherwise it will try to connect to a redis server.
8
+
9
+ Please note you will require pytest-env for the environment variables
10
+ to work which are set via pyproject.toml
3
11
"""
4
12
import pytest
5
13
14
+
6
15
@pytest .fixture (scope = 'session' )
7
16
def test_client ():
8
17
from fastapi .testclient import TestClient
9
18
from labs .api import app
10
19
return TestClient (app )
20
+
21
+
22
+ @pytest .fixture
23
+ def anyio_backend ():
24
+ """ Since taskiq is fully async, we suggest using anyio
25
+
26
+ See configuration described in the docs:
27
+ https://taskiq-python.github.io/guide/testing-taskiq.html#async-tests
28
+ """
29
+ return 'asyncio'
You can’t perform that action at this time.
0 commit comments