Skip to content

Commit

Permalink
Use pytest-cov
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Jan 3, 2018
1 parent 749b1dd commit 0d44135
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ install:

script:
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then flake8 stripe tests; fi
- python -W all -bb -W error::BytesWarning -m coverage.__main__ run setup.py test
- python -W all -bb -W error::BytesWarning setup.py test --addopts "--cov=stripe"

after_success:
coveralls
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,17 @@ instructions for installing via Homebrew and other methods):

tox -e py27

Run all tests in a single file:

tox -e py27 -- tests/api_resources/abstract/test_updateable_api_resource.py

Run a single test suite:

tox -e py27 -- --test-suite stripe.test.resources.test_updateable.UpdateableAPIResourceTests
tox -e py27 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource

Run a single test:

tox -e py27 -- --test-suite stripe.test.resources.test_updateable.UpdateableAPIResourceTests.test_save
tox -e py27 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource::test_save

Run the linter with:

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
'pytest >= 3.0',
'pytest-mock',
'mock;python_version<="3.3"', # only necessary for Python 3.3
'pytest-cov',
],
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ deps =
coverage
commands =
python setup.py clean --all
python -W all -bb -W error::BytesWarning -m coverage.__main__ run setup.py test {posargs}
python -W all -bb -W error::BytesWarning setup.py test --addopts "--cov=stripe {posargs}"
setenv =
STRIPE_TEST_PYCURL = true

Expand All @@ -30,7 +30,7 @@ deps =
commands =
flake8 stripe tests
python setup.py clean --all
python -W all -bb -W error::BytesWarning -m coverage.__main__ run setup.py test {posargs}
python -W all -bb -W error::BytesWarning setup.py test --addopts "--cov=stripe {posargs}"

[flake8]
exclude =
Expand Down

0 comments on commit 0d44135

Please sign in to comment.