Changes between Version 25 and Version 26 of pyrunner
- Timestamp:
- 08/21/24 10:45:14 (3 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
pyrunner
v25 v26 81 81 }}} 82 82 83 === Running/Debugging tests from commandline 84 Running and Debugging a unit test from the commandline is a bit more tricky because python can not find tests in a zip file. Nor can it find them after unzipping, because pip install removes some files. We suggest to use unitpy to work around these issues. 83 === Running/Debugging unitpy tests 84 If the unittests are using [unitpy], the test class does not need to extend TestCase and is by itself not discoverable. 85 If the test class was compiled with the j2p and the junit-t translator, then a bit of glue code has been added to your class. This glue code looks like this: 86 {{{ 87 class Test(TestCase): 88 def test(self): 89 runTests(YOURTESTCLASS) 90 }}} 85 91 86 * make a venv and activate 87 * pip install the zip 88 * pip install [source:/unitpy/dist unitypy] 89 * 92 If this glue code is there, or if you can add this glue code manually, you can use the normal procedure with {{{python -m unittest path.to.YOURTESTCLASS}}}. 93 94 If the class uses unitpy but the glue code is not there, you can use runTests directly, using {{{python -c "from unitpy.Runner import runTests; import path.to.YOURTESTCLASS; runTests(YOURTESTCLASS)" }}}. You can add {{{-m pdb}}} to debug this run.