A unittest-based test runner that tmc-langs and tmc-langs-rust uses to check exercises. Runs tests and ouputs the results in JSON format. Allows one to assign points to individual test cases or classes with @points decorators.
This test runner accepts standard unittest test cases. One can optionally import and use the @points decorators from the library. A basic decorated test case looks like this:
import unittest
from tmc import points
class TestSomething(unittest.TestCase):
    @points('1.1')
    def test_something(self):
        self.assertEqual('a', 'a')
if __name__ == '__main__':
    unittest.main()See the test resources folder for more examples.
To run the tests, execute:
$ python -m tmcNow .tmc_test_results.json will contain the test results:
[
    {
        "backtrace": [],
        "message": "",
        "name": "test_something.TestSomething.test_something",
        "passed": true,
        "points": [
            "1.1"
        ],
        "status": "passed"
    }
]One can check what points are available by running:
$ python -m tmc available_pointsThen .available_points.json has all the points:
{
    "test_something.TestSomething.test_something": [
        "1.1"
    ]
}