Skip to content

HenryGJackson/PythonUnitTestFramework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PythonUnitTestFramework

A unit test framework for testing python modules

How to use

To use this framework, place your test modules within the same directory as RunTests.py.

The expected structure is as follows:

  • PythonUnitTestFramework
    • RunTests.py
    • TestModule0
      • TestFile0
      • TestFile1
    • TestModule1
      • TestFile2

Tests that are included within the above structure will be automatically detected by the framework.

Example Test

The file should include one class named "Test" and that class must have a function run() which returns a tuple of a bool which determines the success of the test and a string which describes the result of the test.

An example is as follows:

test.py:

class Test :
    def doSomeCheck() :
        return True

    def run() :
        success : bool = True
        msg : str = ""

        if not doSomeCheck() :
            success = False
            msg += "Failed some check"

        return (success, msg)

About

A unit test framework for testing python modules

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages