diff options
| author | Theron Luhn <theron@luhn.com> | 2020-11-11 21:48:41 -0800 |
|---|---|---|
| committer | Theron Luhn <theron@luhn.com> | 2020-11-11 21:48:41 -0800 |
| commit | 042a2b9967f23757393ee099f5c2016d6fb68107 (patch) | |
| tree | 80876f9475f1a9b27f67ac16b5e7cf9cbedb9c2c /docs/tutorials/wiki2/src/models | |
| parent | 7933c51abd4b716aea9199acdc8cc7ec9296d07e (diff) | |
| download | pyramid-042a2b9967f23757393ee099f5c2016d6fb68107.tar.gz pyramid-042a2b9967f23757393ee099f5c2016d6fb68107.tar.bz2 pyramid-042a2b9967f23757393ee099f5c2016d6fb68107.zip | |
Backport conftest changes to prior steps.
Diffstat (limited to 'docs/tutorials/wiki2/src/models')
| -rw-r--r-- | docs/tutorials/wiki2/src/models/tests/conftest.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/docs/tutorials/wiki2/src/models/tests/conftest.py b/docs/tutorials/wiki2/src/models/tests/conftest.py index 2db65f887..347180600 100644 --- a/docs/tutorials/wiki2/src/models/tests/conftest.py +++ b/docs/tutorials/wiki2/src/models/tests/conftest.py @@ -4,7 +4,7 @@ import alembic.command import os from pyramid.paster import get_appsettings from pyramid.scripting import prepare -from pyramid.testing import DummyRequest +from pyramid.testing import DummyRequest, testConfig import pytest import transaction from webob.cookies import Cookie @@ -103,7 +103,7 @@ def app_request(app, tm, dbsession): env['closer']() @pytest.fixture -def dummy_request(app, tm, dbsession): +def dummy_request(tm, dbsession): """ A lightweight dummy request. @@ -117,9 +117,13 @@ def dummy_request(app, tm, dbsession): """ request = DummyRequest() - request.registry = app.registry request.host = 'example.com' request.dbsession = dbsession request.tm = tm return request + +@pytest.yield_fixture +def dummy_config(dummy_request): + with testConfig(request=dummy_request) as config: + yield config |
