@@ -60,60 +60,6 @@ def test_is_total_flows_unknown(args, input_type, expected_result):
60
60
assert main .is_total_flows_unknown () == expected_result
61
61
62
62
63
- @pytest .mark .parametrize (
64
- "cpu_profiler_multiprocess, expected_stop_calls, expected_print_calls" ,
65
- [ # Testcase1: CPU profiler enabled, not multiprocess
66
- (False , 1 , 1 ),
67
- # Testcase2: CPU profiler enabled, multiprocess
68
- (True , 0 , 0 ),
69
- ],
70
- )
71
- def test_cpu_profiler_release_enabled (
72
- cpu_profiler_multiprocess ,
73
- expected_stop_calls ,
74
- expected_print_calls ,
75
- ):
76
- main = ModuleFactory ().create_main_obj ()
77
- main .profilers_manager .cpu_profiler_enabled = True
78
- main .profilers_manager .cpu_profiler_multiprocess = (
79
- cpu_profiler_multiprocess
80
- )
81
- main .profilers_manager .cpu_profiler = MagicMock ()
82
- main .profilers_manager .cpu_profiler_release ()
83
-
84
- assert (
85
- main .profilers_manager .cpu_profiler .stop .call_count
86
- == expected_stop_calls
87
- )
88
- assert (
89
- main .profilers_manager .cpu_profiler .print .call_count
90
- == expected_print_calls
91
- )
92
-
93
-
94
- def test_cpu_profiler_release_disabled ():
95
- main = ModuleFactory ().create_main_obj ()
96
- main .profilers_manager .cpu_profiler_enabled = False
97
- main .profilers_manager .cpu_profiler_release ()
98
- assert not hasattr (main .profilers_manager , "memory_profiler" )
99
-
100
-
101
- def test_memory_profiler_release_enabled ():
102
- main = ModuleFactory ().create_main_obj ()
103
- main .profilers_manager .memory_profiler_enabled = True
104
- main .profilers_manager .memory_profiler = MagicMock ()
105
- main .profilers_manager .memory_profiler_release ()
106
- main .profilers_manager .memory_profiler .stop .assert_called_once ()
107
-
108
-
109
- def test_memory_profiler_release_disabled ():
110
- main = ModuleFactory ().create_main_obj ()
111
- main .profilers_manager .memory_profiler_enabled = False
112
- main .profilers_manager .memory_profiler_release ()
113
-
114
- assert not hasattr (main .profilers_manager , "memory_profiler" )
115
-
116
-
117
63
@pytest .mark .parametrize (
118
64
"mode, time_diff, expected_calls" ,
119
65
[ # Testcase1: Should update stats
0 commit comments