batman (working version kinda)
This commit is contained in:
commit
6dd38036e7
65 changed files with 3950 additions and 0 deletions
24
tests/conftest.py
Normal file
24
tests/conftest.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import pytest
|
||||
from app import create_app
|
||||
from app.core.extensions import db as _db
|
||||
|
||||
@pytest.fixture
|
||||
def app():
|
||||
app = create_app('testing')
|
||||
app.config['TESTING'] = True
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:'
|
||||
|
||||
with app.app_context():
|
||||
_db.create_all()
|
||||
yield app
|
||||
_db.session.remove()
|
||||
_db.drop_all()
|
||||
|
||||
@pytest.fixture
|
||||
def client(app):
|
||||
return app.test_client()
|
||||
|
||||
@pytest.fixture
|
||||
def db(app):
|
||||
with app.app_context():
|
||||
yield _db
|
Loading…
Add table
Add a link
Reference in a new issue