Can I implement Test Suit as a python class/module so that I have Test Case module and Test Suite module. I want to pass a argument from testsuite to testcase too.
Something like this:
Test Suite module:
import unittest class GPUScoringMatrixTestSuite(unittest.TestSuite): def suite(): suite = unittest.TestSuite() suite.addTest(GPUScoringMatrixTestCase('PAM_350.txt')) suite.addTest(GPUScoringMatrixTestCase('PAM_250.txt')) self.run(suite)Test Case module:
class GPUScoringMatrixTestCase(unittest.TestCase): def __init__(self, matrix_file): self.filename = matrix_file @classmethod def setUpClass(self): self.matrix = GPUScoringMatrix(self.filename) def test_sum_penalties(self): sum = 0 for i in self.matrix.penalties: sum += i self.assertEqual(sum, -970, 'Iconsistence penalties between scoring matrices')
The argument matrix_file isn't work too...