File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 2
2
host=review.opendev.org
3
3
port=29418
4
4
project=openstack/nova.git
5
- defaultbranch=stable /2023.1
5
+ defaultbranch=unmaintained /2023.1
Original file line number Diff line number Diff line change 13
13
# under the License.
14
14
15
15
import errno
16
+ import fixtures
16
17
import os
17
18
from unittest import mock
18
19
@@ -55,6 +56,13 @@ def setUp(self):
55
56
self .mock_close = close_patcher .start ()
56
57
self .mock_unlink = unlink_patcher .start ()
57
58
random_string_patcher .start ()
59
+ # as of change Iac1b0891ae584ce4b95964e6cdc0ff2483a4e57d in oslo.log
60
+ # oslo.log will now internally call os.write() in its PipeMutex code.
61
+ # This causes the mock_write() to be called which breaks some of
62
+ # the testcases as we expect mock_write() to be called only
63
+ # by the code under test.
64
+ self .useFixture (fixtures .MonkeyPatch (
65
+ "nova.privsep.utils.LOG" , mock .Mock ()))
58
66
59
67
def test_supports_direct_io (self ):
60
68
self .mock_open .return_value = 3
@@ -85,6 +93,7 @@ def test_supports_direct_io_with_exception_in_write(self):
85
93
def test_supports_direct_io_with_exception_in_open (self ):
86
94
self .mock_open .side_effect = ValueError ()
87
95
96
+ self .mock_open .assert_not_called ()
88
97
self .assertRaises (ValueError , nova .privsep .utils .supports_direct_io ,
89
98
'.' )
90
99
You can’t perform that action at this time.
0 commit comments