# HG changeset patch # User Anton Shestakov # Date 1590297645 -28800 # Node ID 398c7031177a58393328d3bf6b60c6a102a30a89 # Parent 3987ce7e9824c8c38da1f82a0c4fa2ce6d44b4f2 tests: use hghaveaddon.py to check for flake8 Since we need flake8 to be a python module, we shouldn't use a shell script with `which` to check for its presence anymore. diff -r 3987ce7e9824 -r 398c7031177a tests/hghaveaddon.py --- a/tests/hghaveaddon.py Sun May 24 13:07:44 2020 +0800 +++ b/tests/hghaveaddon.py Sun May 24 13:20:45 2020 +0800 @@ -12,3 +12,14 @@ except ImportError: return False return True + +@hghave.check("flake8", "Flake8 python linter") +def has_flake8(): + try: + import flake8 + + flake8.__version__ + except ImportError: + return False + else: + return True diff -r 3987ce7e9824 -r 398c7031177a tests/test-check-flake8.t --- a/tests/test-check-flake8.t Sun May 24 13:07:44 2020 +0800 +++ b/tests/test-check-flake8.t Sun May 24 13:20:45 2020 +0800 @@ -1,12 +1,4 @@ -#require test-repo - - $ checkflake8() { - > if ! (which flake8 > /dev/null); then - > echo skipped: missing tool: flake8; - > exit 80; - > fi; - > }; - $ checkflake8 +#require test-repo flake8 Copied from Mercurial core (60ee2593a270)