[Pytest-commit] commit/pytest: hpk42: Merged in tbekolay/pytest/tbekolay/better-setuptools-integration-in-goodpra-1400520902689 (pull request #171)

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon May 19 20:30:59 CEST 2014


1 new commit in pytest:

https://bitbucket.org/hpk42/pytest/commits/7b67cc5603a6/
Changeset:   7b67cc5603a6
User:        hpk42
Date:        2014-05-19 20:30:54
Summary:     Merged in tbekolay/pytest/tbekolay/better-setuptools-integration-in-goodpra-1400520902689 (pull request #171)

Better setuptools integration in goodpractices
Affected #:  1 file

diff -r 9a891617d5a28b75043d1f6480bf41b8f39ddc2f -r 7b67cc5603a6d67b8867874595a82e9a8137233e doc/en/goodpractises.txt
--- a/doc/en/goodpractises.txt
+++ b/doc/en/goodpractises.txt
@@ -229,6 +229,12 @@
 
 
     class PyTest(TestCommand):
+        user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
+
+        def initialize_options(self):
+            TestCommand.initialize_options(self)
+            self.pytest_args = None
+
         def finalize_options(self):
             TestCommand.finalize_options(self)
             self.test_args = []
@@ -237,7 +243,7 @@
         def run_tests(self):
             #import here, cause outside the eggs aren't loaded
             import pytest
-            errno = pytest.main(self.test_args)
+            errno = pytest.main(self.pytest_args)
             sys.exit(errno)
 
 
@@ -252,7 +258,12 @@
     python setup.py test
 
 this will download ``pytest`` if needed and then run your tests
-as you would expect it to.
+as you would expect it to. You can pass a single string of arguments
+using the ``--pytest-args`` or ``-a`` command-line option. For example::
+
+    python setup.py test -a "--durations=5"
+
+is equivalent to running ``py.test --durations=5``.
 
 .. _`test discovery`:
 .. _`Python test discovery`:

Repository URL: https://bitbucket.org/hpk42/pytest/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the pytest-commit mailing list