eric7/Unittest/Interfaces/UnittestRunner.py

Thu, 12 May 2022 08:59:13 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 12 May 2022 08:59:13 +0200
branch
unittest
changeset 9059
e7fd342f8bfc
child 9062
7f27bf3b50c3
permissions
-rw-r--r--

Implemented the basic functionality of the new unit test framework.

# -*- coding: utf-8 -*-

# Copyright (c) 2022 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing the test runner script for the 'unittest' framework.
"""

import json
import sys

if __name__ == '__main__':
    command = sys.argv[1]
    if command == "installed":
        try:
            import unittest         # __IGNORE_WARNING__
            sys.exit(0)
        except ImportError:
            sys.exit(1)
    
    elif command == "versions":
        import platform
        versions = {
            "name": "unittest",
            "version": platform.python_version(),
            "plugins": [],
        }
        print(json.dumps(versions))
        sys.exit(0)
    
    sys.exit(42)

#
# eflag: noqa = M801

eric ide

mercurial