| 76 | self.assertTrue(dir(sys.modules[modname])) |
| 77 | |
| 78 | def walk_modules(self, basedir, modpath): |
| 79 | for fn in sorted(os.listdir(basedir)): |
| 80 | path = os.path.join(basedir, fn) |
| 81 | if os.path.isdir(path): |
| 82 | if fn in SKIP_MODULES: |
| 83 | continue |
| 84 | pkg_init = os.path.join(path, '__init__.py') |
| 85 | if os.path.exists(pkg_init): |
| 86 | yield pkg_init, modpath + fn |
| 87 | for p, m in self.walk_modules(path, modpath + fn + "."): |
| 88 | yield p, m |
| 89 | continue |
| 90 | |
| 91 | if fn == '__init__.py': |
| 92 | continue |
| 93 | if not fn.endswith('.py'): |
| 94 | continue |
| 95 | modname = fn.removesuffix('.py') |
| 96 | if modname in SKIP_MODULES: |
| 97 | continue |
| 98 | yield path, modpath + modname |
| 99 | |
| 100 | def test_all(self): |
| 101 | # List of denied modules and packages |