Show More
@@ -218,7 +218,7 b' def app(request, pylonsapp, http_environ' | |||||
218 | return app |
|
218 | return app | |
219 |
|
219 | |||
220 |
|
220 | |||
221 | @pytest.fixture() |
|
221 | @pytest.fixture(scope='session') | |
222 | def app_settings(pylonsapp, pylons_config): |
|
222 | def app_settings(pylonsapp, pylons_config): | |
223 | """ |
|
223 | """ | |
224 | Settings dictionary used to create the app. |
|
224 | Settings dictionary used to create the app. | |
@@ -234,6 +234,18 b' def app_settings(pylonsapp, pylons_confi' | |||||
234 | return settings |
|
234 | return settings | |
235 |
|
235 | |||
236 |
|
236 | |||
|
237 | @pytest.fixture(scope='session') | |||
|
238 | def db(app_settings): | |||
|
239 | """ | |||
|
240 | Initializes the database connection. | |||
|
241 | ||||
|
242 | It uses the same settings which are used to create the ``pylonsapp`` or | |||
|
243 | ``app`` fixtures. | |||
|
244 | """ | |||
|
245 | from rhodecode.config.utils import initialize_database | |||
|
246 | initialize_database(app_settings) | |||
|
247 | ||||
|
248 | ||||
237 | LoginData = collections.namedtuple('LoginData', ('csrf_token', 'user')) |
|
249 | LoginData = collections.namedtuple('LoginData', ('csrf_token', 'user')) | |
238 |
|
250 | |||
239 |
|
251 |
General Comments 0
You need to be logged in to leave comments.
Login now