Add name-tests-test hook

This commit is contained in:
Anthony Sottile 2014-03-14 15:42:24 -07:00
parent f19c06a8b4
commit ab35cd3634
3 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import sys
def validate_files(argv):
retcode = 0
for filename in argv:
if (
not filename.endswith('_test.py') and
not filename.endswith('__init__.py') and
not filename.endswith('/conftest.py')
):
retcode = 1
print '{0} does not end in _test.py'.format(filename)
return retcode
def entry():
validate_files(sys.argv[1:])
if __name__ == '__main__':
sys.exit(entry())