[Checkins] [zopefoundation/Zope] 274d00: Fixed dummy runTest on functional test case. (#90)

GitHub noreply at github.com
Wed Jan 18 11:31:16 CET 2017


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/Zope
  Commit: 274d00d9e93fc0d74c67d78587320c47f374e10e
      https://github.com/zopefoundation/Zope/commit/274d00d9e93fc0d74c67d78587320c47f374e10e
  Author: Maurits van Rees <maurits at vanrees.org>
  Date:   2017-01-18 (Wed, 18 Jan 2017)

  Changed paths:
    M src/Testing/ZopeTestCase/zopedoctest/functional.py

  Log Message:
  -----------
  Fixed dummy runTest on functional test case. (#90)

In functional doc tests you can apparently have a test case that has
no runTest method.  Until now the Testing package added a dummy
runTest method in that case, and set it to None.

But when this dummy runTest method gets called, you get an error:

  Error in test runTest (Testing.ZopeTestCase.ZopeTestCase.FunctionalTestCase)
  Traceback (most recent call last):
    File ".../lib/python2.7/unittest/case.py", line 329, in run
      testMethod()
  TypeError: 'NoneType' object is not callable

Simply importing Testing.ZopeTestCase.FunctionalTestCase in a new test
file may be enough to trigger this.

So this has something to do with the order in which tests are found.

I fixed it by making the dummy runTest method callable.




More information about the checkins mailing list