fix: allow config injection for sake of tests

now that wuttaweb sort of expects a db connection on startup
This commit is contained in:
Lance Edgar 2025-07-06 12:49:06 -05:00
parent 36ec626c7f
commit cc31592580
3 changed files with 9 additions and 9 deletions

View file

@ -32,7 +32,7 @@ classifiers = [
license = {text = "GNU General Public License v3+"} license = {text = "GNU General Public License v3+"}
requires-python = ">= 3.8" requires-python = ">= 3.8"
dependencies = [ dependencies = [
"WuttaWeb>=0.21.5", "WuttaWeb>=0.22.0",
] ]
[project.optional-dependencies] [project.optional-dependencies]

View file

@ -47,15 +47,15 @@ def main(global_config, **settings):
return pyramid_config.make_wsgi_app() 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). 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. Make and return the ASGI app.
""" """
return base.make_asgi_app(main) return base.make_asgi_app(main, config=config)

View file

@ -17,15 +17,15 @@ class TestMain(DataTestCase):
self.assertIsInstance(app, Router) self.assertIsInstance(app, Router)
class TestMakeWsgiApp(TestCase): class TestMakeWsgiApp(DataTestCase):
def test_coverage(self): def test_coverage(self):
app = mod.make_wsgi_app() app = mod.make_wsgi_app(config=self.config)
self.assertIsInstance(app, Router) self.assertIsInstance(app, Router)
class TestMakeAsgiApp(TestCase): class TestMakeAsgiApp(DataTestCase):
def test_coverage(self): def test_coverage(self):
app = mod.make_asgi_app() app = mod.make_asgi_app(config=self.config)
self.assertIsInstance(app, WsgiToAsgi) self.assertIsInstance(app, WsgiToAsgi)