classification
Title: Increased Test Coverage for Lib/random.py
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: Charles Nodell, mark.dickinson, rhettinger
Priority: low Keywords: patch

Created on 2015-06-29 18:34 by Charles Nodell, last changed 2019-08-23 07:33 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
mywork.patch Charles Nodell, 2015-06-29 18:34 patch containing additions to Lib/test/test_random.py review
Messages (4)
msg245956 - (view) Author: Charles Nodell (Charles Nodell) * Date: 2015-06-29 18:34
This patch just extends test coverage on the random library by a few lines.
msg245977 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-06-30 05:18
I don't mind adding a test but would like it to written somewhat differently.  I'll work something up when I get a chance.  Marking this as a low priority because the code is already working fine and this is just a nice addition to improve coverage.
msg246033 - (view) Author: Charles Nodell (Charles Nodell) * Date: 2015-07-01 10:38
Sounds fine! I look forward to seeing how to do this properly!
msg350260 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2019-08-23 07:33
The test code now includes this:

    def test_shuffle_random_argument(self):
        # Test random argument to shuffle.
        shuffle = self.gen.shuffle
        mock_random = unittest.mock.Mock(return_value=0.5)
        seq = bytearray(b'abcdefghijk')
        shuffle(seq, mock_random)
        mock_random.assert_called_with()

Thank you for the suggestion.
History
Date User Action Args
2019-08-23 07:33:49rhettingersetstatus: open -> closed
resolution: out of date
messages: + msg350260

stage: resolved
2015-07-01 10:38:09Charles Nodellsetmessages: + msg246033
2015-06-30 05:18:33rhettingersetpriority: normal -> low
assignee: rhettinger
messages: + msg245977
2015-06-29 20:53:12serhiy.storchakasetnosy: + rhettinger, mark.dickinson
2015-06-29 18:34:47Charles Nodellcreate