From ae5d7acabe4a4999295c92440832ea26efeac414 Mon Sep 17 00:00:00 2001 From: androiddrew Date: Tue, 7 Nov 2017 15:00:45 -0500 Subject: [PATCH] Added fixed conftest database URL for postgres and doc strings --- {{cookiecutter.project_slug}}/tests/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_slug}}/tests/conftest.py b/{{cookiecutter.project_slug}}/tests/conftest.py index fda4358..46d9d47 100644 --- a/{{cookiecutter.project_slug}}/tests/conftest.py +++ b/{{cookiecutter.project_slug}}/tests/conftest.py @@ -9,7 +9,7 @@ from {{cookiecutter.project_slug}}.app import commands, routes, components settings = { 'DATABASE': { - #'URL': 'postgresql://apistar:local@localhost/test_cookie_api', + #'URL': 'postgresql://apistar:local@localhost/{{cookiecutter.project_slug}}', 'URL': 'sqlite:///', 'METADATA': Base.metadata }, @@ -21,6 +21,7 @@ backend = SQLAlchemyBackend(settings) @pytest.fixture(autouse=True) def create_db(): + """Creates a test database with session scope""" Base.metadata.create_all(backend.engine) yield @@ -30,7 +31,7 @@ def create_db(): @pytest.fixture(name='rb_session') def db_session_fixure(): - "Returns a SQLAlchemy session with automatic rollback" + """Returns a SQLAlchemy session with automatic rollback""" session = backend.Session() try: yield session