~ubuntu-branches/ubuntu/oneiric/python2.6/oneiric

« back to all changes in this revision

Viewing changes to Lib/test/test_random.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-08-07 20:03:08 UTC
  • mfrom: (10.1.27 sid)
  • Revision ID: james.westby@ubuntu.com-20100807200308-bwsyymoc4donr9a9
Tags: 2.6.6~rc1-1ubuntu1
* Merge with Debian; remaining changes:
  - Regenerate the control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import pickle
7
7
import warnings
8
8
from math import log, exp, sqrt, pi, fsum as msum
 
9
from functools import reduce
9
10
from test import test_support
10
11
 
11
12
class TestBasicOps(unittest.TestCase):
52
53
        state3 = self.gen.getstate()    # s/b distinct from state2
53
54
        self.assertNotEqual(state2, state3)
54
55
 
55
 
        self.assertRaises(TypeError, self.gen.jumpahead)  # needs an arg
56
 
        self.assertRaises(TypeError, self.gen.jumpahead, "ick")  # wrong type
57
 
        self.assertRaises(TypeError, self.gen.jumpahead, 2.3)  # wrong type
58
 
        self.assertRaises(TypeError, self.gen.jumpahead, 2, 3)  # too many
 
56
        with test_support._check_py3k_warnings(quiet=True):
 
57
            self.assertRaises(TypeError, self.gen.jumpahead)  # needs an arg
 
58
            self.assertRaises(TypeError, self.gen.jumpahead, "ick")  # wrong type
 
59
            self.assertRaises(TypeError, self.gen.jumpahead, 2.3)  # wrong type
 
60
            self.assertRaises(TypeError, self.gen.jumpahead, 2, 3)  # too many
59
61
 
60
62
    def test_sample(self):
61
63
        # For the entire allowable range of 0 <= k <= N, validate that