-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hypothesis): Added hypothesis as an option (#134)
- Loading branch information
Showing
9 changed files
with
80 additions
and
20 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
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 |
---|---|---|
|
@@ -122,6 +122,7 @@ use_tools: | |
- pre-commit | ||
- pydocstyle | ||
- pytest | ||
- hypothesis | ||
- shellcheck | ||
- vulture | ||
enabled: false | ||
|
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
52 changes: 52 additions & 0 deletions
52
src/scicookie/{{cookiecutter.project_slug}}/tests/test_{{cookiecutter.package_slug}}.py
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,52 @@ | ||
""" | ||
Tests for {{ cookiecutter.package_slug }} package. | ||
""" | ||
{% if cookiecutter.use_pytest == "yes" -%} | ||
import pytest | ||
{% endif -%} | ||
{% if cookiecutter.use_hypothesis == "yes" -%} | ||
from hypothesis import given | ||
from hypothesis import strategies as st | ||
{% endif -%} | ||
{% if cookiecutter.use_pytest == "yes" %} | ||
|
||
@pytest.fixture | ||
def response_pytest(): | ||
"""Sample pytest fixture. | ||
See more at: | ||
http://doc.pytest.org/en/latest/fixture.html | ||
""" | ||
{% endif -%} | ||
{% if cookiecutter.use_hypothesis == "yes" %} | ||
|
||
@pytest.fixture | ||
def response_hypothesis(): | ||
"""Sample pytest fixture. | ||
See more at: | ||
https://hypothesis.readthedocs.io/en/latest/quickstart.html | ||
""" | ||
{% endif -%} | ||
|
||
{%- if cookiecutter.use_pytest == "yes" and | ||
cookiecutter.use_hypothesis == "yes" %} | ||
|
||
@given(st.text()) | ||
def test_content_hypothesis1(): | ||
"""Sample pytest test function with the | ||
pytest fixture and hypothesis as arguments. | ||
""" | ||
# Test code using the response fixture and | ||
# hypothesis_argument | ||
|
||
|
||
@given(st.text()) | ||
def test_content_hypothesis2(): | ||
"""Sample pytest test function with the hypothesis | ||
fixture as an argument. | ||
""" | ||
# Test code using the response fixture and | ||
# hypothesis_argument | ||
{% endif -%} | ||
{#- keep this line at the end of the file -#} |
15 changes: 0 additions & 15 deletions
15
src/scicookie/{{cookiecutter.project_slug}}/tests/test_{{cookiecutter.project_slug}}.py
This file was deleted.
Oops, something went wrong.