view tests/hghaveaddon.py @ 5666:e5d91fd1f319

tests: update with more detailed exit codes CORE-TEST-OUTPUT-UPDATE: 21733e8c924f CORE-TEST-OUTPUT-UPDATE: 8d72e29ad1e0 CORE-TEST-OUTPUT-UPDATE: e0dbfbd4062c CORE-TEST-OUTPUT-UPDATE: ebee234d952a CORE-TEST-OUTPUT-UPDATE: 527ce85c2e60 CORE-TEST-OUTPUT-UPDATE: 3175b0e0058b CORE-TEST-OUTPUT-UPDATE: f96fa4de5055 CORE-TEST-OUTPUT-UPDATE: 96ca817ec192
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 19 Nov 2020 08:28:45 -0800
parents f2139537c2be
children e41b99cec0c2
line wrap: on
line source

import hghave

@hghave.check("docgraph-ext", "Extension to generate graph from repository")
def docgraph():
    try:
        import hgext.docgraph
        hgext.docgraph.cmdtable # trigger import
    except ImportError:
        try:
            import hgext3rd.docgraph
            hgext3rd.docgraph.cmdtable # trigger import
        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

@hghave.check("check-manifest", "check-manifest MANIFEST.in checking tool")
def has_check_manifest():
    return hghave.matchoutput('check-manifest --version 2>&1',
                              br'check-manifest version')