Commits

Ronny Pfannschmidt  committed 16c56cd

yay we can test

  • Participants
  • Parent commits 89c5677
  • Branches flask-port

Comments (0)

Files changed (2)

+[pytest]
+norecursedirs = venv .hg

File testing/conftest.py

+import pytest
+
+
+@pytest.fixture(scope='session')
 def app():
     from lodgeit.application import app
     return app
 
 
-def pytest_funcarg__app(request):
-    return app()
+@pytest.fixture
+def db(autouse=True):
+    from lodgeit.models import db
+    db.create_all()
+    return db
 
-def pytest_funcarg__client(request):
-    return app().test_client()
 
-def pytest_sessionstart():
-    app().debug = True
-    app().config['SECRET_KEY'] = '123'
+@pytest.fixture
+def client(app, db):
+    return app.test_client()
+
+
+@pytest.fixture(scope='session', autouse=True)
+def configure(app):
+    app.debug = True
+    app.config['SECRET_KEY'] = '123'