Subject | Hash | Author | Date (UTC) |
---|---|---|---|
bpo-30308: Code coverage for argument in random.shuffle (#1504) | f111fd2e65ef7aefd4ebeadbb48e84d609bf3733 | csabella | 2017-05-11 15:19:35 |
bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097) | 991adca012f5e106c2d4040ce619c696ba6f9c46 | INADA Naoki | 2017-05-11 12:18:38 |
#30190: fix invalid escape sequence warnings (#1534) | c4750959acbfc3057f12aaec832483ba30898d1c | Giampaolo Rodola | 2017-05-10 18:13:20 |
bpo-28787: Fix out of tree --with-dtrace builds (#135) | f6eae5bf1c5d7b83e5d5bdbecfff928e478c1cfd | stratakis | 2017-05-10 15:08:15 |
bpo-30281: Fix the default value for stop in PySlice_Unpack() (#1480) | 2ddf5a19c3a06978edff2c8ba0aaf5df3528204a | Xiang Zhang | 2017-05-10 10:19:41 |
bpo-30298: Weaken the condition of deprecation warnings for inline modifiers. (#1490) | 305ccbe27ea5ba82fd2d8c32ec739f980e524330 | Serhiy Storchaka | 2017-05-10 03:05:20 |
bpo-30320: test_eintr now uses pthread_sigmask() (#1523) | 211a392cc15f9a7b1b8ce65d8f6c9f8237d1b77f | Victor Stinner | 2017-05-10 00:37:42 |
PCbuild/build.bat: pass command line parameters when building PGO (#1510) | 291557e2904fa149ee3d56142f41acf63c47fea3 | Charles | 2017-05-09 21:58:48 |
bpo-30285: Optimize case-insensitive matching and searching (#1482) | 6d336a027913327fc042b0d758a16724fea27b9c | Serhiy Storchaka | 2017-05-09 20:37:14 |
bpo-30024: Circular imports involving absolute imports with binding (#1264) | f93234bb8a87855f295d441524e519481ce6ab13 | Serhiy Storchaka | 2017-05-09 19:31:05 |
bpo-30273: update distutils.sysconfig for venv's created from Python (#1515) | dbdea629e2e0e4bd8845aa55041e0a0ca4172cf3 | Jeremy Kloth | 2017-05-09 15:24:13 |
bpo-30258: regrtest: Fix run_tests_multiprocess() (#1479) | 74683fc6247c522ae955a6e7308b8ff51def35d8 | Victor Stinner | 2017-05-09 09:34:01 |
bpo-29990: Fix range checking in GB18030 decoder (#1495) | 9da408d15bdef624a5632182cb4edf98001fa82f | Xiang Zhang | 2017-05-09 03:38:32 |
bpo-30289: remove Misc/python-config.sh when make distclean (#1498) | fa5abac1e6cd74979557d5a6f960a55f40a10b0e | Xiang Zhang | 2017-05-09 02:32:13 |
bpo-29979: Rewrite cgi.parse_multipart to make it consistent with FieldStorage (#991) | cc3fa204d357be5fafc10eb8c2a80fe0bca998f1 | Pierre Quentel | 2017-05-08 12:08:34 |
Fix a trivial typo in global section (#1497) | f34c6850203a2406c4950af7a9c8a134145df4ea | Jim Fasarakis-Hilliard | 2017-05-08 11:36:29 |
Closes bpo-30168: indent methods in Logger Class (#1295) | 55ace65eba587fe3cf3759a43cccf85214651971 | Jim Fasarakis-Hilliard | 2017-05-07 18:40:18 |
Revert bpo-26293 for zipfile breakage. See also bpo-29094. (#1484) | 3763ea865cee5bbabcce11cd577811135e0fc747 | Serhiy Storchaka | 2017-05-06 11:46:01 |
bpo-30218: support path-like objects in shutil.unpack_archive() (GH-1367) | a12df7b7d40dbf47825917c8fa03d2c09b5a382c | Jelle Zijlstra | 2017-05-05 21:27:12 |
bpo-29243: Fix Makefile with respect to --enable-optimizations (#1478) | a1054c3b0037d4c2a5492e79fc193f36245366c7 | torsava | 2017-05-05 15:35:50 |
File | Lines added | Lines deleted |
---|---|---|
Lib/test/test_random.py | 11 | 1 |
File Lib/test/test_random.py changed (mode: 100644) (index 48077fb5db..45468c7ce4) | |||
... | ... | from math import log, exp, pi, fsum, sin, factorial | |
9 | 9 | from test import support | from test import support |
10 | 10 | from fractions import Fraction | from fractions import Fraction |
11 | 11 | ||
12 | |||
12 | 13 | class TestBasicOps: | class TestBasicOps: |
13 | 14 | # Superclass with tests common to all generators. | # Superclass with tests common to all generators. |
14 | 15 | # Subclasses must arrange for self.gen to retrieve the Random instance | # Subclasses must arrange for self.gen to retrieve the Random instance |
... | ... | class TestBasicOps: | |
50 | 51 | @unittest.mock.patch('random._urandom') # os.urandom | @unittest.mock.patch('random._urandom') # os.urandom |
51 | 52 | def test_seed_when_randomness_source_not_found(self, urandom_mock): | def test_seed_when_randomness_source_not_found(self, urandom_mock): |
52 | 53 | # Random.seed() uses time.time() when an operating system specific | # Random.seed() uses time.time() when an operating system specific |
53 | # randomness source is not found. To test this on machines were it | ||
54 | # randomness source is not found. To test this on machines where it | ||
54 | 55 | # exists, run the above test, test_seedargs(), again after mocking | # exists, run the above test, test_seedargs(), again after mocking |
55 | 56 | # os.urandom() so that it raises the exception expected when the | # os.urandom() so that it raises the exception expected when the |
56 | 57 | # randomness source is not available. | # randomness source is not available. |
... | ... | class TestBasicOps: | |
88 | 89 | self.assertTrue(lst != shuffled_lst) | self.assertTrue(lst != shuffled_lst) |
89 | 90 | shuffle(lst) | shuffle(lst) |
90 | 91 | self.assertTrue(lst != shuffled_lst) | self.assertTrue(lst != shuffled_lst) |
92 | self.assertRaises(TypeError, shuffle, (1, 2, 3)) | ||
93 | |||
94 | def test_shuffle_random_argument(self): | ||
95 | # Test random argument to shuffle. | ||
96 | shuffle = self.gen.shuffle | ||
97 | mock_random = unittest.mock.Mock(return_value=0.5) | ||
98 | seq = bytearray(b'abcdefghijk') | ||
99 | shuffle(seq, mock_random) | ||
100 | mock_random.assert_called_with() | ||
91 | 101 | ||
92 | 102 | def test_choice(self): | def test_choice(self): |
93 | 103 | choice = self.gen.choice | choice = self.gen.choice |