Skip to content

Commit

Permalink
fix travis and add test
Browse files Browse the repository at this point in the history
  • Loading branch information
afourmy committed Mar 24, 2018
1 parent 7e7fecd commit 1ea1d79
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_script:

script:
- flake8
- coverage run --source=../swap -m pytest
- coverage run --source=../source -m pytest

after_success:
- coveralls
21 changes: 21 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from os import remove
from os.path import abspath, dirname, join, pardir
from pytest import fixture
import sys

path_test = dirname(abspath(__file__))
path_parent = abspath(join(path_test, pardir))
path_app = join(path_parent, 'source')
if path_app not in sys.path:
sys.path.append(path_app)

from flask_app import create_app


@fixture
def client():
app, solver = create_app()
client = app.test_client()
with app.app_context():
yield client
remove(join(path_test, 'database.db'))
5 changes: 5 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from models import City


def test_pytsp(client):
pass

0 comments on commit 1ea1d79

Please sign in to comment.