Skip to content

Commit

Permalink
Added tests and remove pytest (w plugins) from requirements file if n…
Browse files Browse the repository at this point in the history
…ot wanted
  • Loading branch information
hkage committed Mar 14, 2017
1 parent 4c4056f commit 812dcd7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
28 changes: 28 additions & 0 deletions tests/test_bake_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,34 @@ def test_bumpversion_support(cookies, with_bumpversion_support, expected_result)
assert ('.bumpversion.cfg' in found_toplevel_files) == expected_result


@pytest.mark.parametrize('with_pytest_support, expected_result', [
('y', True),
('yes', True),
('YES', True),
('n', False),
('no', False),
('NO', False),
])
def test_pytest_support(cookies, with_pytest_support, expected_result):
with bake_in_temp_dir(cookies, extra_context={'use_pytest': with_pytest_support}) as result:
found_toplevel_files = [f.basename for f in result.project.listdir()]
assert ('pytest.ini' in found_toplevel_files) == expected_result


@pytest.mark.parametrize('with_tox_support, expected_result', [
('y', True),
('yes', True),
('YES', True),
('n', False),
('no', False),
('NO', False),
])
def test_tox_support(cookies, with_tox_support, expected_result):
with bake_in_temp_dir(cookies, extra_context={'use_tox': with_tox_support}) as result:
found_toplevel_files = [f.basename for f in result.project.listdir()]
assert ('tox.ini' in found_toplevel_files) == expected_result


def test_cookie_secret_has_been_generated(cookies):
with bake_in_temp_dir(cookies) as result:
settings_file = result.project.join('settings.py')
Expand Down
12 changes: 4 additions & 8 deletions {{cookiecutter.project_slug}}/requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ coverage
flake8
mock
pydocstyle
pylint
{% if cookiecutter.use_pytest == 'y' -%}
pylint{% if cookiecutter.use_pytest == 'y' -%}
pytest
pytest-pep8
pytest-cov
{%- endif %}
Sphinx
{% if cookiecutter.use_bumpversion == 'y' -%}
bumpversion
{%- endif %}
pytest-cov{%- endif %}
Sphinx{% if cookiecutter.use_bumpversion == 'y' -%}
bumpversion{%- endif %}

0 comments on commit 812dcd7

Please sign in to comment.