File: test_coverup_46.py

package info (click to toggle)
scalene 1.5.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,528 kB
  • sloc: cpp: 22,930; python: 13,403; javascript: 11,769; ansic: 817; makefile: 196; sh: 45
file content (23 lines) | stat: -rw-r--r-- 846 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# file scalene/scalene_client_timer.py:38-40
# lines [40]
# branches []

import pytest
from scalene.scalene_client_timer import ScaleneClientTimer

@pytest.fixture
def scalene_client_timer():
    return ScaleneClientTimer()

def test_get_itimer(scalene_client_timer):
    # Assuming ScaleneClientTimer has attributes `seconds` and `interval` that can be set.
    # If these attributes do not exist, they should be added to the class for this test to work.
    expected_seconds = 1.0
    expected_interval = 0.1
    scalene_client_timer.seconds = expected_seconds
    scalene_client_timer.interval = expected_interval

    seconds, interval = scalene_client_timer.get_itimer()

    assert seconds == expected_seconds, "The returned seconds value is incorrect."
    assert interval == expected_interval, "The returned interval value is incorrect."