Skip to content

Commit eb6be6b

Browse files
authored
Make e2e version check robust to stderr warnings in output (#5400)
* Update cli_steps.py Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com> * lint Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com> * Update cli_steps.py Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com> --------- Signed-off-by: Sajid Alam <sajid_alam@mckinsey.com>
1 parent 116adb1 commit eb6be6b

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

features/steps/cli_steps.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -491,13 +491,8 @@ def add_req(context: behave.runner.Context, dependency: str):
491491
@then("CLI should print the version in an expected format")
492492
def check_kedro_version(context):
493493
"""Behave step to check validity of the kedro version."""
494-
CLI_flat_list = context.version_str.split()
495-
CLI_dictionary = {
496-
CLI_flat_list[i]: CLI_flat_list[i + 1]
497-
for i in range(0, len(CLI_flat_list) - 1, 2)
498-
}
499-
version_no = CLI_dictionary.get("version")
500-
assert version_no == kedro.__version__
494+
expected = f"kedro, version {kedro.__version__}"
495+
assert expected in context.version_str
501496

502497

503498
@then("the expected project directories and files should be created")

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dynamic = ["readme", "version"]
5050
[project.optional-dependencies]
5151
test = [
5252
"behave>=1.2.6,<2.0",
53+
"chardet<6", # Temporary: remove once requests supports chardet 6 (causes RequestsDependencyWarning)
5354
"coverage[toml]",
5455
"detect-secrets~=1.5.0",
5556
"import-linter>=2.5.2,<3.0",

0 commit comments

Comments
 (0)