Skip to content

Commit

Permalink
implemetned pytest and added the first test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo RPS committed Jul 17, 2018
1 parent a2b6490 commit 4e10336
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ target/

# Project
/src/hematopy/http/images
*.pid
*.pid
.pytest_cache
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[aliases]
test=pytest
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
long_description_content_type='text/markdown',
package_dir={'': 'src'},
packages=setuptools.find_packages(where='src'),
setup_requires=['pytest-runner'],
install_requires=[
'CairoSVG==2.1.3',
'click==6.7',
'sanic==0.7.0',
'lxml==4.2.1',
'python-magic==0.4.15'
],
tests_require = [
'pytest-console-scripts==0.1.5',
],
# package_dir={'':'hematopy'},
entry_points = {
'console_scripts': [
Expand Down
7 changes: 7 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Services

- https://travis-ci.org/ArgoCrew/hematopy

## References

- https://github.com/kvas-it/pytest-console-scripts
9 changes: 9 additions & 0 deletions tests/hematopy/test_donation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CONSOLE_SCRIPT_NAME = 'hematopy'

def test_cli_help(script_runner):
must_have = ('Usage: hematopy [OPTIONS] COMMAND [ARGS]...')
ret = script_runner.run('hematopy', '--help')

assert ret.success
assert must_have[0] in ret.stdout
assert ret.stderr == ''

0 comments on commit 4e10336

Please sign in to comment.