From 4f9afe2a8d54d39d88fdc0eea201b26ff6e49c9c Mon Sep 17 00:00:00 2001 From: BigYajuu Date: Wed, 14 Sep 2022 12:56:09 +0800 Subject: [PATCH] Muted CollectError of importerror from raising --- src/_pytest/python.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 3db877506..6c46ff14a 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -639,12 +639,12 @@ class Module(nodes.File, PyCollector): else exc_info.exconly() ) formatted_tb = str(exc_repr) - raise self.CollectError( - "ImportError while importing test module '{path}'.\n" - "Hint: make sure your test modules/packages have valid Python names.\n" - "Traceback:\n" - "{traceback}".format(path=self.path, traceback=formatted_tb) - ) from e + # raise self.CollectError( + # "ImportError while importing test module '{path}'.\n" + # "Hint: make sure your test modules/packages have valid Python names.\n" + # "Traceback:\n" + # "{traceback}".format(path=self.path, traceback=formatted_tb) + # ) from e except skip.Exception as e: if e.allow_module_level: raise