Skip to content

Commit e43ba90

Browse files
committed
Remove temporary files generated by tests
1 parent f8cfb65 commit e43ba90

3 files changed

Lines changed: 19 additions & 51 deletions

File tree

test/test_vectors.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
"""vectors tests"""
22

3-
from .tools import DISABLE_PLOT, interface, runTestClass
4-
from .tools import robust_path as get_shared_data
3+
try:
4+
from .tools import DISABLE_PLOT, interface, runTestClass, _remove_file
5+
from .tools import robust_path as get_shared_data
6+
except ImportError:
7+
from tools import DISABLE_PLOT, interface, runTestClass, _remove_file
8+
from tools import robust_path as get_shared_data
59

610
from openalea.stat_tool.enums import variance_type
711
from openalea.stat_tool.vectors import (
@@ -138,22 +142,34 @@ def test_variance_analysis(vec10):
138142
assert vec10.variance_analysis(1, 4, 1, "whatever", variance_type["O"]) == str(
139143
va
140144
)
145+
_remove_file("whatever")
141146

142147
try:
143148
va = VarianceAnalysis(vec10, 1, 4, "DUMMY")
144149
assert False
145150
except:
146151
assert True
152+
_remove_file("result")
147153

148154
def test_contingency_table(vec10):
149155
"""test contingency table"""
150156
ct = ContingencyTable(vec10, 1, 4)
151157
assert ct and str(ct)
152158

153159
ct2 = vec10.contingency_table(1, 4, "what", OutputFormat.ASCII)
160+
_remove_file("what")
161+
_remove_file("result")
154162
assert ct == ct2
155163

164+
156165
def test_rank_computation(vec10):
157166
ComputeRankCorrelation(vec10, Type="Kendall", FileName="test")
158167
# ComputeRankCorrelation(vec10, Type="Spearman", FileName="test")
159-
168+
_remove_file("test")
169+
170+
if __name__ == "__main__":
171+
vec10 = Vectors(get_shared_data("chene_sessile.vec"))
172+
test_vectors_container()
173+
test_variance_analysis(vec10)
174+
test_contingency_table(vec10)
175+
test_rank_computation(vec10)

test/what

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/whatever

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)