Repository: incubator-senssoft-distill
Updated Branches:
  refs/heads/master 9d90328ec -> 907dd4bc6


Added support to pass in arguments to pytest


Project: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-distill/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-distill/commit/907dd4bc
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-distill/tree/907dd4bc
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-distill/diff/907dd4bc

Branch: refs/heads/master
Commit: 907dd4bc6fc30fd2b0c2d85a911dfb4e4ab43bfe
Parents: 9d90328
Author: mooshu1x2 <mbe...@draper.com>
Authored: Fri Sep 30 15:35:36 2016 -0400
Committer: mooshu1x2 <mbe...@draper.com>
Committed: Fri Sep 30 15:35:36 2016 -0400

----------------------------------------------------------------------
 setup.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-senssoft-distill/blob/907dd4bc/setup.py
----------------------------------------------------------------------
diff --git a/setup.py b/setup.py
index 8bcda73..5744c1f 100644
--- a/setup.py
+++ b/setup.py
@@ -38,16 +38,17 @@ def read (*filenames, **kwargs):
 # This is a plug-in for setuptools that will invoke py.test
 # when you run python setup.py test
 class PyTest (TestCommand):
+    user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
 
-    def finalize_options (self):
-        TestCommand.finalize_options (self)
-        self.test_args = []
-        self.test_suite = True
+    def initialize_options(self):
+        TestCommand.initialize_options(self)
+        self.pytest_args = []
 
-    def run_tests (self):
-       import pytest  # import here, because outside the required eggs aren't 
loaded yet
-       errno = pytest.main (self.test_args)
-       sys.exit (errno)
+    def run_tests(self):
+        #import here, cause outside the eggs aren't loaded
+        import pytest
+        errno = pytest.main(self.pytest_args)
+        sys.exit(errno)
 
 # Get the version string
 def get_version ():

Reply via email to