mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-22 17:47:02 +03:00
adding command for running of tests
This commit is contained in:
parent
3b37476d23
commit
a4a160b061
15
manage.py
15
manage.py
|
@ -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()
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
def func(x):
|
|
||||||
return x + 1
|
|
||||||
|
|
||||||
|
|
||||||
def test_answer():
|
|
||||||
assert func(3) == 5
|
|
Loading…
Reference in New Issue
Block a user