Comments (19)
OK I can reproduce with that thanks! Will investigate further
from neotest.
You can check your runtime files to see if the fix is present (you can see it's just a small change https://github.com/neovim/neovim/pull/18794/files) as well. If it is then it might be worth re-raising. I can help with creating a reproduction
from neotest.
Maybe you can tell if there is an obvious reason for this @stevearc.
from neotest.
I'm not seeing this issue, could you provide your config for neotest and neotest-python?
from neotest.
Ya, I also can only reproduce it in this one project and not in an attempt of a minimal example, with the previous commit both work, I have no clue why. I will investigate further and report back.
from neotest.
Here is the config, I'll provide an example once I know what makes this one project special:
use("rcarriga/neotest-python")
use({
"rcarriga/neotest",
-- commit = "0cabaff54051474c997964b0fdfc5d95dc35dbfd",
requires = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"antoinemadec/FixCursorHold.nvim",
},
config = function()
require("neotest").setup({
output = {
enabled = true,
open_on_run = "yes",
},
adapters = {
require("neotest-python")({
runner = "pytest",
-- dap = { justMyCode = false, console = "integratedTerminal" },
}),
},
})
end,
})
from neotest.
Ok, so I investigated further, and the latest commit fails if there is a comment after the test, at least in python. This only happens the first time you try to run the test, once it has found the test you can add the comment and it works. The following example reproduces this for me, if you remove the comment everything works.
import pytest
def fib(n: int) -> int:
if n < 2:
return n
else:
return fib(n - 1) + fib(n - 2)
@pytest.mark.parametrize(
("input", "expected"), [(0, 0), (1, 1), (2, 1), (3, 2), (4, 3), (5, 5), (10, 55)]
)
def test_fib(input: int, expected: int):
assert fib(input) == expected
# test
from neotest.
Actually, it can't handle any comments in the code, no matter where you put it.
from neotest.
Ah found this neovim/neovim#18790 which is the same issue. Was fixed in master 8 days ago so just updating NeoVim will fix
from neotest.
Afaik im on neovim/neovim@6eaf105 so second to latest commit and can still reproduce the issue. Is it fixed for you? Maybe I gotta delete ~/.local/nvim
.
from neotest.
I was able to repro this in the commit right before the fix (d93ba03c717bee05fe6d239fd7faefe6e9698c85), but when I update to e15d31b53 and rebuild the issue goes away
from neotest.
Yep can confirm it worked for me once I updated
from neotest.
Yup, works for me now, too. Thanks, you guys!
from neotest.
If I have any comments in a python test file, I'm still seeing the problem above, with the latest everything:
neovim
: neovim/neovim@6d52a29neotest
: fcf2468neotest-python
: nvim-neotest/neotest-python@de234d6nvim-treesitter
: nvim-treesitter/nvim-treesitter@8eccd82
from neotest.
I'm seeing this error show up in ~/.local/state/nvim/neotest.log
:
ERROR | 2022-06-22T13:51:16Z+1000 | ...te/pack/packer/start/neotest/lua/neotest/client/init.lua:419 | Couldn't find positions in path /home/josh/scratch/test_fib.py ...r/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:115: Ranges can only be made from 6 element long tables or nodes.
from neotest.
Can't reproduce unfortunately, can't really offer any advice except try wiping the neovim (make sure to start from fresh when building too make distclean
) install and re-installing.
from neotest.
thanks @rcarriga - I've tried a fresh rebuild, installing nightly using nix
and even the nightly nvim.appimage
but I get the same effect.
I even reinstalled the python tree-sitter parser :)
If I figure out what's different, I'll post here!
from neotest.
Ugh - I'm sorry for the noise - I've got it working now!
I think what has happened is that a stray LD_LIBRARY_PATH
in my .profile
left over from an experiment was picking up a different version of libtree-sitter.so
, which was producing an unexpected structure. Looking at the critical code you posted above and what it is doing helped trigger that chain of thought - thank you @rcarriga :)
from neotest.
Ah good to hear 👍
from neotest.
Related Issues (20)
- [BUG] nested_tests causes test output from stdout/stderr to be printed undesirably
- [BUG] Files containing no tests shouldn't show up in summary
- [BUG] subprocess fails on non-default environments HOT 1
- Passing additional test arguments to runner HOT 1
- Feature Request: Set Notification Levels
- [BUG] Getting error "Future already set" and output_panel is empty for python tests HOT 7
- [Feature Request] Boost.Test supporting HOT 2
- Deprecation warnings on neovim 0.11
- [BUG] Summary opens, but no help HOT 2
- Graciously handling DAP failure on multistep (build then run) languages HOT 1
- [doc] Replace README recommendation of neodev with lazydev
- New Adapter: neotest-ctest - A neotest adapter for C/C++ using CTest as a test runner HOT 1
- [BUG] ImportError while importing test module HOT 3
- [BUG] "No tests found" when opening the summary window rigth before running tests the first time
- [BUG] Java file watcher does not work as the jdtls is marked as an invalid lsp HOT 1
- Lazy load adapters HOT 1
- [Question] Subprocess with `--clean` flag
- [Feature Request] Enable setting custom environment variables for summary runs HOT 2
- [Feature] option to hide the adapter name
- [Documentation] RunSpec stream clarification HOT 2
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 neotest.