Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Heliozoa/tmc-python-tester

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmc-python-tester

Build Status

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.

Usage

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.

Running the tests

To run the tests, execute:

$ python -m tmc

Now .tmc_test_results.json will contain the test results:

[
    {
        "backtrace": [],
        "message": "",
        "name": "test_something.TestSomething.test_something",
        "passed": true,
        "points": [
            "1.1"
        ],
        "status": "passed"
    }
]

Available points

One can check what points are available by running:

$ python -m tmc available_points

Then .available_points.json has all the points:

{
    "test_something.TestSomething.test_something": [
        "1.1"
    ]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 92.4%
  • Shell 7.6%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.