File tree 1 file changed +2
-7
lines changed
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 4
4
import locale
5
5
import operator
6
6
import os
7
+ import random
7
8
import struct
8
9
import subprocess
9
10
import sys
19
20
import warnings
20
21
21
22
22
- # count the number of test runs, used to create unique
23
- # strings to intern in test_intern()
24
- INTERN_NUMRUNS = 0
25
-
26
23
DICT_KEY_STRUCT_FORMAT = 'n2BI2n'
27
24
28
25
class DisplayHookTest (unittest .TestCase ):
@@ -685,10 +682,8 @@ def test_43581(self):
685
682
self .assertEqual (sys .__stdout__ .encoding , sys .__stderr__ .encoding )
686
683
687
684
def test_intern (self ):
688
- global INTERN_NUMRUNS
689
- INTERN_NUMRUNS += 1
690
685
self .assertRaises (TypeError , sys .intern )
691
- s = "never interned before" + str (INTERN_NUMRUNS )
686
+ s = "never interned before" + str (random . randrange ( 0 , 10 ** 9 ) )
692
687
self .assertTrue (sys .intern (s ) is s )
693
688
s2 = s .swapcase ().swapcase ()
694
689
self .assertTrue (sys .intern (s2 ) is s )
You can’t perform that action at this time.
0 commit comments