Don Dwiggins <ddwigg...@advpubtech.com> wrote: > Phil Christensen wrote: > > trial takes an argument at the command-line where you can specify a > > package or test case. > > > > for example: > > > > trial twisted > > trial twisted.test > > trial twisted.test.test_explorer > > trial twisted.test.test_explorer.TestBrowser > > trial twisted.test.test_explorer.TestBrowser.test_chain > > > > lets you get more and more specific. > > > > -phil > > Sorry, I'm feeling dense. I currently run it as > "trial MyServerTestFile.py"; it's not a package or part of one. In the > file are several classes, each with several test cases. How would I > adapt the above to my needs?
trial takes either a path and filename, or a Python import name (I'm not sure what the exact term here is). If you ran python in the same directory where you ran "trial" in your example, you could say: import MyServerTestFile MyServerTestFile.MyServerTestCase.test_my_server ...to refer to a particular test method, and trial will accept the same syntax: trial MyServerTestFile.MyServerTestCase.test_my_server In general though, a lot of distribution and packaging and deployment things become easier if your project is laid out in Python packages. I usually follow these rules and everything turns out pretty well: http://jcalderone.livejournal.com/39794.html
signature.asc
Description: PGP signature
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python