Skip to content

Commit a42428c

Browse files
committed
add MemoryError caught
1 parent 944c6ec commit a42428c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

climada/test/test_exposures.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def test_from_hr_flag_pass(self):
7878
size2 = ent.value.size
7979
self.assertTrue(size1 < size2)
8080
except TypeError:
81+
print('MemoryError caught')
8182
pass
8283

8384
ent = BlackMarble()
@@ -108,6 +109,7 @@ def test_cut_nasa_esp_pass(self):
108109
try:
109110
nightlight, coord_nl = load_nightlight_nasa(bounds, req_files, 2016)
110111
except TypeError:
112+
print('MemoryError caught')
111113
return
112114

113115
self.assertTrue(coord_nl[0, 0] < bounds[1])
@@ -197,7 +199,7 @@ def test_cut_nl_nasa_1_pass(self):
197199
self.assertEqual(nl_mat.tocsr()[0, 1], 102.0)
198200
self.assertEqual(nl_mat.tocsr()[1, 1], 103.0)
199201
except MemoryError:
200-
print('caught MemoryError')
202+
print('MemoryError caught')
201203
pass
202204

203205
def test_cut_nl_nasa_2_pass(self):
@@ -231,7 +233,7 @@ def test_cut_nl_nasa_2_pass(self):
231233
self.assertEqual(nl_mat.tocsr()[0, 0], 100.0)
232234
self.assertEqual(nl_mat.tocsr()[0, 1], 101.0)
233235
except MemoryError:
234-
print('caught MemoryError')
236+
print('MemoryError caught')
235237
pass
236238

237239
def test_cut_nl_nasa_3_pass(self):
@@ -265,7 +267,7 @@ def test_cut_nl_nasa_3_pass(self):
265267
self.assertEqual(nl_mat.tocsr()[0, 0], 100.0)
266268
self.assertEqual(nl_mat.tocsr()[0, 1], 101.0)
267269
except MemoryError:
268-
print('caught MemoryError')
270+
print('MemoryError caught')
269271
pass
270272

271273
# Execute Tests

0 commit comments

Comments
 (0)