summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-06-15 10:16:22 +0100
committerLars Wirzenius <liw@liw.fi>2013-06-15 10:16:22 +0100
commitc9f2f2178d23b8c78a82e5b39f2ec8859d3866a7 (patch)
tree8348fa41a7f737671110fd4a14495eefd225926a /setup.py
parentf9af703372fdf28ef80b5ddfecacdff4d95a83fc (diff)
downloadcmdtest-c9f2f2178d23b8c78a82e5b39f2ec8859d3866a7.tar.gz
Fix test suite on squeeze
Debian squeeze has version 2.0 of python-markdown, which does not support the API yarnlib is using to extract code blocks from the Markdown story files. We skip the unit tests if the right version of python-markdown is not available. This is sub-optimal on squeeze since it skips unit tests for cmdtestlib as well, but it's good enough, especially since squeeze is no longer the current Debian release, and I'll be dropping squeeze support in any case in a few months.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py25
1 files changed, 20 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 2822b84..07b8fa8 100644
--- a/setup.py
+++ b/setup.py
@@ -26,13 +26,27 @@ import subprocess
import cmdtestlib
+try:
+ import markdown
+except ImportError:
+ markdown_version = None
+else:
+ if (hasattr(markdown, 'extensions') and
+ hasattr(markdown.extensions, 'Extension')):
+ markdown_version = True
+ else:
+ markdown_version = False
+
class GenerateManpage(build):
def run(self):
build.run(self)
print 'building manpages'
- for x in ['cmdtest', 'yarn']:
+ cmds = ['cmdtest']
+ if markdown_version:
+ cmds.append('yarn')
+ for x in cmds:
with open('%s.1' % x, 'w') as f:
subprocess.check_call(['python', x,
'--generate-manpage=%s.1.in' % x,
@@ -59,10 +73,11 @@ class Check(Command):
pass
def run(self):
- subprocess.check_call(
- ['python', '-m', 'CoverageTestRunner',
- '--ignore-missing-from', 'without-tests'])
- os.remove('.coverage')
+ if markdown_version:
+ subprocess.check_call(
+ ['python', '-m', 'CoverageTestRunner',
+ '--ignore-missing-from', missing_from])
+ os.remove('.coverage')
subprocess.check_call(['./cmdtest', 'echo-tests'])
subprocess.check_call(['./cmdtest', 'sort-tests'])