-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a few unit test fixes, plus tox/travis builds
- Loading branch information
1 parent
e908e2b
commit 71f46e5
Showing
6 changed files
with
76 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: python | ||
env: | ||
- TOXENV=flake8 | ||
- TOXENV=py27 | ||
- TOXENV=py34 | ||
- TOXENV=py35 | ||
- TOXENV=py36 | ||
- TOXENV=pypy | ||
install: | ||
- pip install tox | ||
script: | ||
- tox |
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,21 +1,23 @@ | ||
import pytest | ||
from flask import Flask | ||
from jinja2 import Template | ||
from flask_moment import Moment | ||
import datetime | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def app(): | ||
_app = Flask(__name__) | ||
with _app.app_context(): | ||
yield _app | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def moment(app): | ||
moment = Moment() | ||
moment.init_app(app) | ||
yield moment | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def current_time(): | ||
return datetime.datetime(2017, 3, 10, 1, 49, 59, 38650) | ||
return datetime.datetime(2017, 3, 10, 1, 49, 59, 38650) |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[tox] | ||
envlist=flake8,py27,py34,py35,py36,pypy | ||
skip_missing_interpreters=true | ||
|
||
[testenv] | ||
commands=py.test --cov-report term-missing --cov=flask_moment tests | ||
deps= | ||
pytest | ||
pytest-cov | ||
mock | ||
|
||
[testenv:flake8] | ||
basepython=python3.6 | ||
commands= | ||
flake8 flask_moment.py tests example | ||
deps= | ||
flake8 |