Merge lp:~kampka/testtools/issue-726539 into lp:~testtools-committers/testtools/trunk

Proposed by Christian Kampka
Status: Merged
Merged at revision: 178
Proposed branch: lp:~kampka/testtools/issue-726539
Merge into: lp:~testtools-committers/testtools/trunk
Diff against target: 69 lines (+39/-0)
3 files modified
doc/for-test-authors.rst (+30/-0)
setup.cfg (+6/-0)
testtools/__init__.py (+3/-0)
To merge this branch: bzr merge lp:~kampka/testtools/issue-726539
Reviewer Review Type Date Requested Status
Jonathan Lange Approve
Review via email: mp+51753@code.launchpad.net

Description of the change

* Fixes TestCommand import and reexports it from the testtools package
* Adds a sample setup.cfg configuration for the distutils TestCommand
  to demonstrate the proper usage of the command and so that
  ``python setup.py test`` may actually do something useful by default

To post a comment you must log in.
lp:~kampka/testtools/issue-726539 updated
177. By Christian Kampka

* added basic documentation on how to use testtools with distutils

Revision history for this message
Jonathan Lange (jml) wrote :

Thanks so much for this patch, especially since it comes with documentation! Very sorry about the delay. I've merged your patch with some minor tweaks (NEWS, removed commented-out lines, changed "You can the run" to "You can then run").

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/for-test-authors.rst'
--- doc/for-test-authors.rst 2011-01-22 16:47:31 +0000
+++ doc/for-test-authors.rst 2011-03-14 21:32:18 +0000
@@ -88,6 +88,34 @@
8888
89From now on, we'll assume that you know how to run your tests.89From now on, we'll assume that you know how to run your tests.
9090
91Running test with Distutils
92~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93
94If you are using Distutils_ to build your Python project, you can use the testtools
95Distutils_ command to integrate testtools into your Distutils_ workflow::
96
97 from distutils.core import setup
98 from testtools import TestCommand
99 setup(name='foo',
100 version='1.0',
101 py_modules=['foo'],
102 cmdclass={'test': TestCommand}
103 )
104
105You can the run::
106
107 $ python setup.py test -m exampletest
108 Tests running...
109 Ran 2 tests in 0.000s
110
111 OK
112
113For more information about the capabilities of the `TestCommand` command see::
114
115 $ python setup.py test --help
116
117You can use the `setup configuration`_ to specify the default behavior of the
118`TestCommand` command.
91119
92Assertions120Assertions
93==========121==========
@@ -1098,3 +1126,5 @@
1098.. _Deferred: http://twistedmatrix.com/documents/current/core/howto/defer.html1126.. _Deferred: http://twistedmatrix.com/documents/current/core/howto/defer.html
1099.. _discover: http://pypi.python.org/pypi/discover1127.. _discover: http://pypi.python.org/pypi/discover
1100.. _`testtools API docs`: http://mumak.net/testtools/apidocs/1128.. _`testtools API docs`: http://mumak.net/testtools/apidocs/
1129.. _Distutils: http://docs.python.org/library/distutils.html
1130.. _`setup configuration`: http://docs.python.org/distutils/configfile.html
11011131
=== added file 'setup.cfg'
--- setup.cfg 1970-01-01 00:00:00 +0000
+++ setup.cfg 2011-03-14 21:32:18 +0000
@@ -0,0 +1,6 @@
1[test]
2test_module = testtools.tests
3;test_suite = testtools.tests.test_suite
4;failfast=1
5buffer=1
6catch=1
07
=== modified file 'testtools/__init__.py'
--- testtools/__init__.py 2011-02-14 14:53:41 +0000
+++ testtools/__init__.py 2011-03-14 21:32:18 +0000
@@ -61,6 +61,9 @@
61 ConcurrentTestSuite,61 ConcurrentTestSuite,
62 iterate_tests,62 iterate_tests,
63 )63 )
64from testtools.distutilscmd import (
65 TestCommand,
66)
6467
65# same format as sys.version_info: "A tuple containing the five components of68# same format as sys.version_info: "A tuple containing the five components of
66# the version number: major, minor, micro, releaselevel, and serial. All69# the version number: major, minor, micro, releaselevel, and serial. All

Subscribers

People subscribed via source and target branches