From glumor at faza.ru Sat Jul 1 14:51:24 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 15:51:24 +0300 Subject: [py-svn] Visit this sites! Message-ID: An HTML attachment was scrubbed... URL: From glumor at faza.ru Sat Jul 1 16:06:45 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 09:06:45 -0500 Subject: [py-svn] Visit this sites! Message-ID: Visit %3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fadipex%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fadipex%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fxanax%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fxanax%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fphentermine%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fphentermine%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fcialis%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fcialis%2F%3C%2Fa%3E%3Cahref%3Dhttp%3A%2F%2Farbat.or.at%2Fviagra%2F%3Ehttp%3A%2F%2Farbat.or.at%2Fviagra%2F%3C%2Fa%3E From glumor at faza.ru Sat Jul 1 16:21:09 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 09:21:09 -0500 Subject: [py-svn] Visit this sites! Message-ID: Visit http://arbat.or.at/adipex/ http://arbat.or.at/xanax/ http://arbat.or.at/phentermine/ http://arbat.or.at/cialis/ http://arbat.or.at/viagra/ From glumor at faza.ru Sat Jul 1 16:23:06 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 09:23:06 -0500 Subject: [py-svn] Visit this sites! Message-ID: Visit http://arbat.or.at/adipex/ http://arbat.or.at/xanax/ http://arbat.or.at/phentermine/ http://arbat.or.at/cialis/ http://arbat.or.at/viagra/ From glumor at faza.ru Sat Jul 1 18:14:12 2006 From: glumor at faza.ru (glumor at faza.ru) Date: Sat, 01 Jul 2006 11:14:12 -0500 Subject: [py-svn] Visit this sites! Message-ID: Visit http://alcoholico-es.info/ http://arbat.or.at/adipex/#adipex http://arbat.or.at/alprazolam/#alprazolam http://arbat.or.at/ambien/#ambien http://arbat.or.at/ativan/#ativan http://arbat.or.at/bontril/#bontril http://arbat.or.at/texas-holdem/#texas-holdem http://arbat.or.at/tramadol/#tramadol http://arbat.or.at/ultram/#ultram http://arbat.or.at/valium/#valium http://arbat.or.at/viagra/#viagra http://arbat.or.at/vicodin/#vicodin http://arbat.or.at/xanax/#xanax http://arbat.or.at/butalbital/#butalbital http://arbat.or.at/carisoprodol/ http://arbat.or.at/cialis/#cialis http://arbat.or.at/clonazepam/#clonazepam http://arbat.or.at/diazepam/#diazepam http://arbat.or.at/didrex/#didrex http://arbat.or.at/lorazepam/#cheap http://arbat.or.at/online-pharmacy/#online http://arbat.or.at/phentermine/#phentermine http://arbat.or.at/poker-room/#poker-room-online http://arbat.or.at/fioricet/#fioricet http://arbat.or.at/hydrocodone/#hydrocodone http://arbat.or.at/ionamin/#ionamine http://arbat.or.at/klonopin/#klonopin http://arbat.or.at/lorcet/#lorcet http://arbat.or.at/lortab/#lortab http://arbat.or.at/fastin/#fastin http://arbat.or.at/rivotril/#rivotril http://arbat.or.at/soma/#soma http://arbat.or.at/stilnox/#stilnox http://arbat.or.at/tenuate/#tenuate http://arbat.or.at/carisoma/#carisoma http://arbat.or.at/zolpidem/#zolpidem http://phenblonews.net/#wheight-loss-phentermine http://phennewsblo.com/#adipex-phentermine http://pax-blogs.info/#paxil http://phe-blogs.info/#phentermine-drug http://pr-blogs.info/#prozac-us http://pla-blogs.info/#plavix http://pro-blogs.info/#prozac http://nor-blogs.info/#norvax-online http://red-blogs.info/ http://val-blogs.info/#valium-order http://via-blogs.info/#viagra-cialis http://xen-blogs.info/#xenical-online http://xan-blogs.info/#buy-xanax http://arbat.or.at/boxing-betting/#boxing-betting http://peoplegrad.gen.in/ad/#onlineadipex http://peoplegrad.gen.in/allam/#onlinealprazolam http://peoplegrad.gen.in/ambi/#onlineambien http://peoplegrad.gen.in/avan/#cheapativan http://peoplegrad.gen.in/bont/#cheapbontril http://peoplegrad.gen.in/cilis/#cheapcialis http://peoplegrad.gen.in/clon/#clonazepambuy http://peoplegrad.gen.in/dize/#diazepambuy http://peoplegrad.gen.in/dix/#didrexpharmacy http://peoplegrad.gen.in/hycod/#hydrocodonevicodine http://peoplegrad.gen.in/lorz/#lorazepamorder http://peoplegrad.gen.in/pha/#onlinepharmacy http://peoplegrad.gen.in/fent/#phenterminepills http://peoplegrad.gen.in/trad/#tramadolultram http://peoplegrad.gen.in/valm/#valium-diazepam http://peoplegrad.gen.in/vgra/#viagra-buy-online http://peoplegrad.gen.in/naxan/#xanax-alprazolam-buy From hpk at codespeak.net Thu Jul 6 18:45:21 2006 From: hpk at codespeak.net (hpk at codespeak.net) Date: Thu, 6 Jul 2006 18:45:21 +0200 (CEST) Subject: [py-svn] r29699 - in py/dist/py/test: . testing Message-ID: <20060706164521.0A4BD1009B@code0.codespeak.net> Author: hpk Date: Thu Jul 6 18:45:19 2006 New Revision: 29699 Modified: py/dist/py/test/collect.py py/dist/py/test/testing/test_collect.py Log: refine recursive and file filters for directories. follow the documentaiton (thanks to Fijal for pointing at the documentation inconsistency, i think that the 'whatever_test.py' convention is not actually used much) Modified: py/dist/py/test/collect.py ============================================================================== --- py/dist/py/test/collect.py (original) +++ py/dist/py/test/collect.py Thu Jul 6 18:45:19 2006 @@ -222,9 +222,8 @@ class Directory(FSCollector): def filefilter(self, path): - pb = path.purebasename - return (path.check(fnmatch="*.py") and - (pb.startswith('test_') or pb.endswith('_test'))) + b = path.basename + return b.startswith('test_') and b.endswith('.py') def recfilter(self, path): return path.check(dotfile=0) and \ Modified: py/dist/py/test/testing/test_collect.py ============================================================================== --- py/dist/py/test/testing/test_collect.py (original) +++ py/dist/py/test/testing/test_collect.py Thu Jul 6 18:45:19 2006 @@ -38,6 +38,7 @@ tmp.ensure("CVS", 'test_notfound.py') tmp.ensure("{arch}", 'test_notfound.py') tmp.ensure(".whatever", 'test_notfound.py') + tmp.ensure(".bzr", 'test_notfound.py') tmp.ensure("normal", 'test_found.py') tmp.ensure('test_found.py') From hpk at codespeak.net Fri Jul 7 12:01:02 2006 From: hpk at codespeak.net (hpk at codespeak.net) Date: Fri, 7 Jul 2006 12:01:02 +0200 (CEST) Subject: [py-svn] r29726 - in py/dist/py: . documentation test test/testing Message-ID: <20060707100102.96F7E1008B@code0.codespeak.net> Author: hpk Date: Fri Jul 7 12:00:58 2006 New Revision: 29726 Added: py/dist/py/test/doctest.py (contents, props changed) py/dist/py/test/testing/test_doctest.py (contents, props changed) Modified: py/dist/py/__init__.py py/dist/py/documentation/test.txt py/dist/py/test/collect.py py/dist/py/test/defaultconftest.py Log: (guido, hpk) added experimental suppport for doctests - currently they need to be in files named test_*.txt. See documentation. Modified: py/dist/py/__init__.py ============================================================================== --- py/dist/py/__init__.py (original) +++ py/dist/py/__init__.py Fri Jul 7 12:00:58 2006 @@ -41,6 +41,7 @@ 'test.collect.Collector' : ('./test/collect.py', 'Collector'), 'test.collect.Directory' : ('./test/collect.py', 'Directory'), 'test.collect.Module' : ('./test/collect.py', 'Module'), + 'test.collect.DoctestFile' : ('./test/collect.py', 'DoctestFile'), 'test.collect.Class' : ('./test/collect.py', 'Class'), 'test.collect.Instance' : ('./test/collect.py', 'Instance'), 'test.collect.Generator' : ('./test/collect.py', 'Generator'), Modified: py/dist/py/documentation/test.txt ============================================================================== --- py/dist/py/documentation/test.txt (original) +++ py/dist/py/documentation/test.txt Fri Jul 7 12:00:58 2006 @@ -290,6 +290,15 @@ ``teardown_module`` pair more than once during the execution of a test module. +Experimental doctest support +------------------------------------------------------------ + +If you want to integrate doctests, ``py.test`` now by default +picks up files matching the ``test_*.txt`` pattern and +processes them as text files containing doctests. +This is an experimental feature and likely to change +its implementation. + Working Examples ================ Modified: py/dist/py/test/collect.py ============================================================================== --- py/dist/py/test/collect.py (original) +++ py/dist/py/test/collect.py Fri Jul 7 12:00:58 2006 @@ -60,6 +60,7 @@ self.fspath = getattr(parent, 'fspath', None) Module = configproperty('Module') + DoctestFile = configproperty('DoctestFile') Directory = configproperty('Directory') Class = configproperty('Class') Instance = configproperty('Instance') @@ -223,7 +224,8 @@ class Directory(FSCollector): def filefilter(self, path): b = path.basename - return b.startswith('test_') and b.endswith('.py') + ext = path.ext + return b.startswith('test_') and ext in ('.txt', '.py') def recfilter(self, path): return path.check(dotfile=0) and \ @@ -240,7 +242,10 @@ def makeitem(self, basename, filefilter=None, recfilter=None): p = self.fspath.join(basename) if p.check(file=1) and (not filefilter or filefilter(p)): - return self.Module(p, parent=self) + if p.ext == '.py': + return self.Module(p, parent=self) + elif p.ext == '.txt': + return self.DoctestFile(p, parent=self) elif p.check(dir=1) and (not recfilter or recfilter(p)): Directory = py.test.Config.getvalue('Directory', p) return Directory(p, parent=self) @@ -389,3 +394,14 @@ def getsortvalue(self): return self.getpathlineno() + +class DoctestFile(PyCollectorMixin, FSCollector): + def run(self): + return [self.fspath.basename] + + def join(self, name): + from py.__.test.doctest import DoctestText + if name == self.fspath.basename: + item = DoctestText(self.fspath.basename, parent=self) + item._content = self.fspath.read() + return item Modified: py/dist/py/test/defaultconftest.py ============================================================================== --- py/dist/py/test/defaultconftest.py (original) +++ py/dist/py/test/defaultconftest.py Fri Jul 7 12:00:58 2006 @@ -1,6 +1,7 @@ import py Module = py.test.collect.Module +DoctestFile = py.test.collect.DoctestFile Directory = py.test.collect.Directory Class = py.test.collect.Class Generator = py.test.collect.Generator Added: py/dist/py/test/doctest.py ============================================================================== --- (empty file) +++ py/dist/py/test/doctest.py Fri Jul 7 12:00:58 2006 @@ -0,0 +1,33 @@ +import py + +class DoctestText(py.test.Item): + + def _setcontent(self, content): + self._content = content + + #def buildname2items(self): + # parser = py.compat.doctest.DoctestParser() + # l = parser.get_examples(self._content) + # d = {} + # globs = {} + # locs + # for i, example in py.builtin.enumerate(l): + # ex = ExampleItem(example) + # d[str(i)] = ex + + def run(self): + mod = py.std.types.ModuleType(self.name) + #for line in s.split('\n'): + # if line.startswith(prefix): + # exec py.code.Source(line[len(prefix):]).compile() in mod.__dict__ + # line = "" + # else: + # l.append(line) + self.execute(mod, self._content) + + def execute(self, mod, docstring): + mod.__doc__ = docstring + failed, tot = py.compat.doctest.testmod(mod, verbose=1) + if failed: + py.test.fail("doctest %s: %s failed out of %s" %( + self.fspath, failed, tot)) Added: py/dist/py/test/testing/test_doctest.py ============================================================================== --- (empty file) +++ py/dist/py/test/testing/test_doctest.py Fri Jul 7 12:00:58 2006 @@ -0,0 +1,43 @@ + +import py +from py.__.test.doctest import DoctestText + +def test_simple_docteststring(): + testitem = DoctestText(name="dummy", parent=None) + testitem._setcontent(""" + >>> i = 0 + >>> i + 1 + 1 + """) + res = testitem.run() + assert res is None + +def test_simple_docteststring_failing(): + testitem = DoctestText(name="dummy2", parent=None) + testitem._setcontent(""" + >>> i = 0 + >>> i + 1 + 2 + """) + py.test.raises(py.test.Item.Failed, "testitem.run()") + + +def test_collect_doctest_files_with_test_prefix(): + o = py.test.ensuretemp("testdoctest") + checkfile = o.ensure("test_something.txt") + o.ensure("whatever.txt") + checkfile.write(py.code.Source(""" + alskdjalsdk + >>> i = 5 + >>> i-1 + 4 + """)) + from py.__.test.collect import getfscollector + for x in (o, checkfile): + #print "checking that %s returns custom items" % (x,) + col = getfscollector(x) + items = list(col.tryiter(py.test.Item)) + assert len(items) == 1 + assert isinstance(items[0], DoctestText) + + From briandorsey at codespeak.net Sat Jul 8 21:21:59 2006 From: briandorsey at codespeak.net (briandorsey at codespeak.net) Date: Sat, 8 Jul 2006 21:21:59 +0200 (CEST) Subject: [py-svn] r29872 - py/dist/py/c-extension/greenlet Message-ID: <20060708192159.C86D610076@code0.codespeak.net> Author: briandorsey Date: Sat Jul 8 21:21:57 2006 New Revision: 29872 Modified: py/dist/py/c-extension/greenlet/test_throw.py Log: Skip these tests when a C compiler isn't available. (Makes this test consistent with the other greenlet tests.) Modified: py/dist/py/c-extension/greenlet/test_throw.py ============================================================================== --- py/dist/py/c-extension/greenlet/test_throw.py (original) +++ py/dist/py/c-extension/greenlet/test_throw.py Sat Jul 8 21:21:57 2006 @@ -1,5 +1,8 @@ import py -from py.magic import greenlet +try: + from py.magic import greenlet +except RuntimeError, e: + py.test.skip(str(e)) def switch(*args): return greenlet.getcurrent().parent.switch(*args) From briandorsey at codespeak.net Sat Jul 8 22:37:13 2006 From: briandorsey at codespeak.net (briandorsey at codespeak.net) Date: Sat, 8 Jul 2006 22:37:13 +0200 (CEST) Subject: [py-svn] r29873 - in py/dist/py: documentation test test/testing Message-ID: <20060708203713.A4CBD1007A@code0.codespeak.net> Author: briandorsey Date: Sat Jul 8 22:37:12 2006 New Revision: 29873 Modified: py/dist/py/documentation/test.txt py/dist/py/test/collect.py py/dist/py/test/testing/test_collect.py Log: Re-enabled support for 'whatever_test.py' files, this time with documentation. Modified: py/dist/py/documentation/test.txt ============================================================================== --- py/dist/py/documentation/test.txt (original) +++ py/dist/py/documentation/test.txt Sat Jul 8 22:37:12 2006 @@ -36,9 +36,9 @@ py.test This will automatically collect and run any Python module whose filenames -start with ``test_`` from the directory and any subdirectories, starting -with the current directory, and run them. Each Python test module is -inspected for test methods starting with ``test_``. +start with ``test_`` or ends with ``_test`` from the directory and any +subdirectories, starting with the current directory, and run them. Each +Python test module is inspected for test methods starting with ``test_``. .. _features: @@ -87,11 +87,11 @@ The automated test collection process walks the current directory (or the directory given as a command line argument) and all its subdirectories and collects python modules with a -leading ``test_`` filename. From each test module every function -with a leading ``test_`` or class with a leading ``Test`` name -is collected. The collecting process can be customized at -directory, module or class level. (see `collection process`_ -for some implementation details). +leading ``test_`` or trailing ``_test`` filename. From each +test module every function with a leading ``test_`` or class with +a leading ``Test`` name is collected. The collecting process can +be customized at directory, module or class level. (see +`collection process`_ for some implementation details). .. _`generative tests`: @@ -294,8 +294,8 @@ ------------------------------------------------------------ If you want to integrate doctests, ``py.test`` now by default -picks up files matching the ``test_*.txt`` pattern and -processes them as text files containing doctests. +picks up files matching the ``test_*.txt`` or ``*_test.txt`` +patterns and processes them as text files containing doctests. This is an experimental feature and likely to change its implementation. Modified: py/dist/py/test/collect.py ============================================================================== --- py/dist/py/test/collect.py (original) +++ py/dist/py/test/collect.py Sat Jul 8 22:37:12 2006 @@ -223,9 +223,10 @@ class Directory(FSCollector): def filefilter(self, path): - b = path.basename + b = path.purebasename ext = path.ext - return b.startswith('test_') and ext in ('.txt', '.py') + return (b.startswith('test_') or + b.endswith('_test')) and ext in ('.txt', '.py') def recfilter(self, path): return path.check(dotfile=0) and \ Modified: py/dist/py/test/testing/test_collect.py ============================================================================== --- py/dist/py/test/testing/test_collect.py (original) +++ py/dist/py/test/testing/test_collect.py Sat Jul 8 22:37:12 2006 @@ -32,6 +32,18 @@ assert l[0] == 'test_one' assert l[1] == 'TestClass' +def test_found_certain_testfiles(): + tmp = py.test.ensuretemp("found_certain_testfiles") + tmp.ensure('test_found.py') + tmp.ensure('found_test.py') + + colitem = py.test.collect.Directory(tmp) + items = list(colitem.tryiter(py.test.collect.Module)) + assert len(items) == 2 + items = [item.name for item in items] + assert 'test_found.py' in items + assert 'found_test.py' in items + def test_ignored_certain_directories(): tmp = py.test.ensuretemp("ignore_certain_directories") tmp.ensure("_darcs", 'test_notfound.py') From fijal at codespeak.net Fri Jul 14 18:18:57 2006 From: fijal at codespeak.net (fijal at codespeak.net) Date: Fri, 14 Jul 2006 18:18:57 +0200 (CEST) Subject: [py-svn] r30048 - py/dist/py/path/local Message-ID: <20060714161857.633C510092@code0.codespeak.net> Author: fijal Date: Fri Jul 14 18:18:46 2006 New Revision: 30048 Modified: py/dist/py/path/local/posix.py Log: Fixed relative import. Modified: py/dist/py/path/local/posix.py ============================================================================== --- py/dist/py/path/local/posix.py (original) +++ py/dist/py/path/local/posix.py Fri Jul 14 18:18:46 2006 @@ -10,7 +10,7 @@ # Local Path Posix Mixin #__________________________________________________________ -from common import Stat +from py.__.path.local.common import Stat class PosixStat(Stat): def owner(self): From arigo at codespeak.net Sun Jul 23 13:27:26 2006 From: arigo at codespeak.net (arigo at codespeak.net) Date: Sun, 23 Jul 2006 13:27:26 +0200 (CEST) Subject: [py-svn] r30393 - py/dist/py/test/terminal Message-ID: <20060723112726.51CC6100C8@code0.codespeak.net> Author: arigo Date: Sun Jul 23 13:27:25 2006 New Revision: 30393 Modified: py/dist/py/test/terminal/terminal.py Log: Make the --tb=short kind of traceback robust against file not founds, like the default --tb=long tracebacks. Modified: py/dist/py/test/terminal/terminal.py ============================================================================== --- py/dist/py/test/terminal/terminal.py (original) +++ py/dist/py/test/terminal/terminal.py Sun Jul 23 13:27:25 2006 @@ -329,11 +329,15 @@ code = entry.frame.code self.out.line(' File "%s", line %d, in %s' % ( code.raw.co_filename, entry.lineno+1, code.raw.co_name)) - fullsource = entry.frame.code.fullsource try: - source = [fullsource[entry.lineno].lstrip()] - except IndexError: - source = [] + fullsource = entry.frame.code.fullsource + except py.error.ENOENT: + source = ["?"] + else: + try: + source = [fullsource[entry.lineno].lstrip()] + except IndexError: + source = [] if entry == last: if source: self.repr_source(source, 'E') From arigo at codespeak.net Mon Jul 24 18:24:23 2006 From: arigo at codespeak.net (arigo at codespeak.net) Date: Mon, 24 Jul 2006 18:24:23 +0200 (CEST) Subject: [py-svn] r30468 - in py/dist/py: . builtin builtin/testing Message-ID: <20060724162423.A6F3C100CB@code0.codespeak.net> Author: arigo Date: Mon Jul 24 18:24:21 2006 New Revision: 30468 Added: py/dist/py/builtin/exception.py (contents, props changed) py/dist/py/builtin/testing/test_exception.py (contents, props changed) Modified: py/dist/py/__init__.py py/dist/py/initpkg.py Log: Added py.builtin.BaseException, which is either BaseException (in 2.5) or just Exception (in 2.4). Modified: py/dist/py/__init__.py ============================================================================== --- py/dist/py/__init__.py (original) +++ py/dist/py/__init__.py Mon Jul 24 18:24:21 2006 @@ -86,6 +86,7 @@ # backports and additions of builtins 'builtin.enumerate' : ('./builtin/enumerate.py', 'enumerate'), 'builtin.reversed' : ('./builtin/reversed.py', 'reversed'), + 'builtin.BaseException' : ('./builtin/exception.py', 'BaseException'), # gateways into remote contexts 'execnet.SocketGateway' : ('./execnet/register.py', 'SocketGateway'), Added: py/dist/py/builtin/exception.py ============================================================================== --- (empty file) +++ py/dist/py/builtin/exception.py Mon Jul 24 18:24:21 2006 @@ -0,0 +1,4 @@ +try: + BaseException = BaseException +except NameError: + BaseException = Exception Added: py/dist/py/builtin/testing/test_exception.py ============================================================================== --- (empty file) +++ py/dist/py/builtin/testing/test_exception.py Mon Jul 24 18:24:21 2006 @@ -0,0 +1,13 @@ +import py + +def test_BaseException(): + assert issubclass(IndexError, py.builtin.BaseException) + assert issubclass(Exception, py.builtin.BaseException) + assert issubclass(KeyboardInterrupt, py.builtin.BaseException) + + class MyRandomClass(object): + pass + assert not issubclass(MyRandomClass, py.builtin.BaseException) + + assert py.builtin.BaseException.__module__ == 'exceptions' + assert Exception.__name__ == 'Exception' Modified: py/dist/py/initpkg.py ============================================================================== --- py/dist/py/initpkg.py (original) +++ py/dist/py/initpkg.py Mon Jul 24 18:24:21 2006 @@ -186,6 +186,10 @@ def _fixinspection(self, result, name): # modify some attrs to make a class appear at export level if hasattr(result, '__module__'): + if not result.__module__.startswith('py.__'): + return # don't change __module__ nor __name__ for classes + # that the py lib re-exports from somewhere else, + # e.g. py.builtin.BaseException try: setattr(result, '__module__', self.__name__) except (AttributeError, TypeError): From cfbolz at codespeak.net Wed Jul 26 11:34:50 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Wed, 26 Jul 2006 11:34:50 +0200 (CEST) Subject: [py-svn] r30556 - in py/dist/py/test: . testing Message-ID: <20060726093450.7ACE9100B5@code0.codespeak.net> Author: cfbolz Date: Wed Jul 26 11:34:48 2006 New Revision: 30556 Modified: py/dist/py/test/collect.py py/dist/py/test/testing/test_session.py Log: make keywords match the test name using 'keyword in name', instead of 'name.startswith(keyword)'. Modified: py/dist/py/test/collect.py ============================================================================== --- py/dist/py/test/collect.py (original) +++ py/dist/py/test/collect.py Wed Jul 26 11:34:48 2006 @@ -148,7 +148,7 @@ return [x.name for x in self.listchain()] def haskeyword(self, keyword): - return self.name.startswith(keyword) + return keyword in self.name def getmodpath(self): """ return dotted module path (relative to the containing). """ Modified: py/dist/py/test/testing/test_session.py ============================================================================== --- py/dist/py/test/testing/test_session.py (original) +++ py/dist/py/test/testing/test_session.py Wed Jul 26 11:34:48 2006 @@ -42,15 +42,16 @@ class TestKeywordSelection: def test_select_simple(self): - config, args = py.test.Config.parse(['-k', 'test_one']) - session = config.getsessionclass()(config, py.std.sys.stdout) - session.main([datadir / 'filetest.py']) - l = session.getitemoutcomepairs(py.test.Item.Failed) - assert len(l) == 1 - item = l[0][0] - assert item.name == 'test_one' - l = session.getitemoutcomepairs(py.test.Item.Skipped) - assert len(l) == 1 + for keyword in ['test_one', 'est_on']: + config, args = py.test.Config.parse(['-k', keyword]) + session = config.getsessionclass()(config, py.std.sys.stdout) + session.main([datadir / 'filetest.py']) + l = session.getitemoutcomepairs(py.test.Item.Failed) + assert len(l) == 1 + item = l[0][0] + assert item.name == 'test_one' + l = session.getitemoutcomepairs(py.test.Item.Skipped) + assert len(l) == 1 def test_select_extra_keywords(self): o = tmpdir.ensure('selecttest', dir=1)