Skip to content

Commit bab208a

Browse files
author
Joel Collins
committed
Added LabThing fixtures
1 parent 7d7d679 commit bab208a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/conftest.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
from flask import Flask
44
from apispec import APISpec
55
from apispec.ext.marshmallow import MarshmallowPlugin
6+
from labthings.server.labthing import LabThing
7+
from labthings.server.view import View
68

79

810
@pytest.fixture
911
def view_cls():
10-
class ViewClass:
12+
class ViewClass(View):
1113
def get(self):
1214
pass
1315

@@ -48,6 +50,13 @@ def app(request):
4850
return app
4951

5052

53+
@pytest.fixture
54+
def thing(app):
55+
thing = LabThing(app)
56+
with app.app_context():
57+
return thing
58+
59+
5160
@pytest.fixture()
5261
def debug_app(request):
5362

@@ -90,3 +99,8 @@ def client(app):
9099
@pytest.fixture
91100
def static_path(app):
92101
return os.path.join(os.path.dirname(__file__), "static")
102+
103+
104+
@pytest.fixture
105+
def schemas_path(app):
106+
return os.path.join(os.path.dirname(__file__), "schemas")

0 commit comments

Comments
 (0)