Run doctests and unittests as part of automated testing

* Switch default version to Python 3.7.
* Add 3.7 to the supported versions list.
* Remove redundant test.py.

This test module was basic and is being replaced by doctests and unittests.
This commit is contained in:
Jon Grace-Cox
2019-06-01 02:33:41 -04:00
parent 1f2e030735
commit 13eca9ebfd
2 changed files with 4 additions and 18 deletions

View File

@@ -3,10 +3,11 @@ python:
- '2.7'
- '3.5'
- '3.6'
- '3.7'
install:
- pip install -U setuptools pip -r build-requirements.txt
script:
- python ./test.py
- pytest --doctest-modules --cov=anybadge anybadge.py tests
deploy:
- provider: pypi
user: jongracecox
@@ -16,7 +17,7 @@ deploy:
on:
tags: true
all_branches: true
python: '3.6'
python: '3.7'
- provider: pypi
user: jongracecox
password:
@@ -24,4 +25,4 @@ deploy:
distributions: sdist bdist_wheel
on:
branch: master
python: '3.6'
python: '3.7'

15
test.py
View File

@@ -1,15 +0,0 @@
#!/usr/bin/python
"""
anybadge test module.
"""
import anybadge
if __name__ == '__main__':
thresholds={2: 'red', 4: 'orange', 6: 'green', 8: 'brightgreen'}
badge = anybadge.Badge('test', '2.22', value_suffix='%',
thresholds=thresholds, text_color='#010101,#101010')
print(badge.badge_svg_text)