nvim-neotest / neotest-python

MIT License
137 stars 40 forks source link

neotest.py not found #68

Closed Awallace3 closed 8 months ago

Awallace3 commented 8 months ago

I have recently installed neotest with Lazy, and I am running into the following error when trying to run pytest:

neotest-python: .../packer/start/neotest-python/lua/neotest-python/init.lua:13: neotest.py not found

Is there something else that I need to install to have neotest.py? I tried looking at this pypi package (https://pypi.org/project/neotest/) but it didn't help.

return {
  "nvim-neotest/neotest",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "antoinemadec/FixCursorHold.nvim",
    "nvim-treesitter/nvim-treesitter"
  },
  init = function()
    local nt = require("neotest")

    nt.setup({
        adapters = {
            require("neotest-python")({
                dap = {justMyCode = true},
                args = {"--log-level", "DEBUG"},
                runner = "pytest",
            })
        },
        discovery = {
          concurrent = 1,
          enabled = true,
        },
        floating = {
          border = "rounded",
          max_height = 0.9,
          max_width = 0.8,
          options = {}
        },
        icons={
          passed = "",
          running = "",
          failed = "",
          unknown = "",
        },
        quickfix = {open=false},
        output = {open_on_run=false},
        lazy=true,
    })
    nt.state.adapter_ids()
    local keymap = vim.api.nvim_set_keymap
    local opts = {noremap = true}
    keymap('n', '[j', '<CMD>lua require("neotest").jump.next({status = "failed"})<CR>', opts)
    keymap('n', ']j', '<CMD>lua require("neotest").jump.prev({status = "failed"})<CR>', opts)
  end,
}