Skip to content

Commit

Permalink
Test pickle python version.
Browse files Browse the repository at this point in the history
  • Loading branch information
MLecardonnel committed Mar 15, 2024
1 parent dd04cd1 commit 81c5397
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/unit_tests/explainer/test_smart_explainer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit test for smart explainer
"""

import os
import sys
import types
Expand Down Expand Up @@ -633,14 +634,14 @@ def test_load_1(self):
temp, xpl = init_sme_to_pickle_test()

current = Path(path.abspath(__file__)).parent.parent.parent
if str(sys.version)[0:3] == "3.8":
pkl_file = path.join(current, "data/xpl_to_load_38.pkl")
elif str(sys.version)[0:3] == "3.9":
if str(sys.version)[0:3] == "3.9":
pkl_file = path.join(current, "data/xpl_to_load_39.pkl")
elif str(sys.version)[0:4] == "3.10":
pkl_file = path.join(current, "data/xpl_to_load_310.pkl")
elif str(sys.version)[0:4] == "3.11":
pkl_file = path.join(current, "data/xpl_to_load_311.pkl")
elif str(sys.version)[0:4] == "3.12":
pkl_file = path.join(current, "data/xpl_to_load_312.pkl")
else:
raise NotImplementedError

Expand Down
5 changes: 3 additions & 2 deletions tests/unit_tests/utils/test_load_smartpredictor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Unit test smart predictor
"""

import sys
import unittest
from os import path
Expand Down Expand Up @@ -29,12 +30,12 @@ def test_load_smartpredictor_1(self):
current = Path(path.abspath(__file__)).parent.parent.parent
if str(sys.version)[0:4] == "3.10":
pkl_file = path.join(current, "data/predictor_to_load_310.pkl")
elif str(sys.version)[0:3] == "3.8":
pkl_file = path.join(current, "data/predictor_to_load_38.pkl")
elif str(sys.version)[0:3] == "3.9":
pkl_file = path.join(current, "data/predictor_to_load_39.pkl")
elif str(sys.version)[0:4] == "3.11":
pkl_file = path.join(current, "data/predictor_to_load_311.pkl")
elif str(sys.version)[0:4] == "3.12":
pkl_file = path.join(current, "data/predictor_to_load_312.pkl")
else:
raise NotImplementedError

Expand Down

0 comments on commit 81c5397

Please sign in to comment.