mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 15:00:18 +00:00
regression tests
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import unittest
|
||||
import os
|
||||
import glob
|
||||
|
||||
def regressionTest():
|
||||
filenames = glob.glob('*test*.py')
|
||||
module_names = [os.path.splitext(os.path.basename(f))[0] for f in filenames]
|
||||
modules = [__import__(name) for name in module_names]
|
||||
tests = [unittest.defaultTestLoader.loadTestsFromModule(m) for m in modules]
|
||||
return unittest.TestSuite(tests)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(defaultTest='regressionTest')
|
||||
@@ -8,7 +8,7 @@ die () {
|
||||
hg status|grep "^\?" && die "Stray files found."
|
||||
echo "running unit tests"
|
||||
cd examples/
|
||||
python3 regression.py
|
||||
python3 regression.py || die "Unit tests failed."
|
||||
cd ..
|
||||
ssh diveintomark.org "hg -R /home/mark/db/diveintopython3/ serve --stdio" &
|
||||
hg push ssh://mark@diveintomark.org//home/mark/db/diveintopython3/
|
||||
|
||||
Reference in New Issue
Block a user