Skip to content

gmlexx/teamcity-messages

This branch is 314 commits behind JetBrains/teamcity-messages:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5b0e642 · Oct 22, 2015
Oct 5, 2014
Aug 8, 2013
Oct 17, 2015
Oct 17, 2015
Oct 22, 2015
Apr 18, 2014
Aug 2, 2015
Apr 18, 2015
Apr 18, 2015
Sep 12, 2015
Oct 17, 2015
May 23, 2015
Aug 28, 2015
Oct 17, 2015
Jan 11, 2015
Oct 17, 2015
Sep 19, 2015

Repository files navigation

Python Unit Test Reporting to TeamCity

This packages integrates Python with the TeamCity Continuous Integration (CI) server. It allow sending "service messages" from Python code. Additionally, it provides integration with the following testing frameworks and tools:

Installation

Install using pip:

pip install teamcity-messages

or from source:

python setup.py install

Usage

This package uses service messages to report build status to TeamCity. See https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity for more details

unittest

If you wish to use Python default's unittest framework, you should modify the Test runner, e.g.:

import unittest
from teamcity import is_running_under_teamcity
from teamcity.unittestpy import TeamcityTestRunner

class Test(unittest.TestCase):
    ...

if __name__ == '__main__':
    if is_running_under_teamcity():
        runner = TeamcityTestRunner()
    else:
        runner = unittest.TextTestRunner()
    unittest.main(testRunner=runner)

See examples/simple.py for a full example.

If you are used to running unittest from the command line, instead of using python -m unittest, you could use python -m teamcity.unittestpy.

nose

Test status reporting is enabled automatically under TeamCity build.

py.test

Test status reporting is enabled automatically under TeamCity build.

Django

For Django 1.6+: Use the TeamcityDjangoRunner runner instead of the default DiscoverRunner by changing the following setting in your settings.py:

TEST_RUNNER = "teamcity.django.TeamcityDjangoRunner"

If you are using another test runner, you should override the run_suite method or use the DiscoverRunner.test_runner property introduced in Django 1.7.

flake8

Test status reporting is enabled automatically under TeamCity build.

Twisted trial

Add --reporter=teamcity option to trial command line

Python version compatibility

  • Python 2 - >= 2.4
  • Python 3 - >= 3.2
  • PyPy and PyPy 3
  • Jython

Contact information

https://github.com/JetBrains/teamcity-messages

TeamCity support: http://www.jetbrains.com/support/teamcity

License

Apache, version 2.0 http://www.apache.org/licenses/LICENSE-2.0

About

Python Unit Test Reporting to TeamCity

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.6%
  • Shell 1.4%