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 22host=review.opendev.org
33port=29418
44project=openstack/nova.git
5- defaultbranch=stable /2023.1
5+ defaultbranch=unmaintained /2023.1
Original file line number Diff line number Diff line change 1313# under the License.
1414
1515import errno
16+ import fixtures
1617import os
1718from unittest import mock
1819
@@ -55,6 +56,13 @@ def setUp(self):
5556 self .mock_close = close_patcher .start ()
5657 self .mock_unlink = unlink_patcher .start ()
5758 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 ()))
5866
5967 def test_supports_direct_io (self ):
6068 self .mock_open .return_value = 3
@@ -85,6 +93,7 @@ def test_supports_direct_io_with_exception_in_write(self):
8593 def test_supports_direct_io_with_exception_in_open (self ):
8694 self .mock_open .side_effect = ValueError ()
8795
96+ self .mock_open .assert_not_called ()
8897 self .assertRaises (ValueError , nova .privsep .utils .supports_direct_io ,
8998 '.' )
9099
You can’t perform that action at this time.
0 commit comments