source: orange/Orange/testing/unit/tests/test_bayes.py @ 10655:a228b55811a4

Revision 10655:a228b55811a4, 805 bytes checked in by markotoplak, 2 years ago (diff)

Moved testing from utils into testing.

Line 
1from Orange.testing import testing
2
3# TODO: test different prob estimators
4@testing.datasets_driven(datasets=testing.CLASSIFICATION_DATASETS)
5class TestNaiveBayes(testing.LearnerTestCase):   
6    def setUp(self):
7        import orngBayes
8        self.learner = orngBayes.BayesLearner()
9       
10    @testing.test_on_data
11    def test_learner_on(self, dataset):
12        testing.LearnerTestCase.test_learner_on(self, dataset)
13       
14        # test __str__ method
15        print_str = str(self.classifier)
16       
17        # test p method
18        if dataset.domain.classVar:
19            for ex in dataset:
20                for cls in dataset.domain.classVar.values:
21                    p = self.classifier.p(cls, ex)
22                   
23
24if __name__ == "__main__":
25    import unittest
26    unittest.main()
27
Note: See TracBrowser for help on using the repository browser.