Mercurial > evolve
diff tests/hghaveaddon.py @ 5338:6a50faea786d
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.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sun, 24 May 2020 13:20:45 +0800 |
parents | ef361938dfa1 |
children | f2139537c2be |
line wrap: on
line diff
--- 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