Hi, you may be interested in this.  It's part of the unittest module that ships with Python:<div><br></div><div>=======================</div><div><div>./python.exe -m unittest test.test_call.CFunctionCalls.test_varargs0</div>
<div>.</div><div>----------------------------------------------------------------------</div><div>Ran 1 test in 0.000s</div><div><br></div><div>OK</div><div>=======================</div><div><br></div><div>An added bonus is that this works across many Python projects.</div>
<div><br></div><div>Hope this helps,</div><div><br></div><div>Jerry Seutter</div><div><br></div><br><div class="gmail_quote">On Mon, Aug 16, 2010 at 2:37 PM, Giampaolo Rodolà <span dir="ltr"><<a href="mailto:g.rodola@gmail.com">g.rodola@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
when working on a test suite, no matter if writing new test cases from<br>
scratch or modifying an existing one, the need of temporarily<br>
excluding other tests and focus on that particular one is very common<br>
(at least for me).<br>
This is especially true when working on a test suite which contains a<br>
lot of tests producing a very verbose output result or which takes a<br>
lot to complete.<br>
<br>
What I usually do in such cases is to scroll down until test_main()<br>
function, manually change support.run_unittest() ilke this:<br>
<br>
-    support.run_unittest(TestCase1, TestCase2, TestCase3, TestCase4)<br>
+    support.run_unittest(TestCase4)<br>
<br>
...and then comment out all the test cases in TestCase4 class except<br>
the one I'm interested in.<br>
This is obviously not very flexible, then I thought that maybe<br>
unittest (or test/support module, I'm not sure) could provide a<br>
specific decorator for temporarily running only one specific test<br>
class(es) or method(s).<br>
The decorator could be used in 3 ways:<br>
<br>
== use case #1 ==<br>
<br>
@unittest.exclude_others<br>
class TestCase1:<br>
     ...<br>
<br>
All TestCase1 test cases are run, TestCase2, TestCase3 and TestCase4<br>
classes are excluded.<br>
<br>
<br>
== use case #2 ==<br>
<br>
class TestCase1:<br>
<br>
   @unittest.exclude_others<br>
    def test_something(self):<br>
         ....<br>
<br>
All TestCase1.* tests are excluded except "test_something".<br>
TestCase2, TestCase3 and TestCase4 are run.<br>
<br>
<br>
== use case #3 ==<br>
<br>
@unittest.exclude_others<br>
class TestCase1:<br>
<br>
   @unittest.exclude_others<br>
    def test_something(self):<br>
         ....<br>
Only TestCase1.test_something() is run (this is the most common use case).<br>
<br>
<br>
Thoughts?<br>
<br>
<br>
Kindest regards,<br>
<br>
<br>
--- Giampaolo<br>
<a href="http://code.google.com/p/pyftpdlib/" target="_blank">http://code.google.com/p/pyftpdlib/</a><br>
<a href="http://code.google.com/p/psutil/" target="_blank">http://code.google.com/p/psutil/</a><br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</blockquote></div><br></div>