@@ -22,7 +22,8 @@ def setUp(self):
22
22
23
23
self .X = data .drop (columns = 'survived' )
24
24
self .y = data .survived
25
- self .john = pd .DataFrame ({'gender' : ['male' ], 'age' : [25 ], 'class' : ['1st' ], 'embarked' : ['Southampton' ], 'fare' : [72 ], 'sibsp' : [0 ], 'parch' : 0 }, index = ['John' ])
25
+ self .john = pd .DataFrame ({'gender' : ['male' ], 'age' : [25 ], 'class' : ['1st' ], 'embarked' : ['Southampton' ],
26
+ 'fare' : [72 ], 'sibsp' : [0 ], 'parch' : 0 }, index = ['John' ])
26
27
27
28
numeric_features = ['age' , 'fare' , 'sibsp' , 'parch' ]
28
29
numeric_transformer = Pipeline (steps = [
@@ -66,6 +67,11 @@ def test_supported_plots(self):
66
67
sorting = lambda x : x .__name__
67
68
self .assertEqual (sorted (plots , key = sorting ), sorted (self .reference_plots , key = sorting ))
68
69
70
+ try :
71
+ arena .stop_server ()
72
+ except Exception :
73
+ pass
74
+
69
75
def test_server (self ):
70
76
arena = dx .Arena ()
71
77
arena .push_model (self .exp )
@@ -78,7 +84,11 @@ def test_server(self):
78
84
arena .stop_server ()
79
85
except AssertionError as e :
80
86
arena .stop_server ()
81
- raise e
87
+
88
+ try :
89
+ arena .stop_server ()
90
+ except Exception :
91
+ pass
82
92
83
93
def test_plots (self ):
84
94
arena = dx .Arena ()
@@ -91,6 +101,11 @@ def test_plots(self):
91
101
count = np .sum ([1 for plot in arena .plots_manager .cache if plot .__class__ == p ])
92
102
self .assertEqual (np .prod (ref_counts ), count , msg = "Count of " + str (p ))
93
103
104
+ try :
105
+ arena .stop_server ()
106
+ except Exception :
107
+ pass
108
+
94
109
def test_observation_attributes (self ):
95
110
arena = dx .Arena ()
96
111
arena .push_model (self .exp )
@@ -103,6 +118,11 @@ def test_observation_attributes(self):
103
118
for attr in attrs :
104
119
self .assertTrue (all (attr .get ('values' )[:- 1 ] == titanic [attr .get ('name' )]))
105
120
121
+ try :
122
+ arena .stop_server ()
123
+ except Exception :
124
+ pass
125
+
106
126
def test_variable_attributes (self ):
107
127
arena = dx .Arena ()
108
128
arena .push_model (self .exp )
@@ -119,5 +139,10 @@ def test_variable_attributes(self):
119
139
'sibsp' : {'type' : 'numeric' , 'min' : 0 , 'max' : 8 , 'levels' : [0 , 1 , 2 , 3 , 4 , 5 , 8 ]}
120
140
})
121
141
142
+ try :
143
+ arena .stop_server ()
144
+ except Exception :
145
+ pass
146
+
122
147
if __name__ == '__main__' :
123
148
unittest .main ()
0 commit comments