Test finalized API for python environments
See original GitHub issueRefs: https://github.com/microsoft/vscode-python/issues/19101
- anyOS: @IanMatthewHuff
- anyOS: @DonJayamanne
Complexity: 5
Requirements
Pre-assigning Jupyter team, but note builds are not available yet, testing begins tomorrow.
- Use Pre release build of the python extension
- Have as many types of environments as you can.
- Interesting types to test: Conda, Pyenv global installs, Pyenv conda envs etc.
Test APIs exposed via ProposedExtensionAPI
- See
ProposedExtensionAPI
for APIs to test: https://github.dev/microsoft/vscode-python/blob/main/src/client/proposedApiTypes.ts - Use
Python: Clear cache and reload
command to clear any pre-existing discovery cache in the extension. - Try dry-adopting it in the Jupyter extension for discovery of Python environments and make sure it covers all scenarios.
Example usage: Copy over contents of https://github.com/microsoft/vscode-python/blob/main/src/client/proposedApiTypes.ts#L8 as needed.
const extension = extensions.getExtension('ms-python.python');
if (extension) {
if (!extension.isActive) {
await extension.activate();
}
const api: IExtensionApi & ProposedExtensionAPI = extension.exports as IExtensionApi & ProposedExtensionAPI;
if (api.environment) {
const envPath = api.environment.getActiveEnvironmentPath();
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Writing tests for RESTful APIs in Python using requests – part 1
One of the topics that was covered in this course is writing tests for RESTful APIs using the Python requests library and the...
Read more >Getting Started With Testing in Python
In this in-depth tutorial, you'll see how to create Python unit tests, execute them, and find the bugs before your users do. You'll...
Read more >venv — Creation of virtual environments — Python 3.11.1 ...
The high-level method described above makes use of a simple API which provides mechanisms for third-party virtual environment creators to customize environment ......
Read more >Modern Test-Driven Development in Python - TestDriven.io
We started with unit tests (to test the commands and queries) followed by integration tests (to test the API endpoints), and finished with...
Read more >Mocking API calls in Python - Auth0
The nose2 library extends the built-in Python unittest module to make testing easier. You can use unittest or other third-party libraries such ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So I talked with the team and decided that we’ll finalize it in an iteration or two, hope that gives Jupyter some time to adopt the API. Meanwhile we’ll still announce it in our blog posts and release notes to get additional feedback!
Right now I’m testing this with a separate extension as opposed to trying to fully adopt into Jupyter. Seemed like a fairer test of the API itself.