-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Attach to process associated with file #49
Comments
To expand on the above point, my use case is as follows. I am using python2 and the test passes control off to a different process during execution, this means that the client is only attached to the first thread and then the test executes without hitting any of the other breakpoints. Ideally I would like to be able to call a I also had difficulty replicating the gif from the README. It is a small file and looks basic but I was unable to attach and Ultest marked the test as passing, see asciicinema. |
OK before I address the initial request, that asciinema definitely looks like something is wrong. Could you tell me more about your vim-test configuration and also attach a log of ultest. I replicated that file and have the expected behaviour myself. My only config is let test#python#runner = "pytest" |
Ah I only had the DAP python configuration done. Showing pytest makes it fail alright. It immediately shows a fail sign instead of a running sign and I am unable to attach to it still, but the floating window is showing some information and I see the test is ran using python2.7 so maybe if I get it to run with py3 it will resolve that issue. rec logs probably not useful now but just in case
|
Yep that's a local issue you can see that pytest is being called correctly.
If you want to use python 2 you'll need to replace On your initial request, this should be totally doable. However it's not vim-ultest you should be looking at, but rather vim-test. You can define custom runners to implement whatever logic you like for running tests as long as they implement the correct interface. See the docs here https://github.com/vim-test/vim-test/#extending. I'd also say to check out the pytest runner as it'll be a good place to start from. https://github.com/vim-test/vim-test/blob/master/autoload/test/python/pytest.vim. Once you've defined the runner, it should just work with vim-ultest! The private function call |
Cheers making own runner doesn't look too bad, will look into it and see if I can get it attaching, thanks! |
Looking at the code I see
command! UltestAttach call ultest#output#attach(ultest#handler#get_nearest_test(line("."), expand("%:."), v:false))
This gives me the impression that if no nearest test is found then no process will be attached to. What would be nice if given the following file
If we ran the
:UltestAttach
command, it would first check for nearest test and try to attach. If no test is found as a fallback it will try to find the (newest?) process which contains the file name and tries to attach to that.Would something like this be feasible?
The text was updated successfully, but these errors were encountered: