Skip to content

Commit

Permalink
Add travis-ci (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Jun 28, 2018
1 parent 5d8769b commit e91b25e
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: python
sudo: false
dist: trusty

matrix:
include:
- python: 3.6
env: TOXENV=py36
- python: 3.5
env: TOXENV=py35
- python: 3.4
env: TOXENV=py34
install:
- travis_retry pip install tox
- tox --version
script:
- travis_retry tox
2 changes: 1 addition & 1 deletion pyramid_openapi3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from string import Template

from openapi_core import create_spec
from openapi_core.validators import RequestValidator, ResponseValidator
from openapi_core.shortcuts import RequestValidator, ResponseValidator
from openapi_spec_validator import validate_spec
from openapi_spec_validator.schemas import read_yaml_file
from pyramid.exceptions import ConfigurationError
Expand Down
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
testpaths = tests/
python_files = *.py
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@
'pyramid_openapi3': ['static/*.*'],
'': ['LICENSE'],
},
install_requires=['openapi-core', 'pyramid', 'pyyaml'],
install_requires=[
'openapi-core',
'openapi-spec-validator',
'pyramid',
],
setup_requires=["pytest-runner"],
extras_require={
'dev': ['coverage', 'pytest', 'tox'],
Expand Down
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from pytest import fixture

from pyramid.testing import DummyRequest


@fixture
def dummy_openapi_request():
from pyramid_openapi3.wrappers import PyramidOpenAPIRequest
dummy_request = DummyRequest()
return PyramidOpenAPIRequest(dummy_request)
Empty file added tests/test_configuration.py
Empty file.
2 changes: 2 additions & 0 deletions tests/test_wrappers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_host_url(dummy_openapi_request):
assert dummy_openapi_request.request.host_url == "http://example.com"
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[tox]
envlist = py27,py34,py35,py36,lint
envlist = py34,py35,py36

[testenv]
extras = dev
commands=
# Needed due to https://github.com/p1c2u/openapi-core/issues/47
install_command =
pip install --no-binary openapi-core {opts} {packages}
commands =
pytest

[testenv:lint]
Expand Down

0 comments on commit e91b25e

Please sign in to comment.