From hpk at codespeak.net Sun Apr 2 16:28:41 2006 From: hpk at codespeak.net (hpk at codespeak.net) Date: Sun, 2 Apr 2006 16:28:41 +0200 (CEST) Subject: [py-svn] r25224 - py/dist/py/execnet Message-ID: <20060402142841.9B341100C0@code0.codespeak.net> Author: hpk Date: Sun Apr 2 16:28:40 2006 New Revision: 25224 Added: py/dist/py/execnet/rsync.py - copied, changed from r24266, user/arigo/hack/misc/ftpy.py Log: add rsync script (preliminary work + an inline test) Copied: py/dist/py/execnet/rsync.py (from r24266, user/arigo/hack/misc/ftpy.py) ============================================================================== --- user/arigo/hack/misc/ftpy.py (original) +++ py/dist/py/execnet/rsync.py Sun Apr 2 16:28:40 2006 @@ -19,6 +19,7 @@ shutil.rmtree(path) def receive_directory_structure(path, relcomponents): + #print "receive directory structure", path try: st = os.lstat(path) except OSError: @@ -67,6 +68,7 @@ def send_directory_structure(path): if path.check(dir=1): subpaths = path.listdir() + print "sending directory structure", path channel.send([p.basename for p in subpaths]) for p in subpaths: send_directory_structure(p) @@ -84,7 +86,7 @@ modifiedpath = sourcedir.join(*modified_rel_path) data = modifiedpath.read() channel.send(data) - channel.waitclose(1.0) + channel.waitclose() def copy(gw, source, dest): channel = gw.remote_exec(""" @@ -117,7 +119,7 @@ if status is not None: assert status == str(dest) # for now channel.send(localdata) - channel.waitclose(1.0) + channel.waitclose() def setup_module(mod): From hpk at codespeak.net Sun Apr 2 16:29:17 2006 From: hpk at codespeak.net (hpk at codespeak.net) Date: Sun, 2 Apr 2006 16:29:17 +0200 (CEST) Subject: [py-svn] r25225 - py/dist/py/documentation Message-ID: <20060402142917.AB5FB100C0@code0.codespeak.net> Author: hpk Date: Sun Apr 2 16:29:16 2006 New Revision: 25225 Modified: py/dist/py/documentation/test.txt Log: some hooks for external linking Modified: py/dist/py/documentation/test.txt ============================================================================== --- py/dist/py/documentation/test.txt (original) +++ py/dist/py/documentation/test.txt Sun Apr 2 16:29:16 2006 @@ -40,6 +40,8 @@ with the current directory, and run them. Each Python test module is inspected for test methods starting with ``test_``. +.. _features: + Basic Features of ``py.test`` ============================= @@ -343,6 +345,8 @@ your setup function callable. Did we mention that lazyness is a virtue? +.. _`basicpicture`: + Collecting and running tests / implementation remarks ====================================================== From hpk at codespeak.net Sun Apr 2 16:29:59 2006 From: hpk at codespeak.net (hpk at codespeak.net) Date: Sun, 2 Apr 2006 16:29:59 +0200 (CEST) Subject: [py-svn] r25226 - py/dist/py/documentation/talk Message-ID: <20060402142959.7B715100C0@code0.codespeak.net> Author: hpk Date: Sun Apr 2 16:29:57 2006 New Revision: 25226 Modified: py/dist/py/documentation/talk/pytest-overview.txt Log: testing talk given at hp mid march Modified: py/dist/py/documentation/talk/pytest-overview.txt ============================================================================== --- py/dist/py/documentation/talk/pytest-overview.txt (original) +++ py/dist/py/documentation/talk/pytest-overview.txt Sun Apr 2 16:29:57 2006 @@ -8,23 +8,82 @@ :Authors: Holger Krekel, merlinux GmbH :Date: 13th March 2006 -Current Purposes +Intro: Benefits of Automated Testing +====================================== + +- prove that code changes actually fix a certain issue +- minimizing Time to Feedback for developers +- reducing overall Time to Market +- document usage of plugins +- tests as a means of communication +- easing entry for newcomers + +py.test Purposes & Goals =============================== -- automated cross-project testing tool +- automated cross-project open source testing tool - flexible per-project customization -- reusing extensions and test methods across projects +- reusing test methods/reporting across projects - various iterative test collection methods -- (support for) distributed testing +- support for distributed testing +- py lib is a development support library + +What is Python? +=============================== + +- easy-to-learn flexible OO high level language +- glue-language for connecting C++, Java and scripting +- used e.g. by Google for deployment/testing/implementation +- used by BIND (mainstream DNS internet server) for testing +- Jython provides Python for JVM +- IronPython provides Python for .NET +- CPython is mainstream C-based platform +- PyPy - Python in Python implementation + +Main drivers of py.test development +====================================== + +- PyPy project testing needs (part of EU project) +- needs by individual (freely contributing) projects +- at least 20 projects using py.test and py lib +- higher level innovation plans by merlinux & experts +- commercial needs +- almost three years of (non-fulltime) development + +Authors & copyrights +============================================== + +- initial: Holger Krekel, Armin Rigo +- major contributors: Jan Balster, Brian Dorsey, Grig + Gheorghiu +- many others with small patches +- MIT license -Main Features +who is merlinux? +=============================== + +- small company founded in 2004 by Holger Krekel and Laura + Creighton + +- purpose: research and development / open source technologies + +- 7 employees (no win32 experts!), 6 freelancers + +- three larger projects: + + - PyPy - next generation Python implementation + - mailwitness - digital invoicing/signatures + - provider of development servers + +- technologies: virtualization, deployment and testing + +Main Features of py.test =============================== - simplest possible ``assert`` approach - clean setup/teardown semantics - stdout/stderr capturing per test -- per-project/directory cmdline options -- many command line options (extensible) +- per-project/directory cmdline options (many predefined) - test selection support - customizable auto-collection of tests - `more features`_ ... @@ -34,15 +93,14 @@ Main User-Level entry points =============================== -- ``conftest.py`` can modify almost arbitrary testing aspects - (but it's a bit involved) - ``py.test.raises(Exc, func, *args, **kwargs)`` -- ``py.test.deprecated_call(func, *args, **kwargs)`` - ``py.test.fail(msg)`` -> fail a test - ``py.test.skip(msg)`` -> skip a test - ``py.test.ensuretemp(prefix)`` -> per-test session temporary directory +- ``conftest.py`` can modify almost arbitrary testing aspects + (but it's a bit involved) -helpful py lib features +some py lib components =============================== - ``py.execnet`` provides ad-hoc means to distribute programs @@ -75,11 +133,14 @@ Collector objects =============================== +- Collectors / Test Items form a tree +- the tree is build iteratively (driven from Sessions) +- collector tree can be viewed with ``--collectonly`` - ``run()`` returns list of (test) names or runs the test - ``join(name)`` returns a sub collector/item -- various helper methods to determine file/location +- various helper methods to e.g. determine file/location -Extensions: ReST checking +Extensions: ReST documentation checking ========================================= - `py/documentation/conftest.py`_ provides test @@ -87,7 +148,7 @@ - uses its own collector/testitem hierarchy -- invokes docutils processing, reports errors +- invokes ``docutils`` processing, reports errors Extensions: Distributed Testing ============================================== @@ -109,43 +170,29 @@ - remotely use pywinauto to automate testing of GUI work flow - interactive example ... - -History +Status of py lib =============================== -- motivation: improve on unittest.py -- ``py.test``/py.lib main tool for pypy development -- evolved into a development support library -- almost three years of (non-fulltime) development -- used by many projects -- main driving project: PyPy - new python implementation +- mostly developed on linux/OSX +- basically all tests pass on win32 as well +- but missing some win32 convenience +- some support for generation of html/ReST/PDFs reports +- py.execnet works rather reliably (pending deeper win32 testing) +- flexible configuration but sometimes non-obvious/documented + (requires understanding of internals) -Authors & copyrights -============================================== - -- initial: Holger Krekel, Armin Rigo -- major contributors: Jan Balster, Brian Dorsey, Grig - Gheorghiu -- many others with small patches -- MIT license - -possible future py.test development -============================================== +Next Steps py lib / py.test +=============================== -- refactor py.test to allow separation across gateways -- allow deeper reporting customization +- refined py.execnet distribution of programs +- more configurable and customizable reporting +- implement support for testing distribution +- explore refined win32 support +- automated collection of unittest.py based tests - make spawning processes/gateways more robust -- experiment with windows remote testing, e.g. pywinauto -- improve pypy support -- html and ReST reporters - -ideas for future py lib development -============================================== - -- generalize py.execnet mechanisms for P2P networks +- doctest support - unify logging approaches (py.log.*) -- programmatic ReST generation -- better support PyPy (main driving project) +- ... .. |bullet| unicode:: U+02022 From arigo at codespeak.net Wed Apr 12 13:57:47 2006 From: arigo at codespeak.net (arigo at codespeak.net) Date: Wed, 12 Apr 2006 13:57:47 +0200 (CEST) Subject: [py-svn] r25721 - py/dist/py/c-extension/greenlet Message-ID: <20060412115747.59B17100C2@code0.codespeak.net> Author: arigo Date: Wed Apr 12 13:57:46 2006 New Revision: 25721 Modified: py/dist/py/c-extension/greenlet/greenlet.c Log: A patch by Tim Peter about CPython's gen_throw() which applies to greenlet_throw() as well. Pointed out by Giovanni Bajo. Modified: py/dist/py/c-extension/greenlet/greenlet.c ============================================================================== --- py/dist/py/c-extension/greenlet/greenlet.c (original) +++ py/dist/py/c-extension/greenlet/greenlet.c Wed Apr 12 13:57:46 2006 @@ -594,10 +594,8 @@ /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); + if (tb == Py_None) tb = NULL; - } else if (tb != NULL && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "throw() third argument must be a traceback object"); From cfbolz at codespeak.net Tue Apr 18 17:55:09 2006 From: cfbolz at codespeak.net (cfbolz at codespeak.net) Date: Tue, 18 Apr 2006 17:55:09 +0200 (CEST) Subject: [py-svn] r25959 - py/dist/py/test/terminal Message-ID: <20060418155509.CBC8310091@code0.codespeak.net> Author: cfbolz Date: Tue Apr 18 17:55:09 2006 New Revision: 25959 Modified: py/dist/py/test/terminal/out.py Log: removing an unused import Modified: py/dist/py/test/terminal/out.py ============================================================================== --- py/dist/py/test/terminal/out.py (original) +++ py/dist/py/test/terminal/out.py Tue Apr 18 17:55:09 2006 @@ -3,8 +3,6 @@ import os import py -from py.__.execnet.channel import Channel - class Out(object): tty = False fullwidth = int(os.environ.get('COLUMNS', 80))-1 From pinard at codespeak.net Wed Apr 26 01:21:37 2006 From: pinard at codespeak.net (pinard at codespeak.net) Date: Wed, 26 Apr 2006 01:21:37 +0200 (CEST) Subject: [py-svn] r26348 - py/dist/py/documentation Message-ID: <20060425232137.740BA10087@code0.codespeak.net> Author: pinard Date: Wed Apr 26 01:21:26 2006 New Revision: 26348 Modified: py/dist/py/documentation/log.txt Log: * py/documentation/log.txt: Typo. Modified: py/dist/py/documentation/log.txt ============================================================================== --- py/dist/py/documentation/log.txt (original) +++ py/dist/py/documentation/log.txt Wed Apr 26 01:21:26 2006 @@ -173,7 +173,7 @@ with it. Now, the hierarchy of log producers establishes which consumer gets used -whenever a producer has not explicit consumer. When a log producer +whenever a producer has no explicit consumer. When a log producer has no consumer explicitly associated with it, it dynamically and recursively inherits the consumer of its parent node, that is, that node being a bit closer to the root of the hierarchy. In other words, the