Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_itertools Namespace Reference

Classes

class  StopNow
class  TestBasicOps
class  TestExamples
class  TestGC
class  G
class  I
class  Ig
class  X
class  N
class  E
class  S
class  TestVariousIteratorArgs
class  LengthTransparency
class  RegressionTests
class  SubclassWithKwargsTest

Functions

def lzip
def onearg
def errfunc
def gen3
def isEven
def isOdd
def take
def prod
def fact
def R
def L
def test_main

Variables

 maxsize = support.MAX_Py_ssize_t
int minsize = 1
string libreftest
dictionary __test__ = {'libreftest' : libreftest}

Function Documentation

Definition at line 23 of file test_itertools.py.

00023 
00024 def errfunc(*args):
00025     'Test function that raises an error'
00026     raise ValueError

Definition at line 54 of file test_itertools.py.

00054 
00055 def fact(n):
00056     'Factorial'
00057     return prod(range(1, n+1))

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 27 of file test_itertools.py.

00027 
00028 def gen3():
00029     'Non-restartable source sequence'
00030     for i in (0, 1, 2):
00031         yield i

Here is the caller graph for this function:

Definition at line 32 of file test_itertools.py.

00032 
00033 def isEven(x):
00034     'Test predicate'
00035     return x%2==0

Here is the caller graph for this function:

Definition at line 36 of file test_itertools.py.

00036 
00037 def isOdd(x):
00038     'Test predicate'
00039     return x%2==1

Here is the caller graph for this function:

def test.test_itertools.L (   seqn)

Definition at line 1214 of file test_itertools.py.

01214 
01215 def L(seqn):
01216     'Test multiple tiers of iterators'
01217     return chain(map(lambda x:x, R(Ig(G(seqn)))))
01218 

Here is the call graph for this function:

def test.test_itertools.lzip (   args)

Definition at line 16 of file test_itertools.py.

00016 
00017 def lzip(*args):
00018     return list(zip(*args))

Here is the caller graph for this function:

Definition at line 19 of file test_itertools.py.

00019 
00020 def onearg(x):
00021     'Test function of one argument'
00022     return 2*x

Here is the caller graph for this function:

def test.test_itertools.prod (   iterable)

Definition at line 51 of file test_itertools.py.

00051 
00052 def prod(iterable):
00053     return reduce(operator.mul, iterable, 1)

Here is the call graph for this function:

Here is the caller graph for this function:

def test.test_itertools.R (   seqn)

Definition at line 1142 of file test_itertools.py.

01142 
01143 def R(seqn):
01144     'Regular generator'
01145     for i in seqn:
01146         yield i

Here is the caller graph for this function:

def test.test_itertools.take (   n,
  seq 
)

Definition at line 47 of file test_itertools.py.

00047 
00048 def take(n, seq):
00049     'Convenience function for partially consuming a long of infinite iterable'
00050     return list(islice(seq, n))

Here is the caller graph for this function:

def test.test_itertools.test_main (   verbose = None)

Definition at line 1688 of file test_itertools.py.

01688 
01689 def test_main(verbose=None):
01690     test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC,
01691                     RegressionTests, LengthTransparency,
01692                     SubclassWithKwargsTest, TestExamples)
01693     support.run_unittest(*test_classes)
01694 
01695     # verify reference counting
01696     if verbose and hasattr(sys, "gettotalrefcount"):
01697         import gc
01698         counts = [None] * 5
01699         for i in range(len(counts)):
01700             support.run_unittest(*test_classes)
01701             gc.collect()
01702             counts[i] = sys.gettotalrefcount()
01703         print(counts)
01704 
01705     # doctest the examples in the library reference
01706     support.run_doctest(sys.modules[__name__], verbose)


Variable Documentation

Definition at line 1686 of file test_itertools.py.

Definition at line 1457 of file test_itertools.py.

Definition at line 13 of file test_itertools.py.

Definition at line 14 of file test_itertools.py.