Message264181
Thanks Yolanda. I've touched up the test a little and run a full test run (make test) - sadly it fails: there is an explicit test that StopIteration gets raised if you set it as a side effect.
======================================================================
FAIL: test_mock_open_after_eof (unittest.test.testmock.testmock.MockTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/robertc/work/cpython-3.5.hg/Lib/unittest/test/testmock/test mock.py", line 1428, in test_mock_open_after_eof
self.assertEqual('', h.readline())
AssertionError: '' != None
======================================================================
FAIL: test_side_effect_iterator (unittest.test.testmock.testmock.MockTest )
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/robertc/work/cpython-3.5.hg/Lib/unittest/test/testmock/test mock.py", line 980, in test_side_effect_iterator
self.assertRaises(StopIteration, mock)
AssertionError: StopIteration not raised by <Mock id='140302027307384'>
======================================================================
FAIL: test_side_effect_setting_iterator (unittest.test.testmock.testmock. MockTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/robertc/work/cpython-3.5.hg/Lib/unittest/test/testmock/test mock.py", line 1015, in test_side_effect_setting_iterator
self.assertRaises(StopIteration, mock)
AssertionError: StopIteration not raised by <Mock id='140302027307720'>
----------------------------------------------------------------------
Ran 705 tests in 1.251s
FAILED (failures=3, skipped=3)
Of those, I think the first failure is a bug in the patch; the second and third are genuine failures - you'll need to make your change in mock_open itself, not in 'mock'.
I've attached an updated patch which has ACKS, NEWS filled out and tweaked your test to be more comprehensive. |
|
Date |
User |
Action |
Args |
2016-04-25 15:42:43 | rbcollins | set | recipients:
+ rbcollins, yolanda.robla |
2016-04-25 15:42:43 | rbcollins | set | messageid: <1461598963.38.0.258648874632.issue26807@psf.upfronthosting.co.za> |
2016-04-25 15:42:43 | rbcollins | link | issue26807 messages |
2016-04-25 15:42:43 | rbcollins | create | |
|