Skip to content

Commit 0cdf670

Browse files
Merge branch 'skogsbaer:master' into encapsulate-visualization
2 parents 635e335 + 595093b commit 0cdf670

4 files changed

Lines changed: 15 additions & 2 deletions

File tree

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Write Your Python Program - CHANGELOG
22

3+
* 2.2.1 (2026-03-26)
4+
* Functionality for running standard unit tests
35
* 2.2.0 (2026-03-17)
46
* Performance improvements
57
* Fix for multi-threaded environment

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Write Your Python Program!",
44
"description": "A user friendly python environment for beginners",
55
"license": "See license in LICENSE",
6-
"version": "2.2.0",
6+
"version": "2.2.1",
77
"publisher": "StefanWehr",
88
"icon": "icon.png",
99
"engines": {

python/code/wypp/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ def record(cls=None, mutable=False, globals={}, locals={}):
6969
# Exported names not available for star imports (in alphabetic order)
7070
Lock = w.Lock
7171
LockFactory = w.LockFactory
72+
deepEq = w.deepEq
7273
initModule = w.initModule
7374
printTestResults = w.printTestResults
7475
resetTestCount = w.resetTestCount
75-
deepEq = w.deepEq
76+
runUnittests = w.runUnittests
7677
wrapTypecheck = w.wrapTypecheck
7778
WyppTypeError = w.WyppTypeError
7879
WyppAttributeError = w.WyppAttributeError

python/code/wypp/writeYourProgram.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,16 @@ def impossible(msg=None):
317317
'Das Unmögliche ist passiert!'
318318
raise errors.ImpossibleError(msg)
319319

320+
def runUnittests(scope: dict[str, Any]):
321+
import unittest
322+
suite = unittest.TestSuite()
323+
loader = unittest.TestLoader()
324+
for item in scope.values():
325+
if isinstance(item, type) and issubclass(item, unittest.TestCase):
326+
if item is not unittest.TestCase:
327+
suite.addTest(loader.loadTestsFromTestCase(item))
328+
unittest.TextTestRunner(verbosity=2).run(suite)
329+
320330
# Additional functions and aliases
321331

322332
import math as moduleMath

0 commit comments

Comments
 (0)