From cc315925802a2779c9dffd215e2cf4721befbae3 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 6 Jul 2025 12:49:06 -0500 Subject: [PATCH] fix: allow config injection for sake of tests now that wuttaweb sort of expects a db connection on startup --- pyproject.toml | 2 +- src/sideshow/web/app.py | 8 ++++---- tests/web/test_app.py | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cd2a48b..71e5b41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ classifiers = [ license = {text = "GNU General Public License v3+"} requires-python = ">= 3.8" dependencies = [ - "WuttaWeb>=0.21.5", + "WuttaWeb>=0.22.0", ] [project.optional-dependencies] diff --git a/src/sideshow/web/app.py b/src/sideshow/web/app.py index 77c28ab..ab79f4e 100644 --- a/src/sideshow/web/app.py +++ b/src/sideshow/web/app.py @@ -47,15 +47,15 @@ def main(global_config, **settings): return pyramid_config.make_wsgi_app() -def make_wsgi_app(): +def make_wsgi_app(config=None): """ Make and return the WSGI app (generic entry point). """ - return base.make_wsgi_app(main) + return base.make_wsgi_app(main, config=config) -def make_asgi_app(): +def make_asgi_app(config=None): """ Make and return the ASGI app. """ - return base.make_asgi_app(main) + return base.make_asgi_app(main, config=config) diff --git a/tests/web/test_app.py b/tests/web/test_app.py index 65fa013..84cddfc 100644 --- a/tests/web/test_app.py +++ b/tests/web/test_app.py @@ -17,15 +17,15 @@ class TestMain(DataTestCase): self.assertIsInstance(app, Router) -class TestMakeWsgiApp(TestCase): +class TestMakeWsgiApp(DataTestCase): def test_coverage(self): - app = mod.make_wsgi_app() + app = mod.make_wsgi_app(config=self.config) self.assertIsInstance(app, Router) -class TestMakeAsgiApp(TestCase): +class TestMakeAsgiApp(DataTestCase): def test_coverage(self): - app = mod.make_asgi_app() + app = mod.make_asgi_app(config=self.config) self.assertIsInstance(app, WsgiToAsgi)