diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
 from __future__ import with_statement
+import sys
 import os.path
 import setuptools
 
@@ -6,6 +7,10 @@ import setuptools
 MISC_DIR = "misc"
 REQUIREMENT_DIR = "requirements"
 
+needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
+pytest_runner = ['pytest-runner'] if needs_pytest else []
+
+
 with open("README.rst") as fp:
     long_description = fp.read()
 
@@ -31,7 +36,7 @@ setuptools.setup(
     include_package_data=True,
     install_requires=install_requires,
     packages=setuptools.find_packages(exclude=['test*']),
-    setup_requires=["pytest-runner"],
+    setup_requires=pytest_runner,
     tests_require=tests_require,
     classifiers=[
         "Development Status :: 4 - Beta",
Make pytest-runner a conditional requirement

Check for pytest-runner only if setup.py was invoked with 'test'
argument.

#<I>