mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Add an entry point to discover and run helpers tests with teamcity-messages
Utilize it to run tests on TC instead of plain "-m unittest discover". GitOrigin-RevId: e021c4f5dd01f5a5b9b0d989d6befd795e394499
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d685842863
commit
020ff1765a
@@ -0,0 +1,23 @@
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
_tests_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
_helpers_dir = os.path.dirname(_tests_dir)
|
||||
|
||||
|
||||
def discover_and_run_tests():
|
||||
suite = unittest.TestLoader().discover(_tests_dir)
|
||||
runner = unittest.TextTestRunner()
|
||||
try:
|
||||
import teamcity.unittestpy
|
||||
if teamcity.is_running_under_teamcity():
|
||||
runner = teamcity.unittestpy.TeamcityTestRunner()
|
||||
except ImportError:
|
||||
pass
|
||||
runner.run(suite)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.path.append(_helpers_dir)
|
||||
discover_and_run_tests()
|
||||
@@ -23,7 +23,7 @@ envs {
|
||||
mustRunAfter 'build_envs'
|
||||
|
||||
environment PYTHONPATH: ".:.."
|
||||
commandLine new File(pythonDirectory, pythonName).absolutePath + '/bin/python', '-m', 'unittest'
|
||||
commandLine new File(pythonDirectory, pythonName).absolutePath + '/bin/python', '__main__.py'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user