def test_descendsIntoPackages(self):
        """
        L{findMachinesViaWrapper} descends into packages to discover
        machines.
        """
        pythonPath = self.PythonPath([self.pathDir])
        package = self.FilePath(self.pathDir).child("test_package")
        package.makedirs()
        package.child('__init__.py').touch()

        source = """
        from automat import MethodicalMachine


        class PythonClass(object):
            _classMachine = MethodicalMachine()


        rootMachine = MethodicalMachine()
        """
        self.makeModule(source, package.path, 'module.py')

        test_package = pythonPath['test_package']
        machines = sorted(self.findMachinesViaWrapper(test_package),
                          key=operator.itemgetter(0))

        moduleDict = self.loadModuleAsDict(test_package['module'])
        rootMachine = moduleDict['test_package.module.rootMachine'].load()
        PythonClass = moduleDict['test_package.module.PythonClass'].load()

        expectedMachines = sorted(
            [('test_package.module.rootMachine',
              rootMachine),
             ('test_package.module.PythonClass._classMachine',
              PythonClass._classMachine)], key=operator.itemgetter(0))

        self.assertEqual(expectedMachines, machines)

        L{findMachinesViaWrapper} descends into packages to discover
        machines.
        
stackoverflow/venv/lib/python3.6/site-packages/automat/_test/test_discover.py