summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_random.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused imports in test modules.Georg Brandl2010-02-071-1/+1
|
* #7092: Silence more py3k warnings. Patch by Florent Xicluna.Ezio Melotti2010-02-031-0/+1
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-2/+2
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-1/+0
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-0/+1
| | | | Patch by flox
* Silence py3k warning claiming to affect the random moduleAntoine Pitrou2009-10-141-4/+6
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-18/+18
|
* Inline coefficients in gamma(). Add reflection formula. Add comments.Raymond Hettinger2009-02-191-10/+18
|
* warnings.catch_warnings() now returns a list or None instead of the customBrett Cannon2008-09-091-1/+1
| | | | | | | | WarningsRecorder object. This makes the API simpler to use as no special object must be learned. Closes issue 3781. Review by Benjamin Peterson.
* Rename math.sum to math.fsumMark Dickinson2008-07-301-1/+1
|
* Improve accuracy of gamma test functionRaymond Hettinger2008-07-191-5/+3
|
* Issue 1681432: Add triangular distribution the random module.Raymond Hettinger2008-03-231-0/+2
|
* Issue #1727780: Support loading pickles of random.Random objects createdMartin v. Löwis2007-12-031-0/+13
| | | | | | on 32-bit systems on 64-bit systems, and vice versa. As a consequence of the change, Random pickles created by Python 2.6 cannot be loaded in Python 2.5.
* Remove test.test_support.guard_warnings_filter.Brett Cannon2007-08-141-1/+1
| | | | | | | | test.test_support.catch_warning is more full-featured and provides the same functionality. Since guard_warnings_filter was added in 2.6 there is no backwards-compatibility issues.
* Bug #1486663: don't reject keyword arguments for subclasses of builtinGeorg Brandl2007-01-211-0/+8
| | | | types.
* Bug #1590891: random.randrange don't return correct value for big numberRaymond Hettinger2006-12-201-0/+8
| | | | Needs to be backported.
* Add test.test_support.guard_warnings_filter . This function returns a contextBrett Cannon2006-12-131-4/+3
| | | | | manager that protects warnings.filter from being modified once the context is exited.
* Another crack at bug #1460340: make random.sample(dict)Tim Peters2006-04-011-2/+18
| | | | work, this time by ugly brute force.
* SF bug #1460340: random.sample can raise KeyErrorRaymond Hettinger2006-03-291-0/+3
| | | | Fix the hit and miss style of testing for sets and dicts.
* Use floor division operator.Raymond Hettinger2004-09-271-1/+1
|
* SF #1027105: HardwareRandom should be renamed OSRandomRaymond Hettinger2004-09-131-4/+4
| | | | | | Renamed the new generator at Trevor's recommendation. The name HardwareRandom suggested a bit more than it delivered (no radioactive decay detectors or such).
* Fulfill Martin's request to use try/except rather than a "look beforeRaymond Hettinger2004-09-051-1/+5
| | | | you leap" approach. Makes the early call to os.urandom() unnecessary.
* SF bug #1022010: Import random failsRaymond Hettinger2004-09-041-3/+6
| | | | | * Complete the previous patch by making sure that the MachineRandom tests are only run when the underlying resource is available.
* Teach the random module about os.urandom().Raymond Hettinger2004-08-301-0/+102
| | | | | * Use it for seeding when it is available. * Provide an alternate generator based on it.
* Add some tests for corner cases.Raymond Hettinger2004-07-091-1/+25
|
* * Migrate set() and frozenset() from the sandbox.Raymond Hettinger2003-11-161-8/+6
| | | | | | | | * Install the unittests, docs, newsitem, include file, and makefile update. * Exercise the new functions whereever sets.py was being used. Includes the docs for libfuncs.tex. Separate docs for the types are forthcoming.
* SF bug #812202: randint is always evenRaymond Hettinger2003-10-051-0/+78
| | | | | | | * Added C coded getrandbits(k) method that runs in linear time. * Call the new method from randrange() for ranges >= 2**53. * Adds a warning for generators not defining getrandbits() whenever they have a call to randrange() with too large of a population.
* SF bug #801342: Bug (documentation or real, your choice) in random.sample.Raymond Hettinger2003-09-061-0/+10
| | | | | | | | | | | | random.sample() uses one of two algorithms depending on the ratio of the sample size to the population size. One of the algorithms accepted any iterable population argument so long as it defined __len__(). The other had a stronger requirement that the population argument be indexable. While it met the documentation specifications which insisted that the population argument be a sequence, it made random.sample() less usable with sets. So, the second algorithm was modified to coerce non-indexable iterables and dictionaries into a tuple before proceeding.
* SF bug #778964: bad seed in python 2.3 randomRaymond Hettinger2003-08-091-1/+1
| | | | | | | The default seed is time.time(). Multiplied by 256 before truncating so that fractional seconds are used. This way, two successive calls to random.seed() are much more likely to produce different sequences.
* SF bug #759889: Pickling of Random is brokenRaymond Hettinger2003-06-241-0/+7
| | | | | * Implement __reduce__() to support pickling. * Add a test case to prove a successful roundtrip through pickle.
* Apply the simplified test_support boilerplate.Raymond Hettinger2003-05-031-6/+4
|
* Simplify ref count test.Raymond Hettinger2003-05-021-3/+3
|
* SF bug #690083: test_random fails sometimesRaymond Hettinger2003-02-211-1/+1
| | | | | | time.sleep(1) sometimes delays for fractionally less than a second resulting in too short of an interval for C's time.time() function to create a distinct seed.
* Add refcount test.Raymond Hettinger2003-02-041-3/+12
|
* * Migrate sample distribution test from random.py to test_random.py.Raymond Hettinger2003-01-171-5/+22
| | | | * Use Sets module to more clearly articulate a couple of tests.
* Move the statistical tests for four distributions into the unittest suite.Raymond Hettinger2003-01-051-0/+41
|
* Add a test case.Raymond Hettinger2003-01-051-0/+19
|
* Test an edge case for sample().Raymond Hettinger2003-01-041-0/+1
|
* SF patch 658251: Install a C implementation of the Mersenne Twister as theRaymond Hettinger2002-12-291-14/+201
| | | | core generator for random.py.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* random.gauss() uses a piece of hidden state used by nothing else,Tim Peters2002-05-051-0/+19
and the .seed() and .whseed() methods failed to reset it. In other words, setting the seed didn't completely determine the sequence of results produced by random.gauss(). It does now. Programs repeatedly mixing calls to a seed method with calls to gauss() may see different results now. Bugfix candidate (random.gauss() has always been broken in this way), despite that it may change results.