'no-member' pylint error in unittests since testtools 1.6.0

Bug #1430677 reported by Thomas Chiroux
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Invalid
Undecided
Unassigned

Bug Description

ex with this simple test code:

    import testtools

    class TestTemplate(testtools.TestCase):

        """Describe here what the test should do.

        and here give eventually more details.
        """

        def test_always_true(self):
            """Remove this test when using the template."""
            self.assertTrue(True)

running pylint on a project containing this tests gives:
" Instance of 'TestTemplate' has no 'assertTrue' member (no-member)"

Falling back to testools 1.5.0 gives no pylint error.
I've the same pylint errors in 1.7.1.

This is a simple sample, but in a fully tested project, it gives no-member errors on assertTrue, assertAlmostEqual, assertFalse, assertNotEqual, assertGreaterEqual

(but not for example for assertEqual)

running the unittests is OK (no error in the tests), it gives only pylint errors (which may be a false positive, but I can figure why and how it changed in 1.6.0)

environment:
* linux (archlinux) 3.18.6-1
* python 3.4.3
* pylint 1.4.1 / astroid 1.3.4
* unittest2 1.0.0
* traceback2 1.4.0
* linecache2 1.0.0

Revision history for this message
Robert Collins (lifeless) wrote :

Wow, thats fun. Uhm, I have no idea. Perhaps file as a pylint bug?

Changed in testtools:
status: New → Incomplete
Revision history for this message
Jonathan Lange (jml) wrote :

In 1.6.0 we moved to inherit from unittest2. The problem is that pylint is not picking up methods inherited from grandparents. Not really a testtools bug, alas.

Changed in testtools:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.