Irit Katriel <iritkatr...@gmail.com> added the comment:
I've close PR26937 since we're not going for that. The test from it might still be useful, so I'm copying it here: def test_package_without_a_main(self): pkg_name = 't_pkg' module_name = 't_main' os_helper.rmtree(pkg_name) modpath = pkg_name + '/' + module_name os.makedirs(modpath) with open(modpath + '/__init__.py', 'w') as f: pass self.addCleanup(os_helper.rmtree, pkg_name) stdout, stderr = self._run_pdb(['-m', modpath.replace('/', '.')], "") self.assertIn( "'t_pkg.t_main' is a package and cannot be directly executed", stdout) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44461> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com