forked from symbolic-kg/PyClause
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug-tests.py
126 lines (118 loc) · 2.53 KB
/
debug-tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import time
import c_clause
from tests.test_api import test_uc_b_zero_ranking, test_237_all_ranking, test_qa_handler,\
test_loader, test_triple_scoring, test_explanation_tracking, test_triple_scoring_B_237, test_rule_loading, test_rules_handler,\
test_rules_collecting, test_noisy_triple_scoring, test_noisy_or, test_multi_thr_rule_loading
count_true = 0
num_tests = 0
"""Used in development for fast debugging of tests."""
try:
test_triple_scoring_B_237()
count_true += 1
num_tests +=1
except Exception as e:
print("Test triple_scoring B 237 failed")
num_tests +=1
print(e)
exit()
try:
test_rule_loading()
count_true += 1
num_tests +=1
except Exception as e:
num_tests +=1
print(e)
print("Test Rule loading failed.")
try:
test_uc_b_zero_ranking()
count_true +=1
num_tests +=1
except Exception as e:
num_tests+=1
print(e)
try:
test_237_all_ranking()
count_true += 1
num_tests +=1
except Exception as e:
num_tests +=1
print(e)
exit()
try:
test_multi_thr_rule_loading()
count_true +=1
num_tests +=1
except Exception as e:
num_tests+=1
print(e)
try:
test_rules_handler()
count_true +=1
num_tests +=1
except Exception as e:
num_tests +=1
print(e)
try:
test_noisy_or()
count_true +=1
num_tests +=1
except Exception as e:
num_tests+=1
print(e)
try:
test_noisy_triple_scoring()
count_true += 1
num_tests +=1
except Exception as e:
print("Triple scoring test failed")
num_tests +=1
print(e)
try:
test_triple_scoring()
count_true += 1
num_tests +=1
except Exception as e:
print("Triple scoring test failed")
num_tests +=1
print(e)
try:
test_rules_collecting()
count_true +=1
num_tests +=1
except Exception as e:
print("Test rules collecting failed")
num_tests +=1
print(e)
try:
test_qa_handler()
count_true +=1
num_tests +=1
except Exception as e:
print("QA test failed")
num_tests +=1
print(e)
try:
test_triple_scoring_B_237()
count_true += 1
num_tests +=1
except Exception as e:
print("Test triple_scoring B 237 failed")
num_tests +=1
print(e)
try:
test_loader()
count_true += 1
num_tests +=1
except Exception as e:
print("Test loader failed")
num_tests +=1
print(e)
try:
test_explanation_tracking()
count_true += 1
num_tests +=1
except Exception as e:
print("Explanation tracking failed")
num_tests +=1
print(e)
print(f"{count_true} of {num_tests} tests were successful.")