DoctestBtn is a simple VSCode extension that aims to replicate the ease of use of the 'run button' included in Microsoft's Python extension and apply it to running Python doctests.
- The doctest button mimics the functionality of the Python extension's run button and uses it to run doctests.
- When clicked:
-
The active document is saved.
-
Focus is brought to the terminal (a terminal is created if necessary).
-
Your preferred Python path is used to doctest the active document.
GIF created with LiceCap.
-
-
There are three options for the style of the doctest button:
- 'Plain'
- 'Fancy'
- 'Xtra Fancy'
-
The preferred icon can be chosen using two boolean configurations in user settings.
- Turning on 'Xtra Fancy' overrides 'Fancy' regardless of its state.
- Can be found in command pallate under "Execute Python File in Terminal" when a .py file is in focus.
- Saves active document.
- Focus is brought to the terminal (a terminal is created if necessary).
- Your preferred Python and Doctest paths are used to doctest the active document.
This extension contributes the following settings:
doctestbtn.buttonColor.fancy
:- Choose to use the 'Fancy' themed button.
doctestbtn.buttonColor.xtraFancy
:- Choose to use the 'Xtra Fancy' theme button.
- Overrides
'fancy'
theme.
doctestbtn.doctestPath
:- Change the path to the doctest module.
doctestbtn.dtPythonPath
:- Change the fallback path to the Python Interpereter.
- Requires the Python extension to retrieve the Python path preference.
- Requires the Python programming language.
- Implement Doctest Detection.
- Detect doctests in python files.
- Only show button when doctests are present.
- Show number of tests found in status bar.
- Maybe show tests passed/failed?
- Add command structure setting.
- Would allow you to change the structure of the command sent during doctest execution
N/A
- Update pythonpath retrieval to search elsewhere, and then fall back on an editable setting (
dtPythonPath
).- Helps fix an issue where certain operating systems printed 'undefined' rather than the python path
- Thanks to jguerra-astro and Paul-Durrant: #7
- Add quotes around the filename
- Fixes errors when dealing with a filename containing spaces
- Thanks to logonoff: #5
- Fixes for changes made in the VSCode March 2021 release.
- Fix for change in title 'groups' that caused the doctestBtn to fail to appear.
- Quick fix.
- Fixed issue where an & symbol prefixing the doctest command could cause issues on non-windows devices.
- Thanks to vbrozik: #3
- Quick fix.
- Fixed issue where ReadMe was not showing in the VSCode extension viewer.
- Initial release of DoctestBtn.
- Introduced:
- 'Doctest Python File in Terminal' command.
- The doctest button (maps to the command).
- Three button 'themes'.
- Three related settings.