Comments (13)
@arjntc1 I've just published a new version 0.3.14 with the fix that will allow you to go to the source for most cases. Please, update and let me know if the issue persists.
from vscode-python-test-adapter.
@arjntc1 Thank you for the issue! However, such functionality comes from Test Explorer UI, see https://github.com/hbenl/vscode-test-explorer which is used as the UI provider for various test adapters. Still, I think that this might be an excellent enhancement. Thus I will create a similar issue to Test Explorer UI repository.
from vscode-python-test-adapter.
I'm familiar with the Test Explorer UI from that repo (that one does support deep linking). The UI for the tests with this extension is the one that does not seem to support it (I might be missing a configuration?). Single clicking opens up the output window (if used), but no way to link to the code itself.
from vscode-python-test-adapter.
I guess your test-adapter is not reporting line numbers for individual test methods, that way test explorer cannot link to your file (e.g. no "Show Source" button), and there will be no code lens or gutter annotations (for a sample see https://github.com/vshaxe/haxe-test-adapter/blob/master/images/demo.gif)
from vscode-python-test-adapter.
Hey Alex -- no, I don't see the same view (or the ability to run tests from the sidebar -- not sure if that is haxe test extension specific). When I click a test, I can see the output window (but it does not go to the appropriate test method. I have to search for the method in the test file. Am I missing a configuration setting?
from vscode-python-test-adapter.
"Haxe Test Explorer" extension itself has no UI, so all test related UI elements you see in that .gif come from "Test Explorer UI" extension. Haxe's test adapter (like all other test adapters) is simply a data collecting and converting extension, it collects test results and passes them on to "Test Explorer UI" for display. It also implements run and debug methods so that "Test Explorer UI" can launch test runs with optional filtering (as shown in demo.gif).
I haven't looked into "Python Test Adapter", I assume it performs a similar job. I guess it needs some improvement to what data is collected and how it is passed on, so that all features of "Test Explorer UI" become available.
from vscode-python-test-adapter.
@arjntc1 Maybe there is some other problem with the test discovery? There should be a button on the right of your test modules and methods with the "Show source" tooltip. Clicking it will open a file on the line where test method is located. See the following gif for example.
There might be some issues with detecting line numbers, but I guess it should be considered as an other issue with more specific information on your tests and environment.
Also, I looked through the code of Test Explorer UI and I don't see any way to navigate to the test source other than described above. Opening the Output panel is an expected behavior for completed tests. In fact, I don't see any way to add double-click actions from the TreeView items of VSCode itself.
I think some screenshot or a more detailed description of what you see and what you expect would be of help.
from vscode-python-test-adapter.
Thanks @AlexHaxe for the explanation -- I didn't know that. @kondratyev-nv -- I don't see the third icon to open the source file. I only see the debug and run icons.
from vscode-python-test-adapter.
@arjntc1 Ok, I see. Then it looks like there is some issues with discovering test files and method line numbers. Can you tell more about your environment. What OS do you have? Which Python version do you use? What test framework (and what version) do you use? Do you see your files/classes correctly in the Test Explorer Panel?
from vscode-python-test-adapter.
OS: Ubuntu 18.04 LTS
Python Version: Python 3.7.4 (using virtualenv for virtual environment)
VS Code: 1.39.1
Test Framework: Unittest
Linting: Pylint/Pylama
I do see files/classes correctly in the Test Explorer Panel. Discover/run works with no problem.
from vscode-python-test-adapter.
@arjntc1 Thank you for the information. Indeed, I can confirm that line numbers for unittest tests are not detected. Thus I renamed the issue. Some time ago, there was a fallback within Test Explorer UI for such cases, but I guess it was removed. I will try to add line number detection for unittest tests.
As a quick fix, I can propose using pytest, see https://docs.pytest.org/en/latest/unittest.html. It is compatible with unittest tests, and line number detection already works.
from vscode-python-test-adapter.
Thanks @kondratyev-nv! I actually didn't expect movement so quickly. Thanks for looking into this!! I will look into using pytest to run unittest tests. I didn't know that it could do that. Thanks for the link.
from vscode-python-test-adapter.
This is amazing! Thanks @kondratyev-nv !! When I mentioned it a few days ago, I did not expect the great communication on the issue or a fix before the week is out. I just tested the latest version (0.3.14) -- it works great! I see the third icon and can go right to the source within the Test Explorer! Thanks again!
from vscode-python-test-adapter.
Related Issues (20)
- launch.json reports that '"request": "test",' is invalid, wants "attach" instead. HOT 2
- Support mixed c++ and python test debugging
- Error on additional workspace folders that do not have a virtual environment HOT 1
- Able to find tests but running tests on the wrong path HOT 1
- A test explorer ui question
- Feature request: Filter tests by pytest marker
- error discovering pytets HOT 1
- Feature request: Show complete output even when tests pass
- [testplan] Extension throws error when tested application fails to start up HOT 2
- PythonTest: Error HOT 1
- [pytest] test states not displayed HOT 15
- Support generating Test Report
- Pytest logging output - where do I find it?
- Could not load unit test config from launch.json as it is missing a field HOT 1
- v0.8.0 consumes 360 MB (37k files!) against v0.7.1 with 2 MB (300 files) HOT 3
- Conflicting util
- Python Test Output Throws InternalError
- Feature Request: Implement option to display a Quick Pick with collected tests
- vscode python remote testing and debugging with breakpoints not working
- Feature: Custom Test Discovery Option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-python-test-adapter.