Python Integration Testing on TeamCity
I have a set of Python tests that run on TeamCity. I am able to get the test to run, however开发者_运维问答 I cannot get TeamCity to produce a test report. How can I get TeamCity to produce a report of my tests?
Thanks
You can install teamcity-messages from PyPI. At that point, you can create a simple script that will replicate the built-in unittest script, with all the same options for discovery, test patterns, etc., but with the TeamCity runner. That runner will output test messages such that TeamCity will understand and report them.
from teamcity.unittestpy import TeamcityTestRunner
import unittest
if __name__ == '__main__':
unittest.main(testRunner=TeamcityTestRunner())
Did you see the question TeamCity for Python/Django continuous integration ? I think it has what you need.
The test reports are to be generated by the test runner, not TeamCity. TeamCity will only look at the test report generated and use it for purposes like displaying info on the tests passed etc.
精彩评论