adding command for running of tests

This commit is contained in:
Roman Mogilatov 2015-03-10 16:03:54 +02:00
parent 3b37476d23
commit a4a160b061
2 changed files with 15 additions and 6 deletions

View File

@ -34,5 +34,20 @@ def check():
os.system('flake8 examples/') os.system('flake8 examples/')
os.system('pep257 examples/') os.system('pep257 examples/')
@manager.command
def test():
"""Run unittests."""
os.system('find ./objects -name "*.pyc" -exec rm -rf {} \\;')
os.system('find ./tests -name "*.pyc" -exec rm -rf {} \\;')
os.system('find ./objects -name "*.pyo" -exec rm -rf {} \\;')
os.system('find ./tests -name "*.pyo" -exec rm -rf {} \\;')
os.system('coverage run --rcfile=./.coveragerc `which unit2` discover')
os.system('coverage html --rcfile=./.coveragerc')
os.system('rm -f .coverage')
if __name__ == '__main__': if __name__ == '__main__':
manager.main() manager.main()

View File

@ -1,6 +0,0 @@
def func(x):
return x + 1
def test_answer():
assert func(3) == 5