pylint-bot / test

0 stars 0 forks source link

[modular-locals bugs] unittest_scoped_nodes, test_cls_special_attributes_1 and test_instance_special_attributes #249

Closed pylint-bot closed 8 years ago

pylint-bot commented 8 years ago

Originally reported by: BitBucket: ceridwenv, GitHub: @ceridwen?


These test is failing because the docstring attribute of the mock ASTs for list and int are no longer tuples:

            self.assertEqual(len(cls.getattr('__doc__')), 1, (cls, cls.getattr('__doc__')))
          self.assertEqual(len(inst.getattr('__doc__')), 1)

What I don't understand is why they were enclosed in tuples in the first place. Maybe change this to a test to make sure it's a Const(str) node and call it a day?


pylint-bot commented 8 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?):


Are they really tuples? When I ran the test, I get a list of Consts, which is actually correct, because getattr returns all the possible values.

pylint-bot commented 8 years ago

Original comment by BitBucket: ceridwenv, GitHub: @ceridwen?:


Hmm, for some reason it was displaying as with parentheses rather than brackets in the REPL, so I thought it was a tuple, but checking the type shows it's a list, so it's working as expected.

pylint-bot commented 8 years ago

Original comment by BitBucket: ceridwenv, GitHub: @ceridwen?:


ast_from_object was double-counting doc and so getattr was producing a length-2 list, fixed in 6da8294.