Skip to content

Commit 56104de

Browse files
authored
Merge pull request ceph#56304 from phlogistonjohn/jjm-tox-default-envs
python: allow unit tests to use tox default envs Reviewed-by: Adam King <[email protected]>
2 parents eae914f + 4e42325 commit 56104de

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/cephadm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
if(WITH_TESTS)
22
include(AddCephTest)
3-
add_tox_test(cephadm TOX_ENVS py3 mypy flake8)
3+
add_tox_test(cephadm TOX_ENVS __tox_defaults__)
44
endif()
55

66
set(bin_target_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cephadm)

src/cephadm/tox.ini

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ envlist =
55
check-black
66
py3
77
skipsdist = true
8+
# REMINDER: run `tox -e format-black` to apply black formatting
9+
# with the exact same specs as `check-black` expects.
810

911
[flake8]
1012
max-line-length = 100
@@ -21,15 +23,6 @@ exclude =
2123
.eggs
2224
statistics = True
2325
24-
[autopep8]
25-
addopts =
26-
--max-line-length {[flake8]max-line-length} \
27-
--ignore "{[flake8]ignore}" \
28-
--exclude "{[flake8]exclude}" \
29-
--in-place \
30-
--recursive \
31-
--ignore-local-config
32-
3326
[testenv]
3427
skip_install=true
3528
deps =

src/script/run_tox.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ function main() {
125125
export CEPH_BUILD_DIR=$build_dir
126126
# use the wheelhouse prepared by install-deps.sh
127127
export PIP_FIND_LINKS="$tox_path/wheelhouse"
128-
tox -c $tox_path/tox.ini -e "$tox_envs" "$@"
128+
tox_cmd=(tox -c $tox_path/tox.ini)
129+
if [ "$tox_envs" != "__tox_defaults__" ]; then
130+
tox_cmd+=("-e" "$tox_envs")
131+
fi
132+
"${tox_cmd[@]}" "$@"
129133
}
130134

131135
main "$@"

0 commit comments

Comments
 (0)