def test_walkObeysDescend(self):
        """
        Verify that when the supplied C{descend} predicate returns C{False},
        the target is not traversed.
        """
        self.createLinks()
        def noSymLinks(path):
            return not path.islink()
        x = [foo.path for foo in self.path.walk(descend=noSymLinks)]
        self.assertEqual(set(x), set(self.all))

        Verify that when the supplied C{descend} predicate returns C{False},
        the target is not traversed.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_paths.py