The Artima Developer Community
Sponsored Link

Python Buzz Forum
DataTest 0.2

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
DataTest 0.2 Posted: Mar 12, 2004 12:09 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: DataTest 0.2
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

DataTest 0.2 is out.

Sorry, no good website really. There are still some quirks with the test finder (and name matcher) as well. But there are some new features. From the README:

doctest Extensions

In addition to running doctest tests, DataTest modifies doctest to add a few small changes to avoid false negatives when comparing output with the expected output.

  • Because doctest doesn't allow empty lines in a test (it interprets the empty line as a separation between tests) you can instead use a single "." in place of a blank line.

  • Tracebacks can be identified with just Traceback:, you do not have to give the full Traceback (most recent call last):.

  • If the expected output begins with <, then the output and expected output are compared using htmldiff, which allows for softer comparisons. Whitespace is normalized before comparison, attributes are compared without respect to order, and ... can be used as a wildcard in many places. The full details are in the docstrings for htmldiff

  • Floats are compared for equality, not just equality of string representation, so you can use 1.4 instead of 1.3999999999999999.

  • These all make the doctest examples a little less accurate, but they make them easier to write without going into every detail.

    Utilities

    DataTest includes a couple of utilities to make debugging you code easier. These are contained in the datatest.util package.

    datatest.util.dictdiff compares two dictionaries and if they don't match it displays a per-key comparison. You can provide various wildcards in one of the dictionaries (the "pattern", i.e., the expected output). See the doc strings for more.

    datatest.util.htmldiff compares two HTML fragments. It ignores whitespace and the order of tags, in addition to allowing various wildcards. See the doc strings for more.

Read: DataTest 0.2

Topic: Python 2.3 Logging Links Previous Topic   Next Topic Topic: Revolution OS

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use