Skip to content

Commit

Permalink
use py.test
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming committed Jan 19, 2016
1 parent 59e18a4 commit 0824431
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,6 +29,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
.cache

#Eclipse
.project
Expand Down
57 changes: 57 additions & 0 deletions Makefile
@@ -0,0 +1,57 @@
.PHONY: help clean clean-pyc clean-build list test test-all coverage docs release sdist

help:
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "testall - run tests on every Python version with tox"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "sdist - package"

clean: clean-build clean-pyc

clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +

lint:
pep8 kalite_zim

test:
./runtests.py

test-all:
tox

coverage:
coverage run --source ka-lite-zim setup.py test
coverage report -m
coverage html
open htmlcov/index.html

docs:
rm -f docs/ka-lite-zim.rst
# rm -f docs/modules.rst
# sphinx-apidoc -o docs/ ka-lite-zim
$(MAKE) -C docs clean
$(MAKE) -C docs html
sphinx-build -b linkcheck ./docs _build/
sphinx-build -b html ./docs _build/

release: clean
python setup.py sdist upload
python setup.py bdist_wheel upload

sdist: clean
python setup.py sdist
python setup.py bdist_wheel upload
ls -l dist
5 changes: 5 additions & 0 deletions pytest.ini
@@ -0,0 +1,5 @@
[pytest]
django_find_project = false
python_files=test_*.py
testpaths=wiki
norecursedirs=testproject .svn _build tmp* dist *.egg-info
12 changes: 11 additions & 1 deletion runtests.py
Expand Up @@ -101,4 +101,14 @@
# Allow tests to be specified:
argv.extend(sys.argv[1:])

execute_from_command_line(argv)

## Run py.tests
# Compatibility testing patches on the py-moneyed
import pytest
failures = pytest.main()

if failures:
sys.exit(failures)



0 comments on commit 0824431

Please sign in to comment.