-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
213 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
from importlib.metadata import version | ||
|
||
from .flask_restful import RestfulPlugin | ||
|
||
try: | ||
__version__ = version('apispec-flask-restful') | ||
except: | ||
__version__ = 'unknown' | ||
from importlib.metadata import version | ||
|
||
from .flask_restful import RestfulPlugin | ||
__version__ = version("apispec-flask-restful") | ||
except ImportError: | ||
__version__ = "unknown" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Dummy conftest.py for apispec_flask_restful. | ||
import pytest | ||
from flask import Flask | ||
from flask_restful import Api | ||
|
||
If you don't know what this is for, just leave it empty. | ||
Read more about conftest.py under: | ||
https://pytest.org/latest/plugins.html | ||
""" | ||
from __future__ import print_function, absolute_import, division | ||
|
||
import pytest | ||
@pytest.fixture() | ||
def app(): | ||
_app = Flask(__name__) | ||
ctx = _app.test_request_context() | ||
ctx.push() | ||
yield _app | ||
ctx.pop() | ||
|
||
|
||
@pytest.fixture() | ||
def api(): | ||
_app = Flask(__name__) | ||
_api = Api(_app) | ||
ctx = _app.test_request_context() | ||
ctx.push() | ||
yield _api | ||
ctx.pop() |
Oops, something went wrong.