[svn r63319] * fixing verbose reporting to work the "old" way for non-dist settings

* bump version number
* comment out greenlet C-Extension for now

--HG--
branch : trunk
This commit is contained in:
hpk 2009-03-25 12:50:57 +01:00
parent bf626bb786
commit 1930f50bc2
5 changed files with 43 additions and 45 deletions

View File

@ -23,12 +23,12 @@ http://pylib.org/contact.html
""" """
from initpkg import initpkg from initpkg import initpkg
version = "1.0.0a6" version = "1.0.0a7"
initpkg(__name__, initpkg(__name__,
description = "pylib and py.test: agile development and test support library", description = "pylib and py.test: agile development and test support library",
revision = int('$LastChangedRevision: 63241 $'.split(':')[1][:-1]), revision = int('$LastChangedRevision: 63319 $'.split(':')[1][:-1]),
lastchangedate = '$LastChangedDate: 2009-03-23 17:03:10 +0100 (Mon, 23 Mar 2009) $', lastchangedate = '$LastChangedDate: 2009-03-25 12:50:57 +0100 (Wed, 25 Mar 2009) $',
version = version, version = version,
url = "http://pylib.org", url = "http://pylib.org",
download_url = "http://codespeak.net/py/%s/download.html" % version, download_url = "http://codespeak.net/py/%s/download.html" % version,

View File

@ -108,16 +108,6 @@ class PytestPluginHooks:
""" called before test process is exited. """ called before test process is exited.
""" """
def pytest_event(self, event):
""" called for each internal py.test event. """
#def pytest_pyfuncarg_NAME(self, pyfuncitem, argname):
# """ provide (value, finalizer) for an open test function argument.
#
# the finalizer (if not None) will be called after the test
# function has been executed (i.e. pyfuncitem.execute() returns).
# """
def pytest_pyfunc_call(self, pyfuncitem, args, kwargs): def pytest_pyfunc_call(self, pyfuncitem, args, kwargs):
""" return True if we consumed/did the call to the python function item. """ """ return True if we consumed/did the call to the python function item. """
@ -139,24 +129,19 @@ class PytestPluginHooks:
def pytest_pymodule_makeitem(self, modcol, name, obj): def pytest_pymodule_makeitem(self, modcol, name, obj):
""" return custom item/collector for a python object in a module, or None. """ """ return custom item/collector for a python object in a module, or None. """
# reporting hooks (invoked from pytest_terminal.py)
# from pytest_terminal plugin
def pytest_report_teststatus(self, event):
""" return shortletter and verbose word. """
# from pytest_terminal plugin
def pytest_report_teststatus(self, event): def pytest_report_teststatus(self, event):
""" return shortletter and verbose word. """ """ return shortletter and verbose word. """
def pytest_terminal_summary(self, terminalreporter): def pytest_terminal_summary(self, terminalreporter):
""" add additional section in terminal summary reporting. """ """ add additional section in terminal summary reporting. """
# events # Events
def pyevent(self, eventname, *args, **kwargs): def pyevent(self, eventname, *args, **kwargs):
""" called for each testing event. """ """ called for each testing event. """
def pyevent_gateway_init(self, gateway): def pyevent_gateway_init(self, gateway):
""" called a gateway has been initialized. """ """ called after a gateway has been initialized. """
def pyevent_gateway_exit(self, gateway): def pyevent_gateway_exit(self, gateway):
""" called when gateway is being exited. """ """ called when gateway is being exited. """
@ -199,7 +184,6 @@ class PytestPluginHooks:
The gateway will have an 'id' attribute that is unique The gateway will have an 'id' attribute that is unique
within the gateway manager context. within the gateway manager context.
""" """
def pyevent_testnodeready(self, node): def pyevent_testnodeready(self, node):
""" Node is ready to operate. """ """ Node is ready to operate. """

View File

@ -143,11 +143,15 @@ class TerminalReporter:
if node: if node:
extra = "-> " + str(node.gateway.id) extra = "-> " + str(node.gateway.id)
self.write_ensure_prefix(line, extra) self.write_ensure_prefix(line, extra)
#else: # in dist situations itemstart (currently only means we
# # ensure that the path is printed before the 1st test of # queued the item for testing, doesn't tell much
# # a module starts running elif self.config.option.verbose and self.config.option.dist == "no":
# fspath = item.fspath # ensure that the path is printed before the 1st test of
# self.write_fspath_result(fspath, "") # a module starts running
info = item.repr_metainfo()
line = info.verboseline(basedir=self.curdir) + " "
#self.write_fspath_result(fspath, "")
self.write_ensure_prefix(line, "")
def pyevent_rescheduleitems(self, event): def pyevent_rescheduleitems(self, event):
if self.config.option.debug: if self.config.option.debug:
@ -169,13 +173,15 @@ class TerminalReporter:
else: else:
info = event.colitem.repr_metainfo() info = event.colitem.repr_metainfo()
line = info.verboseline(basedir=self.curdir) + " " line = info.verboseline(basedir=self.curdir) + " "
#self.write_ensure_prefix(line, word, **markup) if not hasattr(event, 'node'):
self.ensure_newline() self.write_ensure_prefix(line, word, **markup)
if hasattr(event, 'node'): else:
self._tw.write("%s " % event.node.gateway.id) self.ensure_newline()
self._tw.write(word, **markup) if hasattr(event, 'node'):
self._tw.write(" " + line) self._tw.write("%s " % event.node.gateway.id)
self.currentfspath = -2 self._tw.write(word, **markup)
self._tw.write(" " + line)
self.currentfspath = -2
def pyevent_collectionreport(self, event): def pyevent_collectionreport(self, event):
if not event.passed: if not event.passed:
@ -400,9 +406,9 @@ class TestTerminal:
rep.config.bus.notify("itemtestreport", basic_run_report(item)) rep.config.bus.notify("itemtestreport", basic_run_report(item))
linecomp.assert_contains_lines([ linecomp.assert_contains_lines([
"*PASS*test_pass_skip_fail_verbose.py:2: *test_ok*", "*test_pass_skip_fail_verbose.py:2: *test_ok*PASS*",
"*SKIP*test_pass_skip_fail_verbose.py:4: *test_skip*", "*test_pass_skip_fail_verbose.py:4: *test_skip*SKIP*",
"*FAIL*test_pass_skip_fail_verbose.py:6: *test_func*", "*test_pass_skip_fail_verbose.py:6: *test_func*FAIL*",
]) ])
rep.config.bus.notify("testrunfinish", event.TestrunFinish()) rep.config.bus.notify("testrunfinish", event.TestrunFinish())
linecomp.assert_contains_lines([ linecomp.assert_contains_lines([

View File

@ -267,11 +267,16 @@ class TestGeneralUsage:
yield check, 0 yield check, 0
""") """)
result = testdir.runpytest(p1, '-v') result = testdir.runpytest(p1, '-v')
result.stdout.fnmatch_lines([
"*test_verbose_reporting.py:2: test_fail*FAIL*",
"*test_verbose_reporting.py:4: test_pass*PASS*",
"*test_verbose_reporting.py:7: TestClass.test_skip*SKIP*",
"*test_verbose_reporting.py:10: test_gen*FAIL*",
])
assert result.ret == 1
result = testdir.runpytest(p1, '-v', '-n 1')
result.stdout.fnmatch_lines([ result.stdout.fnmatch_lines([
"*FAIL*test_verbose_reporting.py:2: test_fail*", "*FAIL*test_verbose_reporting.py:2: test_fail*",
"*PASS*test_verbose_reporting.py:4: test_pass*",
"*SKIP*test_verbose_reporting.py:7: TestClass.test_skip*",
"*FAIL*test_verbose_reporting.py:10: test_gen*",
]) ])
assert result.ret == 1 assert result.ret == 1

View File

@ -1,7 +1,7 @@
""" """
setup file for 'py' package based on: setup file for 'py' package based on:
https://codespeak.net/svn/py/trunk, revision=63240 https://codespeak.net/svn/py/trunk, revision=63254
autogenerated by gensetup.py autogenerated by gensetup.py
""" """
@ -34,20 +34,23 @@ http://pylib.org/contact.html
""" """
CEXTENSION = False
def main(): def main():
setup( setup(
name='py', name='py',
description='pylib and py.test: agile development and test support library', description='pylib and py.test: agile development and test support library',
long_description = long_description, long_description = long_description,
version='1.0.0a6', version='1.0.0a7',
url='http://pylib.org', url='http://pylib.org',
download_url='http://codespeak.net/py/1.0.0a6/download.html', download_url='http://codespeak.net/py/1.0.0a7/download.html',
license='MIT license', license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
author='holger krekel, Guido Wesdorp, Carl Friedrich Bolz, Armin Rigo, Maciej Fijalkowski & others', author='holger krekel, Guido Wesdorp, Carl Friedrich Bolz, Armin Rigo, Maciej Fijalkowski & others',
author_email='holger at merlinux.eu, py-dev at codespeak.net', author_email='holger at merlinux.eu, py-dev at codespeak.net',
ext_modules = [Extension("py.c-extension.greenlet.greenlet", ext_modules = CEXTENSION and
["py/c-extension/greenlet/greenlet.c"]),], [Extension("py.c-extension.greenlet.greenlet",
["py/c-extension/greenlet/greenlet.c"]),]
or [],
entry_points={'console_scripts': ['py.cleanup = py.cmdline:pycleanup', entry_points={'console_scripts': ['py.cleanup = py.cmdline:pycleanup',
'py.countloc = py.cmdline:pycountloc', 'py.countloc = py.cmdline:pycountloc',