Skip to content

Commit 59b18f6

Browse files
committed
Add RuntimeError for pytest in ArrayEditor error handling
1 parent c106e3a commit 59b18f6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

guidata/widgets/arrayeditor/arrayeditor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from __future__ import annotations
2020

21+
import sys
2122
from typing import Generic
2223

2324
import numpy as np
@@ -453,6 +454,8 @@ def error(self, message: str) -> None:
453454
Args:
454455
message: Error message
455456
"""
457+
if "pytest" in sys.modules:
458+
raise RuntimeError(message)
456459
QMessageBox.critical(self, _("Array editor"), message)
457460
self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose)
458461
self.reject()

0 commit comments

Comments
 (0)