Skip to content

Commit

Permalink
Added LabThing fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Apr 16, 2020
1 parent 7d7d679 commit bab208a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
from flask import Flask
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from labthings.server.labthing import LabThing
from labthings.server.view import View


@pytest.fixture
def view_cls():
class ViewClass:
class ViewClass(View):
def get(self):
pass

Expand Down Expand Up @@ -48,6 +50,13 @@ def app(request):
return app


@pytest.fixture
def thing(app):
thing = LabThing(app)
with app.app_context():
return thing


@pytest.fixture()
def debug_app(request):

Expand Down Expand Up @@ -90,3 +99,8 @@ def client(app):
@pytest.fixture
def static_path(app):
return os.path.join(os.path.dirname(__file__), "static")


@pytest.fixture
def schemas_path(app):
return os.path.join(os.path.dirname(__file__), "schemas")

0 comments on commit bab208a

Please sign in to comment.