Unittest / PyTest Python support in 1.54.0 (VSC API 1.93.1) #14345
Unanswered
private-lock
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
✅ Running Theia.AppImage 1.54.0 with VSC API 1.93.1
✅ Downloaded the python plugin v2024.14.1 (update to v2024.16.1 as in the website is not jet offered in my installation) and it automatically installed the debugger v2024.12.0 along.
✅ created / opened a few python files - syntax highlight seems reasonable
❌ trying to run my helloworld.py by pressing Ctrl+F5 or F5 pops up cryptic error:
At some point it opened a launch.json and suggested me to put in a python debugger (I don't clearly remember, how exactly I got there, but luckily I immediately took the screenshots, because I was flabbergasted):
On hitting Enter I get another prompt asking me again:
Hitting Enter a second time fixed the launch-config, only I still had to select the new config
✅ after this bumpy ride, I can finally run the current file in debugger.
✅ Stopping at a breakpoints and inspecting the variables works
❌ This post suggests, every open python file could have it's own Run-Icon ... but this seems to be a gap ripped open by Pylance not being available in open-vsx. This known limitation should be documented more publicly instead of hiding it in the bug-tracker.
❌ I found my IntelliSense suggestions diminished versus this post (missing the try/except suggestions):
✅ Haven't played much with the git support, but at least I could view the diff of a modified file versus the repository.
Now I want to write unit tests and followed a link from the my-python plugin to how testing should work in VSCode.
❌ you will see a Configure Tests button - nope, Theia doesn't have it
❌ Configure test profiles doesn't do anything ... at least not that I noticed a difference
I manually copied the test-examples to their respective files.
✅ Running the unittest-version manually works ... the pytest version is only a bunch of methods and doesn't have a main method to call ... So I have no idea, how to invoke them.
❌ Test explorer refresh tests doesn't discover anything other than that I want Python-tests and not Java-tests
❌ create an empty file named init.py - no effect on test discovery
❌ The python output logs an error
It's 2 am and I can't think straight anymore ... Let's see if one of you can shed some insights on how to run unittest/ pytest in Theia?
Beta Was this translation helpful? Give feedback.
All reactions