Skip to content

Commit db2ae5d

Browse files
committed
[python] try to fix gh-actions for windows
1 parent d7d9d7a commit db2ae5d

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

python/dalex/test/test_arena_classification.py

+27-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def setUp(self):
2222

2323
self.X = data.drop(columns='survived')
2424
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'])
2627

2728
numeric_features = ['age', 'fare', 'sibsp', 'parch']
2829
numeric_transformer = Pipeline(steps=[
@@ -66,6 +67,11 @@ def test_supported_plots(self):
6667
sorting = lambda x: x.__name__
6768
self.assertEqual(sorted(plots, key=sorting), sorted(self.reference_plots, key=sorting))
6869

70+
try:
71+
arena.stop_server()
72+
except Exception:
73+
pass
74+
6975
def test_server(self):
7076
arena = dx.Arena()
7177
arena.push_model(self.exp)
@@ -78,7 +84,11 @@ def test_server(self):
7884
arena.stop_server()
7985
except AssertionError as e:
8086
arena.stop_server()
81-
raise e
87+
88+
try:
89+
arena.stop_server()
90+
except Exception:
91+
pass
8292

8393
def test_plots(self):
8494
arena = dx.Arena()
@@ -91,6 +101,11 @@ def test_plots(self):
91101
count = np.sum([1 for plot in arena.plots_manager.cache if plot.__class__ == p])
92102
self.assertEqual(np.prod(ref_counts), count, msg="Count of " + str(p))
93103

104+
try:
105+
arena.stop_server()
106+
except Exception:
107+
pass
108+
94109
def test_observation_attributes(self):
95110
arena = dx.Arena()
96111
arena.push_model(self.exp)
@@ -103,6 +118,11 @@ def test_observation_attributes(self):
103118
for attr in attrs:
104119
self.assertTrue(all(attr.get('values')[:-1] == titanic[attr.get('name')]))
105120

121+
try:
122+
arena.stop_server()
123+
except Exception:
124+
pass
125+
106126
def test_variable_attributes(self):
107127
arena = dx.Arena()
108128
arena.push_model(self.exp)
@@ -119,5 +139,10 @@ def test_variable_attributes(self):
119139
'sibsp': {'type': 'numeric', 'min': 0, 'max': 8, 'levels': [0, 1, 2, 3, 4, 5, 8]}
120140
})
121141

142+
try:
143+
arena.stop_server()
144+
except Exception:
145+
pass
146+
122147
if __name__ == '__main__':
123148
unittest.main()

python/dalex/test/test_ceteris_paribus.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def test_plot(self):
184184
fig3 = case1.plot(case2, variables="age", show=False)
185185
fig4 = case2.plot(variables="gender", show=False)
186186
fig5 = case1.plot(case3, size=1, color="gender", facet_ncol=1, show_observations=False,
187-
title="title", horizontal_spacing=0.2, vertical_spacing=0.2,
187+
title="title", horizontal_spacing=0.2, vertical_spacing=0.15,
188188
show=False)
189189
fig6 = case2.plot(variables=["gender"], show=False)
190190
fig7 = case2.plot(variables=["gender", 'class'], show=False)

0 commit comments

Comments
 (0)