Pythoscope, the unit test generator

doesn't handle nested classes

Reported by Paul Hildebrandt on 2008-08-24
2
Affects Status Importance Assigned to Milestone
Pythoscope
Medium
Michal Kwiatkowski

Bug Description

Pythoscope doesn't understand nested classes.

Test Code:
class mainClass:
    def __init__(self): pass
    def mainClassMethod(self): pass
    class subClass:
        def __init__(self): pass
        def subClassMethod(self): pass

This generates:
import unittest

class TestMainClass(unittest.TestCase):
    def test_object_initialization(self):
        assert False # TODO: implement your test here

    def test_mainClassMethod(self):
        assert False # TODO: implement your test here

    def test_object_initialization(self):
        assert False # TODO: implement your test here

    def test_subClassMethod(self):
        assert False # TODO: implement your test here

if __name__ == '__main__':
    unittest.main()

There is no differentiation between class and subclass in test case. Specifically the object_initialization is duplicated.

Paul

Related branches

Michal Kwiatkowski (ruby) wrote :

Fixed in revision 64.

Changed in pythoscope:
assignee: nobody → ruby
importance: Undecided → Medium
milestone: none → static-analysis
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers