diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-08-04 09:30:58 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-08-04 09:30:58 +0100 |
commit | ac488ec7c4a686ead0d652645019f8096efcc301 (patch) | |
tree | 5f931bbe846da281147f50029012ec869eece144 | |
parent | 7146230e5061beb258241d077d5b79f545195ccc (diff) | |
download | obnam-ac488ec7c4a686ead0d652645019f8096efcc301.tar.gz |
Only run yarn tests when yarn's available
-rw-r--r-- | setup.py | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -27,6 +27,23 @@ import sys import tempfile +# We need to know whether we can run yarn. We do this by checking +# the python-markdown version: if it's new enough, we assume yarn +# is available, and if it isn't, yarn won't be available since it +# won't work with old versions (e.g., the one in Debian squeeze.) + +try: + import markdown +except ImportError: + got_yarn = False +else: + if (hasattr(markdown, 'extensions') and + hasattr(markdown.extensions, 'Extension')): + got_yarn = True + else: + got_yarn = False + + def runcmd(*args, **kwargs): try: subprocess.check_call(*args, **kwargs) @@ -99,8 +116,10 @@ class Check(Command): if local and fast: print "run black box tests" runcmd(['cmdtest', 'tests']) - runcmd( - ['yarn', '-s', 'yarns/obnam.sh'] + glob.glob('yarns/*.yarn')) + if got_yarn: + runcmd( + ['yarn', '-s', 'yarns/obnam.sh'] + + glob.glob('yarns/*.yarn')) num_clients = '2' num_generations = '16' |