Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/code/wypp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ def record(cls=None, mutable=False, globals={}, locals={}):
# Exported names not available for star imports (in alphabetic order)
Lock = w.Lock
LockFactory = w.LockFactory
deepEq = w.deepEq
initModule = w.initModule
printTestResults = w.printTestResults
resetTestCount = w.resetTestCount
deepEq = w.deepEq
runUnittests = w.runUnittests
wrapTypecheck = w.wrapTypecheck
WyppTypeError = w.WyppTypeError
WyppAttributeError = w.WyppAttributeError
Expand Down
10 changes: 10 additions & 0 deletions python/code/wypp/writeYourProgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@ def impossible(msg=None):
'Das Unmögliche ist passiert!'
raise errors.ImpossibleError(msg)

def runUnittests(scope: dict[str, Any]):
import unittest
suite = unittest.TestSuite()
loader = unittest.TestLoader()
for item in scope.values():
if isinstance(item, type) and issubclass(item, unittest.TestCase):
if item is not unittest.TestCase:
suite.addTest(loader.loadTestsFromTestCase(item))
unittest.TextTestRunner(verbosity=2).run(suite)

# Additional functions and aliases

import math as moduleMath
Expand Down
Loading