Commit 5ad7adaf authored by André Anjos's avatar André Anjos 💬

Simplify test organization

parent 763f3c96
include LICENSE README.rst bootstrap.py buildout.cfg include LICENSE README.rst bootstrap.py buildout.cfg
recursive-include doc conf.py *.rst recursive-include doc conf.py *.rst
recursive-include xbob *.cpp *.h recursive-include xbob *.cpp *.h
recursive-include xbob/measure/test/data *.* recursive-include xbob/measure/data *.*
...@@ -26,7 +26,7 @@ def save(fname, data): ...@@ -26,7 +26,7 @@ def save(fname, data):
def test_basic_ratios(): def test_basic_ratios():
from .. import farfrr, precision_recall, f_score from . import farfrr, precision_recall, f_score
# We test the basic functionaly on FAR and FRR calculation. The first # We test the basic functionaly on FAR and FRR calculation. The first
# example is separable, with a separation threshold of about 3.0 # example is separable, with a separation threshold of about 3.0
...@@ -83,7 +83,7 @@ def test_basic_ratios(): ...@@ -83,7 +83,7 @@ def test_basic_ratios():
def test_indexing(): def test_indexing():
from .. import correctly_classified_positives, correctly_classified_negatives from . import correctly_classified_positives, correctly_classified_negatives
# This test verifies that the output of correctly_classified_positives() and # This test verifies that the output of correctly_classified_positives() and
# correctly_classified_negatives() makes sense. # correctly_classified_negatives() makes sense.
...@@ -111,7 +111,7 @@ def test_indexing(): ...@@ -111,7 +111,7 @@ def test_indexing():
def test_thresholding(): def test_thresholding():
from .. import eer_threshold, far_threshold, frr_threshold, farfrr, correctly_classified_positives, correctly_classified_negatives, min_hter_threshold from . import eer_threshold, far_threshold, frr_threshold, farfrr, correctly_classified_positives, correctly_classified_negatives, min_hter_threshold
def count(array, value=True): def count(array, value=True):
"""Counts occurrences of a certain value in an array""" """Counts occurrences of a certain value in an array"""
...@@ -172,7 +172,7 @@ def test_thresholding(): ...@@ -172,7 +172,7 @@ def test_thresholding():
def test_plots(): def test_plots():
from .. import eer_threshold, roc, precision_recall_curve, det, epc from . import eer_threshold, roc, precision_recall_curve, det, epc
# This test set is not separable. # This test set is not separable.
positives = xbob.io.load(F('nonsep-positives.hdf5')) positives = xbob.io.load(F('nonsep-positives.hdf5'))
...@@ -218,7 +218,7 @@ def test_plots(): ...@@ -218,7 +218,7 @@ def test_plots():
def test_rocch(): def test_rocch():
from .. import rocch, rocch2eer, eer_rocch from . import rocch, rocch2eer, eer_rocch
# This example will demonstrate and check the use of eer_rocch_threshold() to # This example will demonstrate and check the use of eer_rocch_threshold() to
# calculate the threshold that minimizes the EER on the ROC Convex Hull # calculate the threshold that minimizes the EER on the ROC Convex Hull
...@@ -254,7 +254,7 @@ def test_rocch(): ...@@ -254,7 +254,7 @@ def test_rocch():
def test_cmc(): def test_cmc():
from .. import recognition_rate, cmc, load from . import recognition_rate, cmc, load
# tests the CMC calculation # tests the CMC calculation
# test data; should give match characteristics [1/2,1/4,1/3] and CMC [1/3,2/3,1] # test data; should give match characteristics [1/2,1/4,1/3] and CMC [1/3,2/3,1]
...@@ -284,9 +284,9 @@ def test_cmc(): ...@@ -284,9 +284,9 @@ def test_cmc():
def test_calibration(): def test_calibration():
from .. import calibration from . import calibration
# Tests the cllr and min_cllr measures... # Tests the cllr and min_cllr measures
# This test set is separable. # This test set is separable.
positives = xbob.io.load(F('linsep-positives.hdf5')) positives = xbob.io.load(F('linsep-positives.hdf5'))
negatives = xbob.io.load(F('linsep-negatives.hdf5')) negatives = xbob.io.load(F('linsep-negatives.hdf5'))
......
...@@ -31,7 +31,7 @@ def test_compute_perf(): ...@@ -31,7 +31,7 @@ def test_compute_perf():
assert os.path.exists(DEV_SCORES) assert os.path.exists(DEV_SCORES)
assert os.path.exists(TEST_SCORES) assert os.path.exists(TEST_SCORES)
from ..script.compute_perf import main from .script.compute_perf import main
cmdline = '--devel=%s --test=%s --self-test' % (DEV_SCORES, TEST_SCORES) cmdline = '--devel=%s --test=%s --self-test' % (DEV_SCORES, TEST_SCORES)
nose.tools.eq_(main(cmdline.split()), 0) nose.tools.eq_(main(cmdline.split()), 0)
...@@ -40,7 +40,7 @@ def test_eval_threshold(): ...@@ -40,7 +40,7 @@ def test_eval_threshold():
# sanity checks # sanity checks
assert os.path.exists(DEV_SCORES) assert os.path.exists(DEV_SCORES)
from ..script.eval_threshold import main from .script.eval_threshold import main
cmdline = '--scores=%s --self-test' % (DEV_SCORES,) cmdline = '--scores=%s --self-test' % (DEV_SCORES,)
nose.tools.eq_(main(cmdline.split()), 0) nose.tools.eq_(main(cmdline.split()), 0)
...@@ -49,7 +49,7 @@ def test_apply_threshold(): ...@@ -49,7 +49,7 @@ def test_apply_threshold():
# sanity checks # sanity checks
assert os.path.exists(TEST_SCORES) assert os.path.exists(TEST_SCORES)
from ..script.apply_threshold import main from .script.apply_threshold import main
cmdline = '--scores=%s --self-test' % (TEST_SCORES,) cmdline = '--scores=%s --self-test' % (TEST_SCORES,)
nose.tools.eq_(main(cmdline.split()), 0) nose.tools.eq_(main(cmdline.split()), 0)
...@@ -59,7 +59,7 @@ def test_compute_perf_5col(): ...@@ -59,7 +59,7 @@ def test_compute_perf_5col():
assert os.path.exists(DEV_SCORES_5COL) assert os.path.exists(DEV_SCORES_5COL)
assert os.path.exists(TEST_SCORES_5COL) assert os.path.exists(TEST_SCORES_5COL)
from ..script.compute_perf import main from .script.compute_perf import main
cmdline = '--devel=%s --test=%s --parser=xbob.measure.load.split_five_column --self-test' % (DEV_SCORES_5COL, TEST_SCORES_5COL) cmdline = '--devel=%s --test=%s --parser=xbob.measure.load.split_five_column --self-test' % (DEV_SCORES_5COL, TEST_SCORES_5COL)
nose.tools.eq_(main(cmdline.split()), 0) nose.tools.eq_(main(cmdline.split()), 0)
...@@ -69,6 +69,6 @@ def test_compute_cmc(): ...@@ -69,6 +69,6 @@ def test_compute_cmc():
assert os.path.exists(SCORES_4COL_CMC) assert os.path.exists(SCORES_4COL_CMC)
assert os.path.exists(SCORES_5COL_CMC) assert os.path.exists(SCORES_5COL_CMC)
from ..script.plot_cmc import main from .script.plot_cmc import main
nose.tools.eq_(main(['--self-test', '--score-file', SCORES_4COL_CMC, '--log-x-scale']), 0) nose.tools.eq_(main(['--self-test', '--score-file', SCORES_4COL_CMC, '--log-x-scale']), 0)
nose.tools.eq_(main(['--self-test', '--score-file', SCORES_5COL_CMC, '--parser', '5column']), 0) nose.tools.eq_(main(['--self-test', '--score-file', SCORES_5COL_CMC, '--parser', '5column']), 0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment