Skip to content

Commit 8e2912a

Browse files
author
Joel Collins
committed
Added APISpec to conftest
1 parent e00f12d commit 8e2912a

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import pytest
22
from flask import Flask
3+
from apispec import APISpec
4+
from apispec.ext.marshmallow import MarshmallowPlugin
5+
6+
@pytest.fixture
7+
def spec():
8+
return APISpec(
9+
title="Python-LabThings PyTest",
10+
version="1.0.0",
11+
openapi_version="3.0.2",
12+
plugins=[MarshmallowPlugin()],
13+
)
314

415

516
@pytest.fixture()

tests/test_server_spec_utilities.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from labthings.server.spec import utilities
22
import json
3-
from apispec import APISpec
4-
from apispec.ext.marshmallow import MarshmallowPlugin
53
from marshmallow import fields
64
import pytest
75

@@ -24,16 +22,6 @@ def delete(self):
2422
return ViewClass
2523

2624

27-
@pytest.fixture
28-
def spec():
29-
return APISpec(
30-
title="Python-LabThings PyTest",
31-
version="1.0.0",
32-
openapi_version="3.0.2",
33-
plugins=[MarshmallowPlugin()],
34-
)
35-
36-
3725
def test_initial_update_spec(view_class):
3826
initial_spec = {"key": "value"}
3927
utilities.update_spec(view_class, initial_spec)

0 commit comments

Comments
 (0)