How to suppress ImportWarning in a python unittest script
问题 I am currently running a unittest script which successfully passes the various specified test with a nagging ImportWarning message in the console: ...../lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__ return f(*args, **kwds) .... ---------------------------------------------------------------------- Ran 7 tests in 1.950s OK The script is run with this main function: if __name__ == '__main__':