Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_timeit.FakeTimer Class Reference

List of all members.

Public Member Functions

def __init__
def __call__
def inc
def setup
def wrap_timer

Public Attributes

 count
 setup_calls
 seconds_per_increment
 saved_timer

Static Public Attributes

float BASE_TIME = 42.0

Detailed Description

Definition at line 24 of file test_timeit.py.


Constructor & Destructor Documentation

def test.test_timeit.FakeTimer.__init__ (   self,
  seconds_per_increment = 1.0 
)

Definition at line 26 of file test_timeit.py.

00026 
00027     def __init__(self, seconds_per_increment=1.0):
00028         self.count = 0
00029         self.setup_calls = 0
00030         self.seconds_per_increment=seconds_per_increment
00031         timeit._fake_timer = self

Here is the caller graph for this function:


Member Function Documentation

Definition at line 32 of file test_timeit.py.

00032 
00033     def __call__(self):
00034         return self.BASE_TIME + self.count * self.seconds_per_increment

Definition at line 35 of file test_timeit.py.

00035 
00036     def inc(self):
00037         self.count += 1

Definition at line 38 of file test_timeit.py.

00038 
00039     def setup(self):
00040         self.setup_calls += 1

Here is the caller graph for this function:

def test.test_timeit.FakeTimer.wrap_timer (   self,
  timer 
)
Records 'timer' and returns self as callable timer.

Definition at line 41 of file test_timeit.py.

00041 
00042     def wrap_timer(self, timer):
00043         """Records 'timer' and returns self as callable timer."""
00044         self.saved_timer = timer
00045         return self


Member Data Documentation

float test.test_timeit.FakeTimer.BASE_TIME = 42.0 [static]

Definition at line 25 of file test_timeit.py.

Definition at line 27 of file test_timeit.py.

Definition at line 43 of file test_timeit.py.

Definition at line 29 of file test_timeit.py.

Definition at line 28 of file test_timeit.py.


The documentation for this class was generated from the following file: