Python Programming Techniques

Testing Python Programs

Copyright 2010 by Stephen Vermeulen
Last updated: 2010 Oct 20
Working with UNICODE in Python

106 actual alternative analysis attempt aug author bring calls cellspacing d7 dec driven easy examples experience fail feb feed follow garbage global graph graphs head https ibm intro javascript mar medium mentioned mg n nov nz objects oct points post produces recent required thoughts title tools topic tracking tree unicode updated visual voidspace wants wordpress
Various tools and libraries exist to help in the process of testing Python programs.

  • 2010-Oct-20: The Sikuli project is a GUI automation tool which uses image recognition software to guide its mouse movements. It produces Python scripts to run a series of GUI tasks. Xpresser is another attempt to do something similar. Setting the turtle free with Sikuli uses Sikuli to drive a turtle across your desktop. [9124] [1]
  • 2010-May-31: A review of the Python Testing Beginner's Guide by Daniel Arbuckle ISBN: 1847198848. [9157]
  • 2010-Apr-30: PyWinAuto, automate Win32 GUI testing with Python scripts. This is now on PyPI here. Some recent news about this from the author. [136] [1]
  • 2009-Nov-20: How to grab control of a running Python program and attach a debugger to it. More on how to use the Python debugger. [8356]
  • 2009-Oct-13: (mentioned here) is a module to script driven Windows GUI testing. This has since been surpassed by things like watsup and pywinauto. [8627] [1]
  • 2009-Sep-21: An introduction to using the unittest testing framework. [8541]
  • 2009-Jul-04: A simple approach to creating fake words, create some random syllables and then string a few of them together. Could be used to create your next product brand name. [8232]
  • 2009-Jun-25: pudb is a full-screen, console-based Python debugger. [8197]
  • 2009-Jun-23: winappdbg is an application debugging scripting engine. This allows one to write debug control scripts in Python. [8186]
  • 2009-Jun-23: The guppy Python programming environment includes support for testing and heap analysis. [8181]
  • 2009-Jun-12: turtl is an HTTP proxy that can be used to throttle connections to specific host names to avoid breaking terms of usage. [8136]
  • 2009-Apr-08: testharness is a generic functional test framework. [7847]
  • 2009-Feb-03: foxtrot helps you to find undefined variables in Python code. [7527]
  • 2008-Dec-14: Hunting memory leaks in Python talks about tracking down a memory leak caused by unintended global references keeping things alive (this sort of issue is really easy to hit in Java). This article uses the Graphviz utility to make a graph of all the objects currently being tracked by the Python garbage collector and then visual inspection can be used to find unexpected references that are causing problems. The author follows this up with another article that talks about how he used the gc and inspect modules to obtain the information from the garbage collector - a rather helpful discussion of this rather esoteric topic. Further discussion of object graphs using graphviz. Another problem is finding leaks in extension modules called from Python, for this something like Valgrind can be used. [6335]
  • 2008-Dec-11: Ian Bicking suggests that lxml is a good alternative to BeautifulSoup for web scraping tasks. He also has some short examples including an HTML diff. [7336] [1] [2]
  • 2008-Dec-11: pympler is a development tool to measure, monitor and analyze the memory behavior of Python objects in a running Python application. [7335]
  • 2008-Dec-03: Narrative tests are lousy unit tests argues the case that narrative styles tests, while useful for an acceptance test activity should not replace unit tests as when they fail they make it hard to pinpoint the cause of failure. This article sparked a bit of discussion with follow up here On narrative doctests and here with tests are code, doctests aren't. More thoughts on The One True Testing Approach and the lack thereof. More on this in: things I don't like about doctest. And another view on doctests. [7067]
  • 2008-Nov-28: A framework for automated GUI testing from Python using the Win32 API. [7277]
  • 2008-Nov-28: WATSUP is a Windows Application Test System Using Python. It can be used to start, stop, control and inspect a Windows application through a Python testing script allowing one to write unit and functional test sequences. This uses SendKeys for some of its functionality (note the examples need updating for Windows Vista). [7276] [1]
  • 2008-Nov-28: Functional Testing of Desktop Applications cites this article on testing desktop applications with IronPython. [7179]
  • 2008-Oct-30: paver is a combined build, distribution and deployment tool written in Python for software projects. This is about to be integrated with pytoss which uses Paramiko under its hood. [7123]
  • 2008-Oct-18: Profiling Python code. [7046]
  • 2008-Oct-04: How to find new or unreclaimed objects between two points in your Python code. [6985] [1]
  • 2008-Sep-28: Talk about tracking down a memory leak in a Django web server, turns out it was difficult to replicate without the correct data set. [6941]
  • 2008-Sep-14: mechanize provides stateful programmatic web browsing which would be useful for both testing and screen scraping type applications. [6853]
  • 2008-Sep-11: windmill is a testing framework for AJAX Web UI systems. It gets recommended here. [6835]
  • 2008-Aug-26: Profiling Python code can be done with the profile or hotshot modules, this article combines the hotshot module with nose tests and gprof2dot to make tree diagrams that show where the time is being spent in your program. [6740]
  • 2008-Aug-07: Snarl by TCP is a tool for displaying notifications from applications, like Growl. [6648]
  • 2008-Jul-16: Simulating user input (such as mouse clicks and key presses) to the Win32 GUI from IronPython using an external DLL to access the appropriate Win32 functions. [6530] [1]
  • 2008-Jun-12: python-spidermonkey is a package that allows for the implementation of JavaScript code in Python, this could be useful in the automatic testing of websites that use JavaScript. [6330]
  • 2008-Apr-14: More praise for a test driven development methodology with examples drawn from the Resolver One project's experience. [5797]
  • 2008-Apr-14: Pylot is a testing system for web applications, it has a test case recorder that can log HTML requests made by your browser as you navigate a site. [5796]
  • 2008-Apr-11: Delving into the Python bytecode could be useful in testing code coverage. It makes sense for the capabilities to support this to be in place already becasue they would be required by the Python debugger. [5767]
  • 2008-Mar-26: Starting with twill, nosetests and easy_install a few ShowMeDo screen casts. [5335]
  • 2008-Mar-14: Notes on agile web testing in Python from the 2008 PyCon. This also includes a discussion of the hierarchy of tests and the kinds of tests one might do. [5279]
  • 2008-Feb-25: pycoco is a code coverage tool for Python programs. [5156]
  • 2008-Jan-16: The question is asked: < href="">Do you use a python code analyzer? There are some links here to various code analysis tools that might be useful. [4712]
  • 2008-Jan-09: Chasing memory leaks in Python applications. [4625]
  • 2007-Dec-14: Profiling PyPy Python programs using Valgrind. [4427]
  • 2007-Dec-12: mocker (home page) is a platform for test doubles in Python. [4418]
  • 2007-Dec-10: pycallgraph generates an actual usage call graph based on data collected from a run of your application. [4405]
  • 2007-Oct-05: How to go about testing code that calls third party servers? [2606]
  • 2007-Aug-26: A taxonomy of testing tools for Python, worth a read. [213]
  • 2007-Aug-24:, some sort of code coverage tool [214]
  • 2007-Aug-24: A look at the current (Nov'05) state of testing software in the Python world [212]
  • 2007-Aug-24: Testing frameworks for Python [211]
  • 2007-Aug-24: Using Python to do unit testing, including testing GUIs [210]

              back to home