2013-09-13 19:39:15 -03:00
|
|
|
import os
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
|
|
def load_tests(loader, standard_tests, pattern):
|
|
|
|
# top level directory cached on loader instance
|
|
|
|
this_dir = os.path.dirname(__file__)
|
|
|
|
pattern = pattern or "test*.py"
|
2013-09-13 19:40:46 -03:00
|
|
|
# We are inside unittest.test.testmock, so the top-level is three notches up
|
2013-09-13 19:39:15 -03:00
|
|
|
top_level_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_dir)))
|
|
|
|
package_tests = loader.discover(start_dir=this_dir, pattern=pattern,
|
|
|
|
top_level_dir=top_level_dir)
|
|
|
|
standard_tests.addTests(package_tests)
|
|
|
|
return standard_tests
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|