Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04d3f707b8 | ||
|
|
c0c7dc9851 |
@@ -110,15 +110,10 @@ end
|
|||||||
local function scan_test_function_pattern(runner, config, python_command)
|
local function scan_test_function_pattern(runner, config, python_command)
|
||||||
local test_function_pattern = "^test"
|
local test_function_pattern = "^test"
|
||||||
if runner == "pytest" and config.pytest_discovery then
|
if runner == "pytest" and config.pytest_discovery then
|
||||||
<<<<<<< HEAD
|
|
||||||
local cmd = vim
|
local cmd = vim
|
||||||
.iter({ python_command, M.get_script_path(), "--pytest-extract-test-name-template" })
|
.iter({ python_command, M.get_script_path(), "--pytest-extract-test-name-template" })
|
||||||
:flatten()
|
:flatten()
|
||||||
:totable()
|
:totable()
|
||||||
=======
|
|
||||||
local cmd = vim.iter({ python_command, M.get_script_path(), "--pytest-extract-test-name-template" }):flatten()
|
|
||||||
:totable()
|
|
||||||
>>>>>>> 51c453d (feat: remove plenary)
|
|
||||||
local _, data = lib.process.run(cmd, { stdout = true, stderr = true })
|
local _, data = lib.process.run(cmd, { stdout = true, stderr = true })
|
||||||
|
|
||||||
for line in vim.gsplit(data.stdout, "\n", true) do
|
for line in vim.gsplit(data.stdout, "\n", true) do
|
||||||
@@ -173,7 +168,7 @@ M.treesitter_queries = function(runner, config, python_command)
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.get_root =
|
M.get_root =
|
||||||
lib.files.match_root_pattern("pyproject.toml", "setup.cfg", "mypy.ini", "pytest.ini", "setup.py")
|
lib.files.match_root_pattern("pyproject.toml", "setup.cfg", "mypy.ini", "pytest.ini", "setup.py")
|
||||||
|
|
||||||
function M.create_dap_config(python_path, script_path, script_args, dap_args)
|
function M.create_dap_config(python_path, script_path, script_args, dap_args)
|
||||||
return vim.tbl_extend("keep", {
|
return vim.tbl_extend("keep", {
|
||||||
@@ -199,13 +194,13 @@ function M.get_runner(python_path)
|
|||||||
return "unittest"
|
return "unittest"
|
||||||
end
|
end
|
||||||
if
|
if
|
||||||
vim_test_runner and lib.func_util.index({ "unittest", "pytest", "django" }, vim_test_runner)
|
vim_test_runner and lib.func_util.index({ "unittest", "pytest", "django" }, vim_test_runner)
|
||||||
then
|
then
|
||||||
return vim_test_runner
|
return vim_test_runner
|
||||||
end
|
end
|
||||||
local runner = M.module_exists("pytest", python_path) and "pytest"
|
local runner = M.module_exists("pytest", python_path) and "pytest"
|
||||||
or M.module_exists("django", python_path) and "django"
|
or M.module_exists("django", python_path) and "django"
|
||||||
or "unittest"
|
or "unittest"
|
||||||
stored_runners[command_str] = runner
|
stored_runners[command_str] = runner
|
||||||
return runner
|
return runner
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user