skip to navigation
skip to content

teamcity-messages 1.17

Send test results to TeamCity continuous integration server from unittest, nose, py.test, twisted trial (Python 2.4+)

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:


Install using pip:

pip install teamcity-messages

or from source:

python install


This package uses service messages to report build status to TeamCity. See for more details


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()
        runner = unittest.TextTestRunner()

See examples/ 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.


Test status reporting is enabled automatically under TeamCity build.


Test status reporting is enabled automatically under TeamCity build.


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

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.


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 - all versions
  • PyPy and PyPy 3
  • Jython


Apache, version 2.0

Change Log

Version 1.17 Sat Oct 17 2015
  • support coverage >= 4.0
  • automatically detect TeamCity in flake8 plugin (Marc Abramowitz,
  • more messages support (Marc Abramowitz, buildProblem, buildStatus, setParameter, importData, enableServiceMessages, disableServiceMessages etc

Version 1.16 Sat Sep 12 2015

Version 1.15 Fri Aug 28 2015

Version 1.14 Sat May 23 2015

Version 1.13 Sun Mar 29 2015

Version 1.12 Fri Jan 16 2015

  • unittest: fix 2.6 compat

Version 1.11 Fri Jan 16 2015

  • nose: handle errors/failures in teardown/setup
  • nose: support multiprocess mode
  • nose: correctly report captured output
  • unittest: support skipped tests in Python 2.6 (by unittest2)
  • unittest: support subtests (Python 3.4+)

Version 1.10 Fri Jan 09 2015

Version 1.9 Thu Jan 08 2015

  • Django support (Ralph Broenink,
  • Fix test hierarchies on nose and py.test
  • py.test: report errors in setup and teardown
  • py.test: report collect errors
  • py.test: support xfail
  • nose: support skipped tests
  • unittest: support skip, expected failure and unexpected success
  • Totally rewritten integration tests * Thanks to Ralph Broenink ( and Leonid Bushuev (

Version 1.8 Sat Feb 08 2014

  • extensive tests for nose integration (James Carpenter)
  • added timestamps to TeamCity service messages (James Carpenter)

Version 1.7 Sun Feb 03 2013

  • py.test support (Aaron Buchanan)
  • official Python 3 support

Version 1.6 Tue Dec 06 2011

  • Bundle forgotten examples/

Version 1.4 Tue Apr 27 2010

Version 1.3 Fri Apr 11 2008

Version 1.2 Thu Apr 10 2008

  • Fixed tests gold data

Version 1.1 Thu Apr 10 2008

  • Fixed README

Version 1.0 Tue Apr 08 2008

  • initial release
File Type Py Version Uploaded on Size
teamcity-messages-1.17.tar.gz (md5) Source 2015-10-17 14KB
  • Downloads (All Versions):
  • 2501 downloads in the last day
  • 17265 downloads in the last week
  • 74568 downloads in the last month