This function check for server mode test cases. :param all_modules: all modules. :param exclude_pkgs: exclude package list.
(all_modules, exclude_pkgs)
| 114 | |
| 115 | @staticmethod |
| 116 | def _exclude_packages(all_modules, exclude_pkgs): |
| 117 | """ |
| 118 | This function check for server mode test cases. |
| 119 | :param all_modules: all modules. |
| 120 | :param exclude_pkgs: exclude package list. |
| 121 | """ |
| 122 | for module_name in all_modules: |
| 123 | try: |
| 124 | if "tests." in str(module_name) and not any( |
| 125 | str(module_name).startswith( |
| 126 | 'pgadmin.' + str(exclude_pkg) |
| 127 | ) for exclude_pkg in exclude_pkgs |
| 128 | ): |
| 129 | import_module(module_name) |
| 130 | except ImportError: |
| 131 | traceback.print_exc(file=sys.stderr) |
| 132 | |
| 133 | |
| 134 | class BaseTestGenerator(unittest.TestCase, metaclass=TestsGeneratorRegistry): |