Repository: vispy/vispy

Issue:
test functionality always gets imported 
I'd say that `vispy.testing` only needs to be imported when testing. It should not be dragged in by default IMO.



Discussion:
The nice thing about having it in by default is that one can do vispy.test(), just like in numpy, scipy, scikit-learn (I think), etc. So I am -1 on removing it, unless it seems like it's slowing down the package, or might in the long run...?

I am also a bit wary of unnecessary side effects. I don't think we have that right now, but in earlier versions of the testing module we actually imported all backends.

What about:

```
def test(*bla):
    from vispy.testing import test as test_  # noqa
    return test_(*bla)
```

+1 for nested import, this is a good use case for it

+1


Resolving patch:
diff --git a/make/make.py b/make/make.py
--- a/make/make.py
+++ b/make/make.py
@@ -147,7 +147,18 @@ def website(self, arg):
             sys.exit('Command "website" does not have subcommand "%s"' % arg)
 
     def test(self, arg):
-        """ Run all tests. """
+        """ Run tests:
+                * full - run all tests
+                * nose - run nose tests (also for each backend)
+                * any backend name (e.g. pyside, pyqt4, glut, sdl2, etc.) - 
+                  run tests for the given backend
+                * nobackend - run tests that do not require a backend
+                * extra - run extra tests (line endings and style)
+                * lineendings - test line ending consistency
+                * flake - flake style testing (PEP8 and more)
+        """
+        if not arg:
+            return self.help('test')
         from vispy import test
         try:
             test(*(arg.split()))
diff --git a/vispy/__init__.py b/vispy/__init__.py
--- a/vispy/__init__.py
+++ b/vispy/__init__.py
@@ -33,6 +33,23 @@
 
 from .util import (dataio, _parse_command_line_arguments, config,  # noqa
                    set_log_level, keys, sys_info)  # noqa
-from .testing import _tester as test  # noqa
 
 _parse_command_line_arguments()
+
+
+# Define test proxy function, so we don't have to import vispy.testing now
+def test(label='full', coverage=False, verbosity=1):
+    """Test vispy software
+
+    Parameters
+    ----------
+    label : str
+        Can be one of 'full', 'nose', 'nobackend', 'extra', 'lineendings',
+        'flake', or any backend name (e.g., 'qt').
+    coverage : bool
+        Produce coverage outputs (.coverage file and printing).
+    verbosity : int
+        Verbosity level to use when running ``nose``.
+    """
+    from .testing import _tester
+    return _tester(label, coverage, verbosity)


Test patch:
diff --git a/vispy/testing/_runners.py b/vispy/testing/_runners.py
--- a/vispy/testing/_runners.py
+++ b/vispy/testing/_runners.py
@@ -132,17 +132,7 @@ def _check_line_endings():
 
 
 def _tester(label='full', coverage=False, verbosity=1):
-    """Test vispy software
-
-    Parameters
-    ----------
-    label : str
-        Can be one of 'full', 'nose', 'nobackend', 'extra', 'lineendings',
-        'flake', or any backend name (e.g., 'qt').
-    coverage : bool
-        Produce coverage outputs (.coverage file and printing).
-    verbosity : int
-        Verbosity level to use when running ``nose``.
+    """Test vispy software. See vispy.test()
     """
     from vispy.app.backends import BACKEND_NAMES as backend_names
     label = label.lower()
diff --git a/vispy/util/tests/test_import.py b/vispy/util/tests/test_import.py
--- a/vispy/util/tests/test_import.py
+++ b/vispy/util/tests/test_import.py
@@ -14,7 +14,7 @@
 
 
 # minimum that will be imported when importing vispy
-_min_modules = ['vispy', 'vispy.util', 'vispy.testing', 'vispy.ext']
+_min_modules = ['vispy', 'vispy.util', 'vispy.ext']
 
 
 def check_output(*popenargs, **kwargs):