From 9a1507f94f4afee81277a77d296aa1359bac5983 Mon Sep 17 00:00:00 2001 From: Michael Wimmer <wimmer@lorentz.leidenuniv.nl> Date: Tue, 5 Feb 2013 22:19:20 +0100 Subject: [PATCH] add kwant.test() --- kwant/__init__.py | 10 ++++++++++ setup.py | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/kwant/__init__.py b/kwant/__init__.py index 60714d6f..321dfa82 100644 --- a/kwant/__init__.py +++ b/kwant/__init__.py @@ -23,3 +23,13 @@ except: pass else: __all__.extend(['plotter', 'plot']) + + +def test(verbose=1): + from nose.core import run + import os.path + + return run(argv=[__file__, os.path.dirname(os.path.abspath(__file__)), + "-s", "--verbosity="+str(verbose)]) + +test.__test__ = False diff --git a/setup.py b/setup.py index 88c31915..2112d2c7 100755 --- a/setup.py +++ b/setup.py @@ -324,7 +324,9 @@ def main(): "quantum transport calculations.", license="not to be distributed", packages=["kwant", "kwant.graph", "kwant.linalg", "kwant.physics", - "kwant.solvers"], + "kwant.solvers", "kwant.tests", "kwant.graph.tests", + "kwant.linalg.tests", "kwant.physics.tests", + "kwant.solvers.tests"], cmdclass={'build': kwant_build, 'sdist': kwant_sdist, 'build_ext': kwant_build_ext, -- GitLab