test/integration/jw-pkg -> test/integration/jw_pkg
The mypy module names of the test tree derive from the full path, anchored by the top-level test/__init__.py, but a file below a path component that is not a valid identifier - the dashes in jw-pkg - falls back to the bare file name, so two same-named test.py drivers collide (the duplicate module error that drove the runme.py and main.py renames). Rename the directory a sane Python name - jw_pkg, that's the better fix. Then name the driver test.py like all the others for consistency. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
85ddd44cd1
commit
61c9479e79
1 changed files with 0 additions and 0 deletions
41
test/integration/jw_pkg/help/test.sh
Normal file
41
test/integration/jw_pkg/help/test.sh
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=SC2048,SC2086
|
||||
# Unquoted $* and $cmds are intentional — word splitting for subcommand names
|
||||
|
||||
run()
|
||||
{
|
||||
local log_cmd
|
||||
# shellcheck disable=SC2001
|
||||
log_cmd=$(echo "$*" | sed 's|.*python3[0-9.]*\s\+\(\.\.\/\)*scripts/||')
|
||||
printf '============= Running: %s\n' "$log_cmd"
|
||||
"$@"
|
||||
}
|
||||
|
||||
parse_subcmds()
|
||||
{
|
||||
$jw_pkg_py $* --help | awk '/^ [a-z]/ {print $1}'
|
||||
}
|
||||
|
||||
help_cmd()
|
||||
{
|
||||
local cmds subcommand subcommands
|
||||
cmds="$*"
|
||||
run $jw_pkg_py $cmds --help
|
||||
subcommands=$(parse_subcmds $cmds)
|
||||
for subcommand in $subcommands; do
|
||||
help_cmd $cmds $subcommand
|
||||
done
|
||||
}
|
||||
|
||||
cmd_test()
|
||||
{
|
||||
help_cmd
|
||||
}
|
||||
|
||||
export LC_ALL="C"
|
||||
set -euo pipefail
|
||||
shopt -s nullglob
|
||||
|
||||
jw_pkg_py="$*"
|
||||
|
||||
cmd_test
|
||||
Loading…
Reference in a new issue