diff --git a/Orange/canvas/tests/__init__.py b/Orange/canvas/tests/__init__.py index 15b1863c865..132be49d7a1 100644 --- a/Orange/canvas/tests/__init__.py +++ b/Orange/canvas/tests/__init__.py @@ -1,3 +1,4 @@ from Orange.data import Table -Table.LOCKING = True +if Table.LOCKING is None: + Table.LOCKING = True diff --git a/Orange/data/table.py b/Orange/data/table.py index 76d1347022e..85b9d336c9b 100644 --- a/Orange/data/table.py +++ b/Orange/data/table.py @@ -359,7 +359,14 @@ def __init__(self, source, destination): # noinspection PyPep8Naming class Table(Sequence, Storage): - LOCKING = False + + LOCKING = None + """ If the class attribute LOCKING is True, tables will throw exceptions + on in-place modifications unless unlocked explicitly. LOCKING is supposed + to be set to True for testing to help us find bugs. If set to False + or None, no safeguards are in place. Two different values are used for + the same behaviour to distinguish the unchanged default (None) form + explicit deactivation (False) that some add-ons might need. """ __file__ = None name = "untitled" diff --git a/Orange/tests/__init__.py b/Orange/tests/__init__.py index 2c297859375..b27f28a115e 100644 --- a/Orange/tests/__init__.py +++ b/Orange/tests/__init__.py @@ -12,7 +12,8 @@ import numpy as np import Orange -Orange.data.Table.LOCKING = True +if Orange.data.Table.LOCKING is None: + Orange.data.Table.LOCKING = True @contextmanager diff --git a/Orange/widgets/tests/__init__.py b/Orange/widgets/tests/__init__.py index 5a418d34342..9de76632823 100644 --- a/Orange/widgets/tests/__init__.py +++ b/Orange/widgets/tests/__init__.py @@ -4,8 +4,8 @@ import Orange import Orange.widgets - -Orange.data.Table.LOCKING = True +if Orange.data.Table.LOCKING is None: + Orange.data.Table.LOCKING = True def load_tests(loader, tests, pattern):