From ef361d46cd3e8f366a96199a07cb0fef4b485e8f Mon Sep 17 00:00:00 2001 From: Christoph Groth <christoph.groth@cea.fr> Date: Fri, 16 Nov 2012 15:35:55 +0100 Subject: [PATCH] stop advertising the running of tests to end users I've realized that this was broken. (The tests were not installed and could be only run for inplace-builds linked from somewhere else.) Fixing this would be somewhat hacky. I think now that it was a bad idea in the first place to advertise the running of unit tests to end users. --- INSTALL.txt | 14 +------------- kwant/__init__.py | 19 ------------------- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index a009fb9..8e8e3fe 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -27,11 +27,6 @@ The following software is highly recommended though not strictly required: that will in many cases speed up kwant several times and reduce the memory footprint. -Suggested: - - - The `nose <http://nose.readthedocs.org/>`_ testing framework is required to - run the extensive tests included with kwant. - Generic instructions ==================== @@ -51,12 +46,6 @@ subdirectory, e.g.:: cd tutorial python 1-quantum_wire_revisited.py -If "nose" is installed, you can also run the tests :: - - python -c 'import kwant; kwant.test()' - -from some directory *other* than the kwant distribution's root directory. - System-specific instructions ============================ @@ -262,5 +251,4 @@ extension). You will need Cython 0.17.1 if you want to modify them. kwant includes extensive unit tests which are supposed to cover all of its functionality. We use the `nose <http://nose.readthedocs.org/>`_ testing framework. To run the tests, execute the command ``nosetests`` from the root -directory of the package after it has been built in place. You can also -``import kwant`` inside Python and run ``kwant.test()``. +directory of the package after it has been built in place. diff --git a/kwant/__init__.py b/kwant/__init__.py index b5766a5..ff4d188 100644 --- a/kwant/__init__.py +++ b/kwant/__init__.py @@ -27,22 +27,3 @@ try: except ImportError: from .solvers.sparse import solve __all__.append('solve') - -def runtest(): - """Run the tests included with kwant.""" - import os.path - try: - import nose - except ImportError: - msg = 'No module named nose.\n(See INSTALL.txt in ' \ - 'the top-level directory of the kwant distribution.)' - raise ImportError(msg) - kwant_dir = os.path.dirname(__file__) - if os.path.basename(kwant_dir) == kwant_dir: - msg = 'Do not call kwant.test from within the kwant source ' \ - 'distribution directory.\nYou can run "nosetests -s" instead.' - raise RuntimeError(msg) - nose.run(defaultTest=kwant_dir) - -# This trick avoids recursive execution of tests by nosetests. -test = runtest -- GitLab