From 707226298a445016b72bb7bf749a5e4aee36c8e5 Mon Sep 17 00:00:00 2001 From: TomV Date: Wed, 7 Oct 2015 09:23:46 +0100 Subject: [PATCH] issue1035 add test for classes setting __getattr__ --- testing/python/collect.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/testing/python/collect.py b/testing/python/collect.py index f660a8ab1..228d58364 100644 --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -95,6 +95,16 @@ class TestClass: "*1 passed*", ]) + def test_issue1035_obj_has_getattr(self, testdir): + modcol = testdir.getmodulecol(""" + class Chameleon(object): + def __getattr__(self, name): + return True + chameleon = Chameleon() + """) + colitems = modcol.collect() + assert len(colitems) == 0 + class TestGenerator: def test_generative_functions(self, testdir):