diff --git a/reframe/frontend/executors/__init__.py b/reframe/frontend/executors/__init__.py index 29b7d8dc58..48d7f7e51c 100644 --- a/reframe/frontend/executors/__init__.py +++ b/reframe/frontend/executors/__init__.py @@ -10,7 +10,6 @@ ReframeFatalError, TaskExit) from reframe.frontend.printer import PrettyPrinter from reframe.frontend.statistics import TestStats -from reframe.utility.sandbox import Sandbox ABORT_REASONS = (KeyboardInterrupt, ReframeFatalError, AssertionError) @@ -23,10 +22,8 @@ class TestCase: def __init__(self, check, partition, environ): self.__check_orig = check self.__check = copy.deepcopy(check) - - # Environments and partitions are immutable; no need to clone them - self.__partition = partition - self.__environ = environ + self.__environ = copy.deepcopy(environ) + self.__partition = copy.deepcopy(partition) def __iter__(self): # Allow unpacking a test case with a single liner: @@ -220,7 +217,6 @@ def __init__(self, policy, printer=None, max_retries=0): self._stats = TestStats() self._policy.stats = self._stats self._policy.printer = self._printer - self._sandbox = Sandbox() self._environ_snapshot = EnvironmentSnapshot() def __repr__(self): diff --git a/reframe/utility/sandbox.py b/reframe/utility/sandbox.py deleted file mode 100644 index c3b300f486..0000000000 --- a/reframe/utility/sandbox.py +++ /dev/null @@ -1,8 +0,0 @@ -from reframe.core.fields import CopyOnWriteField - - -class Sandbox: - """Sandbox class for manipulating shared resources.""" - environ = CopyOnWriteField('environ') - system = CopyOnWriteField('system') - check = CopyOnWriteField('check') diff --git a/unittests/test_fields.py b/unittests/test_fields.py index 34e22acc74..15507efda2 100644 --- a/unittests/test_fields.py +++ b/unittests/test_fields.py @@ -108,21 +108,6 @@ class FieldTester: self.assertRaises(ValueError, exec, 'tester.field = (100, 3, 65)', globals(), locals()) - def test_sandbox(self): - from reframe.core.environments import Environment - from reframe.core.systems import System - from reframe.utility.sandbox import Sandbox - - environ = Environment('myenv') - system = System('mysystem') - - sandbox = Sandbox() - sandbox.environ = environ - sandbox.system = system - - self.assertIsNot(system, sandbox.system) - self.assertIsNot(environ, sandbox.environ) - def test_proxy_field(self): class Target: def __init__(self):