diff --git a/packages/py-pynn/package.py b/packages/py-pynn/package.py
index 0366f2aab09328f9368096a7f60884fd5e4afbc0..a6ff67a8b996c3391373daf43e63d9c981395961 100644
--- a/packages/py-pynn/package.py
+++ b/packages/py-pynn/package.py
@@ -31,34 +31,42 @@ class PyPynn(PythonPackage):
 
     depends_on('py-setuptools',         type=('build'))
 
-    depends_on('py-jinja2@2.7:',        type=('build', 'run'))
-    depends_on('py-docutils@0.10:',     type=('build', 'run'))
+    depends_on('py-jinja2@2.7:',        type=('run', 'test'))
+    depends_on('py-docutils@0.10:',     type=('run', 'test'))
 
-    depends_on('py-numpy@1.8.2:',       type=('build', 'run'), when="@0.9.5")
-    depends_on('py-numpy@1.13.0:',      type=('build', 'run'), when="@0.9.6")
-    depends_on('py-numpy@1.16.1:',      type=('build', 'run'), when="@0.10.0")
-    depends_on('py-numpy@1.18.5:',      type=('build', 'run'), when="@0.10.1:")
+    depends_on('py-numpy@1.8.2:',       type=('run', 'test'), when="@0.9.5")
+    depends_on('py-numpy@1.13.0:',      type=('run', 'test'), when="@0.9.6")
+    depends_on('py-numpy@1.16.1:',      type=('run', 'test'), when="@0.10.0")
+    depends_on('py-numpy@1.18.5:',      type=('run', 'test'), when="@0.10.1:")
 
-    depends_on('py-mpi4py', type=('build', 'run'), when='+mpi')
-    depends_on('py-quantities@0.12.1:', type=('build', 'run'), when="@0.9.5:")
+    depends_on('py-mpi4py',             type=('run', 'test'), when='+mpi')
+    depends_on('py-quantities@0.12.1:', type=('run', 'test'), when="@0.9.5:")
 
-    depends_on('py-lazyarray@0.3.2:',   type=('build', 'run'), when="@0.9.5")
-    depends_on('py-lazyarray@0.3.4:',   type=('build', 'run'), when="@0.9.6")
-    depends_on('py-lazyarray@0.5.0:',   type=('build', 'run'), when="@0.10.0")
-    depends_on('py-lazyarray@0.5.2:',   type=('build', 'run'), when="@0.10.1:")
+    depends_on('py-lazyarray@0.3.2:',   type=('run', 'test'), when="@0.9.5")
+    depends_on('py-lazyarray@0.3.4:',   type=('run', 'test'), when="@0.9.6")
+    depends_on('py-lazyarray@0.5.0:',   type=('run', 'test'), when="@0.10.0")
+    depends_on('py-lazyarray@0.5.2:',   type=('run', 'test'), when="@0.10.1:")
 
-    depends_on('py-neo@0.5.2:',         type=('build', 'run'), when="@0.9.5")
-    depends_on('py-neo@0.8.0',          type=('build', 'run'), when="@0.9.6")
-    depends_on('py-neo@0.10.0:',        type=('build', 'run'), when="@0.10.0")
-    depends_on('py-neo@0.11.0:',        type=('build', 'run'), when="@0.10.1:")
+    depends_on('py-neo@0.5.2:',         type=('run', 'test'), when="@0.9.5")
+    depends_on('py-neo@0.8.0',          type=('run', 'test'), when="@0.9.6")
+    depends_on('py-neo@0.10.0:',        type=('run', 'test'), when="@0.10.0")
+    depends_on('py-neo@0.11.0:',        type=('run', 'test'), when="@0.10.1:")
 
-    depends_on('neuron@8.1:',           type=('build','run'), when="@0.10.1:")
-    depends_on('nest@3.3:',             type=('build','run'), when="@0.10.1:")
-    depends_on('py-brian2',             type=('build','run'))
+    depends_on('neuron@8.1:+python',    type=('run', 'test'), when="@0.10.1:")
+    depends_on('nest@3.3:+python',      type=('run', 'test'), when="@0.10.1:")
+    depends_on('py-brian2',             type=('run', 'test'))
 
-    depends_on('py-mock@1.0:', type='test')
+    depends_on('py-mock@1.0:',          type='test')
+    depends_on("py-pytest",             type='test', when="@0.11.0:")
 
     patch('pynn-0.9.6-python3.patch', when='@0.9.6 ^python@3:')
 
     # neuroml and nineml are optional dependencies. Leave out of import_modules to avoid errors in tests
     skip_modules = ['pyNN.neuroml', 'pyNN.nineml', 'pyNN.hardware']
+
+    @run_after('install')
+    @on_package_attributes(run_tests=True)
+    def install_test(self):
+        # run tests here:
+        pytest = which('pytest')
+        pytest()