nvim-neotest / neotest-python

MIT License
137 stars 40 forks source link

No tests are being recognized within test files #83

Open a3ng7n opened 2 months ago

a3ng7n commented 2 months ago

It seems no tests within files are being discovered - when running file, or running nearest, or debugging nearest the result is "No tests found" from neotest. The test file, however, does show up in the summary window, but shows a "skipped" icon next to it when run. image

I created a fresh venv with python 3.12, and installed just pytest 8.3.3, and implemented their getting started:

# filename: test_sample.py
def func(x):
    return x + 1

def test_sample():
    assert func(3) == 5

class TestClass:
    def test_one(self):
        x = "this"
        assert "h" in x

    def test_two(self):
        x = "hello"
        assert hasattr(x, "check")

Running pytest yields the following, expected, output: image

Here's my output of nvim -v:

% nvim -v
NVIM v0.11.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.1703358377
Run "nvim -V1 -v" for more info

And I'm running LazyVim - here's the lazy-lock.json lines for neotest:

  "neotest": { "branch": "master", "commit": "6d6ad113f56edc7c3f2a77a0836ea8c1b955ebea" },
  "neotest-python": { "branch": "master", "commit": "72603dfdbaad5695160268cb10531a14cc37236e" },

and the rest of my configuration is here: https://github.com/a3ng7n/nvim

sergei1152 commented 2 months ago

+1 getting this too after upgrading my nvim/neotest/neotest-pytest. Can't quite figure out which upgrade caused the regression

a3ng7n commented 2 months ago

+1 getting this too after upgrading my nvim/neotest/neotest-pytest. Can't quite figure out which upgrade caused the regression

Yeah - I was suspecting this could be an issue in neotest proper as well, but just haven't spent enough time to figure out which.

saharwenrix commented 2 months ago

I had this bug on nightly build. when moving to v0.10.0 the bug was gone

a3ng7n commented 2 months ago

I had this bug on nightly build. when moving to v0.10.0 the bug was gone

is that v0.10.0 of neotest? or neotest-python?

if you're able to do any testing that might help track whether this is a bug in neotest or neotest-python