~pythonregexp2.7/python/issue2636-12

« back to all changes in this revision

Viewing changes to Lib/test/test_threading.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-06-09 14:52:42 UTC
  • mfrom: (39033.1.3 Regexp-2.6)
  • Revision ID: darklord@timehorse.com-20080609145242-9m268zc6u87rp1vp
Merged in changes from the core Regexp branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
import test.test_support
4
4
from test.test_support import verbose
5
5
import random
 
6
import re
6
7
import sys
7
8
import threading
8
9
import thread
72
73
        for i in range(NUMTASKS):
73
74
            t = TestThread("<thread %d>"%i, self, sema, mutex, numrunning)
74
75
            threads.append(t)
 
76
            self.failUnlessEqual(t.getIdent(), None)
 
77
            self.assert_(re.match('<TestThread\(.*, initial\)>', repr(t)))
75
78
            t.start()
76
79
 
77
80
        if verbose:
79
82
        for t in threads:
80
83
            t.join(NUMTASKS)
81
84
            self.assert_(not t.isAlive())
 
85
            self.failIfEqual(t.getIdent(), 0)
 
86
            self.assert_(re.match('<TestThread\(.*, \w+ -?\d+\)>', repr(t)))
82
87
        if verbose:
83
88
            print 'all tasks done'
84
89
        self.assertEqual(numrunning.get(), 0)