5
5
import glob
6
6
import os
7
7
import time
8
- from typing import Optional
8
+ # from typing import Optional
9
9
10
10
11
11
# Flags for testing callbacks
14
14
snapshot_triggered = False
15
15
16
16
# Cluster objects returned from callbacks
17
- cluster_from_disable_listener : Optional [Cluster ] = None
18
- cluster_from_snapshot_listener : Optional [Cluster ] = None
17
+ # cluster_from_disable_listener: Optional[Cluster] = None
18
+ # cluster_from_snapshot_listener: Optional[Cluster] = None
19
19
20
20
21
21
class MyMetricsListeners :
@@ -26,17 +26,17 @@ def enable():
26
26
def disable (cluster : Cluster ):
27
27
global disable_triggered
28
28
disable_triggered = True
29
- global cluster_from_disable_listener
30
- cluster_from_disable_listener = cluster
29
+ # global cluster_from_disable_listener
30
+ # cluster_from_disable_listener = cluster
31
31
32
32
def node_close (node : Node ):
33
33
pass
34
34
35
35
def snapshot (cluster : Cluster ):
36
36
global snapshot_triggered
37
37
snapshot_triggered = True
38
- global cluster_from_snapshot_listener
39
- cluster_from_snapshot_listener = cluster
38
+ # global cluster_from_snapshot_listener
39
+ # cluster_from_snapshot_listener = cluster
40
40
41
41
def throw_exc ():
42
42
raise Exception ()
@@ -53,10 +53,10 @@ def setup(self, as_connection, request):
53
53
disable_triggered = False
54
54
snapshot_triggered = False
55
55
56
- global cluster_from_disable_listener
57
- global cluster_from_snapshot_listener
58
- cluster_from_disable_listener = None
59
- cluster_from_snapshot_listener = None
56
+ # global cluster_from_disable_listener
57
+ # global cluster_from_snapshot_listener
58
+ # cluster_from_disable_listener = None
59
+ # cluster_from_snapshot_listener = None
60
60
61
61
# Set defaults (in case they were overwritten by a test)
62
62
self .metrics_log_folder = "."
@@ -140,9 +140,9 @@ def test_setting_metrics_policy_custom_settings(self):
140
140
assert snapshot_triggered is True
141
141
142
142
# The Cluster objects returned from the disable and snapshot callbacks should be populated
143
- global cluster_from_disable_listener
144
- global cluster_from_snapshot_listener
145
- for cluster in [cluster_from_disable_listener , cluster_from_snapshot_listener ]:
143
+ # global cluster_from_disable_listener
144
+ # global cluster_from_snapshot_listener
145
+ for cluster in []:
146
146
assert type (cluster ) == Cluster
147
147
assert cluster .cluster_name is None or type (cluster .cluster_name ) == str
148
148
assert type (cluster .invalid_node_count ) == int
0 commit comments