From geert at boskant.nl Sat May 6 00:10:35 2006 From: geert at boskant.nl (Geert Jansen) Date: Sat, 06 May 2006 00:10:35 +0200 Subject: [py-dev] win32 improvements Message-ID: <445BCD5B.7070403@boskant.nl> Hi, the attached patch improves win32 support for some of the command line utilities in the py library. - add support for CMD.EXE in env.py - add "env.cmd" that behaves like "eval `python env.py`" on Unix - add proper quoting for the various scripts in bin/win32 - end scripts in bin/win32 with newlines - set svn:eol-style native on bin/win32 scripts Regards, Geert -------------- next part -------------- A non-text attachment was scrubbed... Name: py-win32.patch Type: text/x-patch Size: 4361 bytes Desc: not available URL: From timothy.grant at gmail.com Sat May 6 05:30:13 2006 From: timothy.grant at gmail.com (Timothy Grant) Date: Fri, 5 May 2006 20:30:13 -0700 Subject: [py-dev] Ann: PyTestMate Message-ID: Hi everyone, I'm not sure there's anyone here who develops on Mac, nor if there is anyone who uses the wonderful TextMate editor on said Mac. However, if you do, and you're interested, I have created a little tool to help with py.test within TextMate. The link to my blog entry and the code itself is here... http://www.craigelachie.org/serendipity/index.php?/archives/41-PyTestMate.html -- Stand Fast, tjg. From jan at balster.info Sat May 6 10:53:28 2006 From: jan at balster.info (Jan Balster) Date: Sat, 06 May 2006 10:53:28 +0200 Subject: [py-dev] win32 improvements In-Reply-To: <445BCD5B.7070403@boskant.nl> References: <445BCD5B.7070403@boskant.nl> Message-ID: <445C6408.4000806@balster.info> Hi Geert, thanks for your patch. I committed it as revision 26847. cheers, Jan Geert Jansen wrote: > Hi, > > the attached patch improves win32 support for some of the command line > utilities in the py library. > > - add support for CMD.EXE in env.py > - add "env.cmd" that behaves like "eval `python env.py`" on Unix > - add proper quoting for the various scripts in bin/win32 > - end scripts in bin/win32 with newlines > - set svn:eol-style native on bin/win32 scripts > > Regards, > Geert > > > ------------------------------------------------------------------------ > > _______________________________________________ > py-dev mailing list > py-dev at codespeak.net > http://codespeak.net/mailman/listinfo/py-dev From hpk at trillke.net Fri May 26 10:12:51 2006 From: hpk at trillke.net (holger krekel) Date: Fri, 26 May 2006 10:12:51 +0200 Subject: [py-dev] Little py.test patch In-Reply-To: <44760704.7000200@gmail.com> References: <44760704.7000200@gmail.com> Message-ID: <20060526081251.GU12245@solar.trillke> On Thu, May 25, 2006 at 21:35 +0200, Antonio Cuni wrote: > Hi Holger, > I've written a little patch for py.test that implements a new feature. thanks! > Basically, I noticed that often I do the following code-and-test cycle, > especially after a large refactoring: > - edit the code > - run all test with -x > - correct the bug (ofter a stupid one, like a type) > - restart the cycle did you notice the existing "--looponfailing" option? It aims to automize this cycle. i am a bit in a rush, sorry and best, holger > I don't like to run all tests without -x because often one small bug > affects many tests, so I don't want to wait for them to be completed. > > The problem with my approach is that when the failing tests are at the > end of the queue I have to wait long before all previous tests (that I > already know to pass) complete, so I wrote some code that let me to > start from a specific test (identified by a number) and skip the ones > that come before. > > The command-line option to do this is '-n'; when a test fails its number > is printed at the start of the traceback, just after the name, so we can > easily restart from there. > > I don't know how well written is the patch, because I know very little > of py.test internals, it may seem just a quick hack, but it does the job. > > Here is the diff against revision 26654, feel free to include in the > repository. > > ciao Anto > Index: defaultconftest.py > =================================================================== > --- defaultconftest.py (revision 26654) > +++ defaultconftest.py (working copy) > @@ -23,7 +23,10 @@ > help="disable catching of sys.stdout/stderr output."), > Option('-k', > action="store", dest="keyword", default='', > - help="only run test items matching the given (google-style) keyword expression"), > + help="only run test items matching the given (google-style) keyword expression"), > + Option('-n', > + action="store", dest="startfrom", default=0, > + help="only run test items whose count number is greater or equal to the given number"), > Option('-l', '--showlocals', > action="store_true", dest="showlocals", default=False, > help="show locals in tracebacks (disabled by default)"), > Index: session.py > =================================================================== > --- session.py (revision 26654) > +++ session.py (working copy) > @@ -7,7 +7,8 @@ > """ > def __init__(self, config): > self._memo = [] > - self.config = config > + self.config = config > + self.colitem_count = 0 > > def shouldclose(self): > return False > @@ -63,6 +64,9 @@ > if self.shouldclose(): > raise Exit, "received external close signal" > > + colitem.count = self.colitem_count > + self.colitem_count += 1 > + > outcome = None > colitem.startcapture() > try: > @@ -94,6 +98,7 @@ > return > if isinstance(colitem, py.test.Item): > self.skipbykeyword(colitem) > + self.skipbystartfrom(colitem) > res = colitem.run() > if res is None: > return py.test.Item.Passed() > @@ -124,6 +129,14 @@ > if not (eor ^ self._matchonekeyword(key, chain)): > py.test.skip("test not selected by keyword %r" %(keyword,)) > > + def skipbystartfrom(self, colitem): > + try: > + startfrom = int(self.config.option.startfrom) > + except ValueError: > + startfrom = 0 > + if colitem.count < startfrom: > + py.test.skip('test not selected by start from %d filter' % startfrom) > + > def _matchonekeyword(self, key, chain): > for subitem in chain: > if subitem.haskeyword(key): > Index: terminal/terminal.py > =================================================================== > --- terminal/terminal.py (revision 26654) > +++ terminal/terminal.py (working copy) > @@ -360,9 +360,9 @@ > # entry.frame.code.firstlineno != lineno: > # self.out.line("testcode: %s:%d" % (fn, lineno+1)) > if root == fn: > - self.out.sep("_", "entrypoint: %s" %(modpath)) > + self.out.sep("_", "entrypoint: %s (%d)" %(modpath, item.count)) > else: > - self.out.sep("_", "entrypoint: %s %s" %(root.basename, modpath)) > + self.out.sep("_", "entrypoint: %s %s (%d)" %(root.basename, modpath, item.count)) > > def getentrysource(self, entry): > try: -- merlinux GmbH Steinbergstr. 42 31139 Hildesheim http://merlinux.de tel +49 5121 20800 75 (fax 77) From anto.cuni at gmail.com Fri May 26 11:36:03 2006 From: anto.cuni at gmail.com (Antonio Cuni) Date: Fri, 26 May 2006 11:36:03 +0200 Subject: [py-dev] Little py.test patch In-Reply-To: <20060526081251.GU12245@solar.trillke> References: <44760704.7000200@gmail.com> <20060526081251.GU12245@solar.trillke> Message-ID: <4476CC03.6060209@gmail.com> holger krekel wrote: > On Thu, May 25, 2006 at 21:35 +0200, Antonio Cuni wrote: >> Hi Holger, >> I've written a little patch for py.test that implements a new feature. > > thanks! > >> Basically, I noticed that often I do the following code-and-test cycle, >> especially after a large refactoring: >> - edit the code >> - run all test with -x >> - correct the bug (ofter a stupid one, like a type) >> - restart the cycle > > did you notice the existing "--looponfailing" option? > It aims to automize this cycle. Hi Holger, no, I didn't notice looponfailing, it's what I was searching for :-). ciao Anto From anto.cuni at gmail.com Thu May 25 21:35:32 2006 From: anto.cuni at gmail.com (Antonio Cuni) Date: Thu, 25 May 2006 21:35:32 +0200 Subject: [py-dev] Little py.test patch Message-ID: <44760704.7000200@gmail.com> Hi Holger, I've written a little patch for py.test that implements a new feature. Basically, I noticed that often I do the following code-and-test cycle, especially after a large refactoring: - edit the code - run all test with -x - correct the bug (ofter a stupid one, like a type) - restart the cycle I don't like to run all tests without -x because often one small bug affects many tests, so I don't want to wait for them to be completed. The problem with my approach is that when the failing tests are at the end of the queue I have to wait long before all previous tests (that I already know to pass) complete, so I wrote some code that let me to start from a specific test (identified by a number) and skip the ones that come before. The command-line option to do this is '-n'; when a test fails its number is printed at the start of the traceback, just after the name, so we can easily restart from there. I don't know how well written is the patch, because I know very little of py.test internals, it may seem just a quick hack, but it does the job. Here is the diff against revision 26654, feel free to include in the repository. ciao Anto -------------- next part -------------- A non-text attachment was scrubbed... Name: py.test.diff Type: text/x-patch Size: 3124 bytes Desc: not available URL: From cfbolz at gmx.de Sun May 28 15:34:58 2006 From: cfbolz at gmx.de (Carl Friedrich Bolz) Date: Sun, 28 May 2006 15:34:58 +0200 Subject: [py-dev] Little py.test patch In-Reply-To: <4476CC03.6060209@gmail.com> References: <44760704.7000200@gmail.com> <20060526081251.GU12245@solar.trillke> <4476CC03.6060209@gmail.com> Message-ID: <348899050605280634i5d373e54m63aacd6368a0e2ba@mail.gmail.com> 2006/5/26, Antonio Cuni : > > no, I didn't notice looponfailing, it's what I was searching for :-). Holger borrowed the time machine from guido :-) Cheers, Carl Friedrich