Skip to content

Commit bc663b1

Browse files
authored
Merge pull request #2222 from marqh/dottest
Prevent dot_path tests from corrupting the stored path.
2 parents e3bc58d + 66b5c6d commit bc663b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: lib/iris/tests/unit/fileformats/dot/test__dot_path.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import mock
3030

31-
from iris.fileformats.dot import _dot_path
31+
from iris.fileformats.dot import _dot_path, _DOT_EXECUTABLE_PATH
3232

3333

3434
class Test(tests.IrisTest):
@@ -37,6 +37,11 @@ def setUp(self):
3737
# reset the caching status to allow us to see what happens
3838
# under different circumstances.
3939
self.patch('iris.fileformats.dot._DOT_CHECKED', new=False)
40+
# Also patch the private path variable to the existing value (i.e. no
41+
# change), and restore it after each test: As these tests modify it,
42+
# that can potentially break subsequent 'normal' behaviour.
43+
self.patch('iris.fileformats.dot._DOT_EXECUTABLE_PATH',
44+
_DOT_EXECUTABLE_PATH)
4045

4146
def test_valid_absolute_path(self):
4247
# Override the configuration value for System.dot_path

0 commit comments

Comments
 (0)