Skip to content

Commit

Permalink
Fixed empty view class name
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Apr 20, 2020
1 parent b7150ee commit d63e08c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
import os
from flask import Flask
from flask.views import MethodView
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from labthings.server.labthing import LabThing
Expand All @@ -20,7 +21,7 @@ def open(self, *args, **kwargs):


@pytest.fixture
def view_cls():
def empty_view_cls():
class EmptyViewClass(View):
def get(self):
pass
Expand All @@ -37,6 +38,24 @@ def delete(self):
return EmptyViewClass


@pytest.fixture
def flask_view_cls():
class ViewClass(MethodView):
def get(self):
return "GET"

def post(self):
return "POST"

def put(self):
return "PUT"

def delete(self):
return "DELETE"

return ViewClass


@pytest.fixture
def view_cls():
class ViewClass(View):
Expand Down

0 comments on commit d63e08c

Please sign in to comment.