From 67ad9f66a00bdea21602428f748dfbb65220e67c Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Sat, 13 Feb 2010 22:58:46 -0500 Subject: Added run-tests.py script and added a helpful error message if nose is not installed. Note the run-tests script will be used by simply running 'nosetests' from the commandline, so the hack in 'tests/__init__.py' has been removed. --- run-tests.py | 5 +++++ tests/__init__.py | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100755 run-tests.py diff --git a/run-tests.py b/run-tests.py new file mode 100755 index 0000000..e30c7b3 --- /dev/null +++ b/run-tests.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +import tests + +tests.run() diff --git a/tests/__init__.py b/tests/__init__.py index d07ae7d..bad2a37 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -2,7 +2,12 @@ import os import markdown import codecs import difflib -import nose +try: + import nose +except ImportError: + raise ImportError, "The nose testing framework is required to run " \ + "Python-Markdown tests. Run `easy_install nose` " \ + "to install the latest version." import util from plugins import HtmlOutput, Markdown try: @@ -111,7 +116,3 @@ def TestSyntax(): def run(): nose.main(addplugins=[HtmlOutput(), Markdown()]) -# Hack to make nose run with extensions. Once extensions can be added from -# setup.cfg, the below line can be removed. -# See nose [Issue 271](http://code.google.com/p/python-nose/issues/detail?id=271) -run() -- cgit v1.2.3