Skip to content

Commit

Permalink
Add nosetests configuration in setup.py and apply changes in …
Browse files Browse the repository at this point in the history
…``tox.ini``. ``pytest`` is removed from ``setup.cfg`` if ``nose`` is chosen.
  • Loading branch information
tantale committed May 27, 2016
1 parent 160c4ec commit 6512a39
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions {{cookiecutter.repo_name}}/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ universal = 1
max-line-length = 140
exclude = tests/*,*/migrations/*,*/south_migrations/*

{% if cookiecutter.test_runner|lower == "pytest" -%}
[pytest]
norecursedirs =
.git
Expand All @@ -33,6 +34,14 @@ addopts =
--doctest-glob=\*.rst
--tb=short

{%- elif cookiecutter.test_runner|lower == "nose" -%}
[nosetests]
verbosity = 2
with-coverage = 1
cover-package = {{ cookiecutter.package_name|replace('-', '_') }}
where = tests/

{% endif -%}
[isort]
force_single_line=True
line_length=120
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.repo_name}}/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ commands =
{%- endif %}
{%- else %}
{%- if cookiecutter.test_matrix_separate_coverage|lower == 'yes' %}
nocov: {posargs:nosetests -v tests}
nocov: {posargs:nosetests -v}
cover: {posargs:nosetests --with-coverage --cover-package={{ cookiecutter.package_name|replace('-', '_') }}}
{%- else %}
{posargs:nosetests --with-coverage --cover-package={{ cookiecutter.package_name|replace('-', '_')}} tests}
{posargs:nosetests --with-coverage --cover-package={{ cookiecutter.package_name|replace('-', '_')}}}
{%- endif %}
{%- endif %}

Expand Down

0 comments on commit 6512a39

Please sign in to comment.