Back to index

python3.2  3.2.2
Functions | Variables
test.sample_doctest Namespace Reference

Functions

def foo
def bar
def test_silly_setup
def w_blank
def x_is_one
def y_is_one
def test_suite

Variables

int x = 1
dictionary __test__

Detailed Description

This is a sample module that doesn't really test anything all that
   interesting.

It simply has a few tests, some of which succeed and some of which fail.

It's important that the numbers remain constant as another test is
testing the running of these tests.


>>> 2+2
4

Function Documentation

>>> 2+2
4

Definition at line 25 of file sample_doctest.py.

00025 
00026 def bar():
00027     """
00028 
00029     >>> 2+2
00030     4
00031     """

>>> 2+2
5

>>> 2+2
4

Definition at line 15 of file sample_doctest.py.

00015 
00016 def foo():
00017     """
00018 
00019     >>> 2+2
00020     5
00021 
00022     >>> 2+2
00023     4
00024     """

>>> import test.test_doctest
>>> test.test_doctest.sillySetup
True

Definition at line 32 of file sample_doctest.py.

00032 
00033 def test_silly_setup():
00034     """
00035 
00036     >>> import test.test_doctest
00037     >>> test.test_doctest.sillySetup
00038     True
00039     """

Definition at line 74 of file sample_doctest.py.

00074 
00075 def test_suite():
00076     import doctest
00077     return doctest.DocTestSuite()

Here is the call graph for this function:

>>> if 1:
...    print('a')
...    print()
...    print('b')
a
<BLANKLINE>
b

Definition at line 40 of file sample_doctest.py.

00040 
00041 def w_blank():
00042     """
00043     >>> if 1:
00044     ...    print('a')
00045     ...    print()
00046     ...    print('b')
00047     a
00048     <BLANKLINE>
00049     b
00050     """

>>> x
1

Definition at line 52 of file sample_doctest.py.

00052 
00053 def x_is_one():
00054     """
00055     >>> x
00056     1
00057     """

>>> y
1

Definition at line 58 of file sample_doctest.py.

00058 
00059 def y_is_one():
00060     """
00061     >>> y
00062     1
00063     """


Variable Documentation

Initial value:
00001 {'good': """                    >>> 42                    42                    """,
00002             'bad':  """                    >>> 42                    666                    """,
00003            }

Definition at line 64 of file sample_doctest.py.

Definition at line 51 of file sample_doctest.py.