mirror of https://github.com/explosion/spaCy.git
issue5230 filter warnings in addition to filterwarnings to prevent deprecation warnings in python35(win) setup to pop up
This commit is contained in:
parent
ca2a7a44db
commit
d2bb649227
|
@ -92,7 +92,8 @@ def write_obj_and_catch_warnings(obj):
|
|||
with warnings.catch_warnings(record=True) as warnings_list:
|
||||
warnings.filterwarnings("always", category=ResourceWarning)
|
||||
obj.to_disk(d)
|
||||
return list(map(lambda w: w.message, warnings_list))
|
||||
# in python3.5 it seems that deprecation warnings are not filtered by filterwarnings
|
||||
return list(filter(lambda x: isinstance(x, ResourceWarning), warnings_list))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("obj", objects_to_test[0], ids=objects_to_test[1])
|
||||
|
|
Loading…
Reference in New Issue