We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent da979a9 commit 3312a12Copy full SHA for 3312a12
src/labs/broker.py
@@ -57,6 +57,14 @@
57
],
58
)
59
60
+# For testing we use the InMemory broker, this is set
61
+# if an environment variables is set, please note you
62
+# will require pytest-env for environment vars to work
63
+env = os.environ.get("ENVIRONMENT")
64
+if env and env == "pytest":
65
+ from taskiq import InMemoryBroker
66
+ broker = InMemoryBroker()
67
+
68
# The middleware is used to inject the broker into FastAPI
69
# it enables broker task discovery for FastAPI applications
70
# as well as sharing dependencies between tasks and FastAPI
0 commit comments