feat: django support. (#54)
This commit is contained in:
committed by
GitHub
parent
c969a5b007
commit
48bf141103
@@ -17,7 +17,7 @@ M.module_exists = function(module, python_command)
|
||||
return lib.process.run(vim.tbl_flatten({
|
||||
python_command,
|
||||
"-c",
|
||||
"import imp; imp.find_module('" .. module .. "')",
|
||||
"import " .. module,
|
||||
})) == 0
|
||||
end
|
||||
|
||||
|
@@ -59,10 +59,10 @@ local get_runner = function(python_command)
|
||||
if vim_test_runner == "pyunit" then
|
||||
return "unittest"
|
||||
end
|
||||
if vim_test_runner and lib.func_util.index({ "unittest", "pytest" }, vim_test_runner) then
|
||||
if vim_test_runner and lib.func_util.index({ "unittest", "pytest", "django" }, vim_test_runner) then
|
||||
return vim_test_runner
|
||||
end
|
||||
local runner = base.module_exists("pytest", python_command) and "pytest" or "unittest"
|
||||
local runner = base.module_exists("pytest", python_command) and "pytest" or base.module_exists("django", python_command) and "django" or "unittest"
|
||||
stored_runners[command_str] = runner
|
||||
return runner
|
||||
end
|
||||
|
Reference in New Issue
Block a user