File: test_stats.py

package info (click to toggle)
austin 3.7.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,444 kB
  • sloc: ansic: 8,622; python: 2,669; sh: 106; makefile: 54
file content (16 lines) | stat: -rw-r--r-- 335 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import test.cunit.stats as stats
import time


def test_stats_gettime():
    begin = stats.gettime()
    time.sleep(1)
    delta = stats.gettime() - begin
    assert 0.95 <= delta / 1e6 <= 1.05


def test_stats_duration():
    stats.stats_start()
    time.sleep(1)
    dur = stats.stats_duration()
    assert 0.95 <= dur / 1e6 <= 1.05