mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 22:34:24 +08:00
* add assert_click_success helper * fixing xfail tests so they pass * add type annotations * organize into a class * update docstring * adding no-cov for test utils * removing failing pooch test
16 lines
512 B
Python
16 lines
512 B
Python
"""Helper utilities for CLI tests"""
|
|
|
|
import click
|
|
import traceback
|
|
|
|
|
|
def assert_click_success(result: click.testing.Result): # -no-cov-
|
|
"""Pass through error message if a click test fails.
|
|
Taken from https://github.com/openpathsampling/openpathsampling-cli/blob/main/paths_cli/commands/pathsampling.py
|
|
"""
|
|
if result.exit_code != 0:
|
|
print(result.output)
|
|
traceback.print_tb(result.exc_info[2])
|
|
print(result.exc_info[0], result.exc_info[1])
|
|
assert result.exit_code == 0
|