From 76fd0e5a5ae45d166d9c7ca9d0d71199630904d3 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 25 Apr 2024 20:59:41 -0300 Subject: [PATCH] Fix check --- src/_pytest/outcomes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/outcomes.py b/src/_pytest/outcomes.py index 8749141aa..76d94accd 100644 --- a/src/_pytest/outcomes.py +++ b/src/_pytest/outcomes.py @@ -269,7 +269,7 @@ def importorskip( reason = f"could not import {modname!r}: {exc}" skipped = Skipped(reason, allow_module_level=True) - if warn_on_import_error and not issubclass(exc, ModuleNotFoundError): + if warn_on_import_error and not isinstance(exc, ModuleNotFoundError): lines = [ "", f"Module '{modname}' was found, but when imported by pytest it raised:",