File: test_coverup_110.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-- 873 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_profiler.py:1399-1405
# lines [1399, 1400, 1405]
# branches []

import os
import pytest
from scalene.scalene_profiler import Scalene

# Test function to cover the before_fork method
def test_before_fork(monkeypatch):
    # Setup: Mock the stop_signal_queues method
    monkeypatch.setattr(Scalene, 'stop_signal_queues', lambda: None)

    # Test: Call the before_fork method
    Scalene.before_fork()

    # Verify: Since we mocked the method, we can't check the actual state, so we just ensure the method was called
    # In a real test, we would need to check the actual state or use a more sophisticated mock
    # No assertions are needed here as we are just testing that the method can be called without error

# Ensure that the test is only run when called by pytest and not during import
if __name__ == "__main__":
    pytest.main([__file__])