]> khamidou — GitHub mirrors - imapclient.git/commitdiff
Removed unit test running plumbing
authorMenno Smits <menno@freshfoo.com>
Tue, 25 Jan 2011 17:20:18 +0000 (17:20 +0000)
committerMenno Smits <menno@freshfoo.com>
Tue, 25 Jan 2011 17:20:18 +0000 (17:20 +0000)
People can just use the unit2 script or "python -m unittest". Updated
documentation to match.

Also fixed up the docs for livetest.py to better match current reality.

README
imapclient/test/__init__.py
run_tests.py [deleted file]

diff --git a/README b/README
index 3041ff07c5c856f10ba5b03677e79baaa6f20715..cd5844f8770c49d4aa6ed72cd74f545ebff5dac2 100644 (file)
--- a/README
+++ b/README
@@ -103,13 +103,11 @@ code.interact() function from the standard library is used.
 
 livetest.py
 -----------
-This is a standalone Python script which exercises IMAPClient against
-a live IMAP account. It performs operations and then attempts to
-confirm that these have been successful.
-
-It must be used with an account that has an INBOX folder and write
-access to the account. The folders and contents of the account don't
-matter.
+This script contains a series of functional tests which exercise
+IMAPClient against a live IMAP account. It is useful for ensuring
+compatibility with a given IMAP server implementation. livetest.py
+must be used with an account that has an INBOX folder and write access
+to the account.
 
 WARNING: The operations performed by livetest.py are
 destructive. Emails and folders in the test account WILL BE
@@ -118,15 +116,27 @@ about.
 
 Run livetest.py with the --help option to see usage.
 
-Please send me the output of livetest.py if it fails to run
-successfully against a particular IMAP server. Reports of successful
-runs are also welcome.  Please include the type and version of the
-IMAP server.
+Please send the output of livetest.py to the mailing list if it fails
+to run successfully against a particular IMAP server. Reports of
+successful runs are also welcome.  Please include the type and version
+of the IMAP server.
 
 
 Unit Tests
 ----------
 There are comprehensive unit tests for the FETCH response parser and a
 growing number of other parts of the code. These tests use the
-unittest package from the standard library and can be run using
-"python run_tests.py".
+unittest2 package which is also included as the standard unittest
+package in Python 2.7 and 3.2.
+
+Where unittest2 is included in the standard library (eg. Python 2.7
+and 3.2) you can run all unit tests like this (starting from the root
+directory of the IMAPClient source):
+
+     python -m unittest discover
+
+Alternatively, if unittest2 is installed separately use the unit2
+script (for Unix-like systems) or the unit2.py script:
+
+     unit2 discover
+     unit2.py discover
index 9ffc375b43ee857ee970ab197cc4da3818f3cd29..db53cb61d3021a41a88121d29662d7e659a94955 100644 (file)
@@ -1,31 +1,3 @@
 # Copyright (c) 2010, Menno Smits
 # Released subject to the New BSD License
 # Please see http://en.wikipedia.org/wiki/BSD_licenses
-
-import sys
-import glob
-import imp
-import unittest
-from os.path import abspath, dirname, basename, join as joinpath
-
-_mydir = abspath(joinpath(dirname(__file__)))
-
-# Make sure that imapclient is imported from the right place
-_import_dir = abspath(joinpath(_mydir, '..', '..'))
-sys.path.insert(0, _import_dir)
-
-def load_suite():
-    full_suite = unittest.TestSuite()
-    for modpath in glob.glob(joinpath(_mydir, 'test_*.py')):
-        module_name = basename(modpath).split('.', 1)[0]
-        module = imp.load_source(module_name, modpath)
-        suite = unittest.defaultTestLoader.loadTestsFromModule(module)
-        full_suite.addTest(suite)
-    return full_suite
-
-def run_suite():
-    suite = load_suite()
-    runner = unittest.TextTestRunner(verbosity=1)
-    runner.run(suite)
-
-
diff --git a/run_tests.py b/run_tests.py
deleted file mode 100644 (file)
index 69abb5d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2010, Menno Smits
-# Released subject to the New BSD License
-# Please see http://en.wikipedia.org/wiki/BSD_licenses
-
-import imapclient.test
-imapclient.test.run_suite()