Skip to content

Commit 0c4ef3c

Browse files
committed
added test environment with coverage + requirement cleanup
1 parent 493caba commit 0c4ef3c

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sudo: required
2+
services:
3+
- docker
4+
before_install:
5+
- pip install codecov
6+
install: pip install -r req-test.txt
7+
language: python
8+
python:
9+
- "3.5"
10+
script: py.test --cov=. tests/
11+
after_success:
12+
- codecov
File renamed without changes.

req-test.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cookiecutter==1.3.0
2+
pytest==2.8.7
3+
pytest-cookies==0.1.0
4+
pytest-cov==2.2.1

tests/pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[pytest]
2+
python_files = test*.py

tests/test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
import shutil
3+
import pytest
4+
from cookiecutter.main import cookiecutter
5+
6+
parent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
7+
8+
9+
@pytest.fixture
10+
def del_gen_project(request):
11+
def teardown():
12+
shutil.rmtree(os.path.join(parent_dir, 'project_name'))
13+
request.addfinalizer(teardown)
14+
15+
16+
def test_with_default_values(del_gen_project):
17+
''' Successful generation with the default values '''
18+
cookiecutter(parent_dir, no_input=True)

0 commit comments

Comments
 (0)