nvim-neotest / neotest-python

MIT License
129 stars 39 forks source link

No tests are being recognized within test files #83

Open a3ng7n opened 1 week ago

a3ng7n commented 1 week 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 1 week ago

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

a3ng7n commented 1 week 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.