diff --git a/.gitignore b/.gitignore index 93e14570..b68caadc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -node_modules +node_modules/ .sass-cache/ static/fonts/* .webassets-cache scss/assets +.pytest_cache/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..f26b9f40 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: python + python: + - "3.6" + script: + - python -m pytest diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..3b40ee44 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +norecursedirs = .venv .git node_modules diff --git a/requirements.txt b/requirements.txt index 69d97d96..fbddde00 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,4 @@ tornado==5.0.2 webassets==0.12.1 +pytest==3.6.0 +pytest-tornado==0.5.0 diff --git a/tests/test_basic.py b/tests/test_basic.py new file mode 100644 index 00000000..b4fc343b --- /dev/null +++ b/tests/test_basic.py @@ -0,0 +1,12 @@ +import pytest +import tornado.web +from app import make_app + +@pytest.fixture +def app(): + return make_app() + +@pytest.mark.gen_test +def test_hello_world(http_client, base_url): + response = yield http_client.fetch(base_url) + assert response.code == 200