Fix test runner progress for py.test
authorElliot Kroo <elliot@getaround.com>
Sat, 14 May 2016 23:46:07 +0000 (16:46 -0700)
committerElliot Kroo <elliot@getaround.com>
Sun, 15 May 2016 00:00:47 +0000 (17:00 -0700)
This change fixes an issue where the pytest runner did not
report the number of tests to the test runner, resulting in
a progress bar stuck at 50%.

python/helpers/pycharm/pytest_teamcity.py

index 1de9e20be2c9a69cd37429b55bf085d860bf606c..50b6ede17010cf1be37f34ba9e71507ce15fdded 100644 (file)
@@ -43,6 +43,9 @@ if PYVERSION > [1, 4, 0]:
   current_file = None
   current_file_suite = None
 
+  def pytest_collection_finish(session):
+    messages.testCount(len(session.items))
+
   def pytest_runtest_logstart(nodeid, location):
     path = "file://" + os.path.realpath(os.path.join(CURRENT_DIR_NAME, location[0]))
     if location[1]: