def test_onlyTopModules(self):
        """
        Verify that the iterModules API will only return top-level modules and
        packages, not submodules or subpackages.
        """
        for module in modules.iterModules():
            self.assertFalse(
                '.' in module.name,
                "no nested modules should be returned from iterModules: %r"
                % (module.filePath))

        Verify that the iterModules API will only return top-level modules and
        packages, not submodules or subpackages.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_modules.py