-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtest_convenience.py
31 lines (26 loc) · 1.13 KB
/
test_convenience.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tests of convenience functions.
.. codeauthor:: Rasmus Handberg <[email protected]>
"""
import pytest
import conftest # noqa: F401
import starclass
#--------------------------------------------------------------------------------------------------
@pytest.mark.parametrize('classifier', list(starclass.classifier_list) + [
pytest.param('nonsense', marks=pytest.mark.xfail(raises=ValueError))
])
def test_convenience_get_classifier(classifier):
stcl = starclass.get_classifier(classifier)
assert issubclass(stcl, starclass.BaseClassifier)
#--------------------------------------------------------------------------------------------------
@pytest.mark.parametrize('tsetket', list(starclass.trainingset_list) + [
pytest.param('nonsense', marks=pytest.mark.xfail(raises=ValueError))
])
def test_convenience_get_trainingset(tsetket):
tsetclass = starclass.get_trainingset(tsetket)
assert issubclass(tsetclass, starclass.training_sets.TrainingSet)
#--------------------------------------------------------------------------------------------------
if __name__ == '__main__':
pytest.main([__file__])