Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General maintenance #10

Merged
merged 7 commits into from
Dec 11, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
TST: Update tests to work with Click==7.0
The automatic `Try "<command> --help" for help.` output text was added
in Click 7.0.

This commit changes the tests to only check the portion of the output
under our control.
  • Loading branch information
quantophred committed Dec 5, 2018
commit b8a5692021dd3505ba721376c3a712f634e82600
20 changes: 8 additions & 12 deletions straitlets/ext/tests/test_click.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,24 @@ def missing_attr_instance():
multi_error_output = re.compile(
dedent(
"""\
^Usage: main \[OPTIONS\]

Error: Invalid value for "--config": Failed to validate the schema:
Failed to validate the schema:

bool:
No default value found for bool trait of <.+?>
int:
No default value found for int trait of <.+?>
unicode:
No default value found for unicode trait of <.+?>
$""",
""",
),
)

single_error_output = re.compile(
dedent(
"""\
^Usage: main \[OPTIONS\]

Error: Invalid value for "--config": Failed to validate the schema:
Failed to validate the schema:
No default value found for int trait of <.+?>
$""",
""",
),
)

Expand Down Expand Up @@ -128,7 +124,7 @@ def main(config): # pragma: no cover
catch_exceptions=False,
)
assert result.exit_code
assert multi_error_output.match(result.output)
assert multi_error_output.search(result.output)


def test_json_single_error(runner, missing_attr_instance):
Expand All @@ -148,7 +144,7 @@ def main(config): # pragma: no cover
catch_exceptions=False,
)
assert result.exit_code
assert single_error_output.match(result.output)
assert single_error_output.search(result.output)


def test_yaml_file(runner, expected_instance):
Expand Down Expand Up @@ -194,7 +190,7 @@ def main(config): # pragma: no cover
catch_exceptions=False,
)
assert result.exit_code
assert multi_error_output.match(result.output)
assert multi_error_output.search(result.output)


def test_yaml_single_error(runner, missing_attr_instance):
Expand All @@ -214,4 +210,4 @@ def main(config): # pragma: no cover
catch_exceptions=False,
)
assert result.exit_code
assert single_error_output.match(result.output)
assert single_error_output.search(result.output)