import pytest

import sys, os

myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.append(myPath + "/../src/")
from app import create_app
from main.core.database import db
from main.core.node import GridDomain


@pytest.fixture(scope="function", autouse=True)
def app():
    db_path = "sqlite:///:memory:"
    return create_app(debug=True, test_config={"SQLALCHEMY_DATABASE_URI": db_path})


@pytest.fixture
def client(app):
    return app.test_client()


@pytest.fixture
def domain():
    return GridDomain(name="testing")


@pytest.fixture(scope="function")
def database(app):
    test_db = db
    test_db.init_app(app)
    app.app_context().push()
    test_db.create_all()
    return test_db

import pytest

import sys, os

myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.append(myPath + "/../src/")
from app import create_app
from main.core.database import db


@pytest.fixture(scope="function", autouse=True)
def app():
    db_path = "sqlite:///:memory:"
    return create_app(debug=True, test_config={"SQLALCHEMY_DATABASE_URI": db_path})


@pytest.fixture
def client(app):
    return app.test_client()


@pytest.fixture(scope="function")
def database(app):
    test_db = db
    test_db.init_app(app)
    app.app_context().push()
    test_db.create_all()
    return test_db

--- 
+++ 
@@ -6,6 +6,7 @@
 sys.path.append(myPath + "/../src/")
 from app import create_app
 from main.core.database import db
+from main.core.node import GridDomain
 
 
 @pytest.fixture(scope="function", autouse=True)
@@ -19,6 +20,11 @@
     return app.test_client()
 
 
+@pytest.fixture
+def domain():
+    return GridDomain(name="testing")
+
+
 @pytest.fixture(scope="function")
 def database(app):
     test_db = db
ADD a new fixture (GridDomain instance)
