Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.165.006 Times

unittest2 0.5.0

Company: Michael Foord
Date Added: September 20, 2013  |  Visits: 421

unittest2

Report Broken Link
Printer Friendly Version


Product Homepage
Download (41 downloads)



The new features in unittest for Python 2.7 backported to Python 2.3+.<br /><br />unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.7.<br /><br />Thanks to Mark Roddy, there is also a version of for Python 2.3. This is maintained as a separate branch and is a separate download.<br /><br />To use unittest2 instead of unittest simply replace import unittest with import unittest2.<br /><br />unittest2 is maintained in a mercurial repository. The issue tracker is on google code:<br /><br /> * unittest2 hg<br /> * unittest2 issue tracker<br /> * Article / Docs: New features in unittest.<br /><br />Classes in unittest2 derive from the appropriate classes in unittest, so it should be possible to use the unittest2 test running infrastructure without having to switch all your tests to using unittest2 immediately. Similarly you can use the new assert methods on unittest2.TestCase with the standard unittest test running infrastructure. Not all of the new features in unittest2 will work with the standard unittest test loaders, runners result objects however.<br /><br />New features include:<br /><br /> * addCleanups - better resource management<br /> * many new assert methods including better defaults for comparing lists, sets, dicts unicode strings etc and the ability to specify new default methods for comparing specific types<br /> * assertRaises as context manager, with access to the exception afterwards<br /> * test discovery and new command line options (including failfast and better handling of ctrl-C during test runs)<br /> * class and module level fixtures: setUpClass, tearDownClass, setUpModule, tearDownModule<br /> * test skipping and expected failures<br /> * new delta keyword argument to assertAlmostEqual for more useful comparison and for comparing non-numeric objects (like datetimes)<br /> * load_tests protocol for loading tests from modules or packages<br /> * startTestRun and stopTestRun methods on TestResult<br /> * various other API improvements and fixes<br /><br />Note<br /><br />Command line usage<br /><br />In Python 2.7 you invoke the unittest command line features (including test discover) with python -m unittest <args>. As unittest is a package, and the ability to invoke packages with python -m ... is new in Python 2.7, we can't do this for unittest2.<br /><br />Instead unittest2 comes with a script unit2. Command line usage:<br /><br />unit2 discover<br />unit2 -v test_module<br /><br />There is also a copy of this script called unit2.py, useful for Windows which uses file-extensions rather than shebang lines to determine what program to execute files with. Both of these scripts are installed by distutils.<br /><br />Until I write proper documentation, the best information on all the new features is the development version of the Python documentation for Python 2.7:<br /><br /> * http://docs.python.org/dev/library/unittest.html<br /><br />Look for notes about features added or changed in Python 2.7.<br /><br />Note<br /><br />unittest2 is already in use for development for development of distutils2.<br /><br />Version 0.5.0 of unittest2 has feature parity with unittest in Python 2.7 final. If you want to ensure that your tests run identically under unittest2 and unittest in Python 2.7 you should use unittest2 0.5.0.<br /><br />Later versions of unittest2 include changes in unittest made in Python 3.2 and onwards after the release of Python 2.7.<br />Differences<br /><br />Differences between unittest2 and unittest in Python 2.7:<br /><br />assertItemsEqual does not silence Py3k warnings as this uses warnings.catch_warnings() which is new in Python 2.6 (and is used as a context manager which would be a pain to make work with Python 2.4).<br /><br />The underlying dictionary storing the type equality functions on TestCase is a custom object rather than a real dictionary. This allows TestCase instances to be deep-copyable on Python versions prior to 2.7.<br /><br />TestCase.longMessage defaults to True because it is better. It defaults to False in Python 2.7 for backwards compatibility reasons.<br /><br />python -m package doesn't work in versions of Python before Python 2.7. The command line features of unittest2 are provided by a unit2 (and unit2.py) script instead.<br /><br />unittest2 includes a very basic setuptools compatible test collector. Specify test_suite = 'unittest2.collector' in your setup.py. This starts test discovery with the default parameters from the directory containing setup.p, so it is perhaps most useful as an example (see unittest2/collector.py).<br />Issues<br /><br />A TestResult object with unexpected successes returns True for result.wasSuccessful(). Difficult to know if this is the correct behaviour or not.<br /><br />If a dotted path name is used for test discovery then a globally installed module/package will still be used in preference of one in the current directory. When doing discovery from a dotted path name we could check for this specific case.<br /><br />The removeHandler decorator could also be a context manager.<br /><br />Issue 8313:, <unprintable Assertionerror object> message in unittest tracebacks, is hard to fix in versions of Python before 2.7. The fix in Python 2.7 relies on changes to both the traceback module and traceback objects. As the issue is rare I am leaving it unfixed in unittest2.<br /><br />There are several places in unittest2 (and unittest) that call str(...) on exceptions to get the exception message. This can fail if the exception was created with non-ascii unicode. This is rare and I won't address it unless it is actually reported as a problem for someone.<br /><br />A comparison of text or long sequences (using assertSequenceEqual or assertMultiLineEqual etc) can take a long time to generate diffs for failure messages. These methods use prettyprint and difflib.<br /><br /><br />unittest2-0.5.0.tar.gz#md5=24fb07f69bbd0da1c86b759fded839fd

Requirements: No special requirements
Platforms: *nix, Linux
Keyword: Command Comparing Context Defaults Development Discovery Features Including Issue Methods Objects Python Script Tests Unittest Versions
Users rating: 0/10

License: Freeware Size: 61.44 KB
USER REVIEWS
More Reviews or Write Review


UNITTEST2 RELATED
Blog  -  bloggeruniverse 1.0
bloggeruniverse, a blogging system written in PHP that has many features including RSS, theming, a user system, logging, and blog settings. The blog also allows the administrator to change the messages displayed to users by using the...
92.16 KB  
Utilities  -  IndiFTPD 1.0.9_beta
IndiFTPD is a standalone (single executable) command line FTP server with many adv features (including SSL). It is written in C++ and supports Windows, Linux, Solaris, and FreeBSD. IndiFTPD is designed around a core server which can be easily...
716.8 KB  
Programming  -  OMake 0.9.8.5
OMake is a build system with a similar style and syntax to GNU make but with many additional features, including support for large projects spanning multiple directories, default configuration files simplifying the standard compilation tasks,...
2.8 MB  
Shell Enhancements  -  WOW64Menu 1.0.0
WOW64Menu allows using shell context menu of 32-bit applications on x64 editions of Windows. It adds "Show WOW64 Menu" command to context menu of objects on Desktop and in Windows Explorer. When choosing this command a new context menu including...
300.9 KB  
Networking Tools  -  WinPcap 4. 1. 2002
WinPcap is the industry-standard tool for link-layer network access in Windows environments: it allows applications to capture and transmit network packets bypassing the protocol stack, and has additional useful features, including kernel-level...
922 KB  
Miscellaneous  -  YW Guestbook 1.45
YW Guestbook is a guest book with tons of features, including the ability to sign and read. There are templates for it to customize the looks, and an administrator panel. Admin can make a censored word list and decide what form fields to use.
512 KB  
Automotive Information Databases  -  EMS SQL Manager for Oracle Freeware 2.4
EMS SQL Manager for Oracle Freeware is a high performance database tool for Oracle database development and administration. SQL Manager for Oracle works with any Oracle versions from 8.1.7 to the newest one and supports the latest Oracle Database...
40.47 MB  
Security Tools  -  Desktop Patrol 2.0 B1.1
Desktop Patrol is a handy and simple application that allows you to restrict and block access to most of the computer's features including: access to software installation, Windows options, access to external media etc. Desktop Patrol has a simple...
2.8 MB  
Development Editors  -  vmimagemanager 0.2.2
Is a python script for managing a small cluster of libvirt virtual machines on a single host with one command using the unix command line interface. it is intended for scripted VM manipulation, by automating the task of launching and shutting...
51.2 KB  
Education  -  WordNetDT 2.5
Dictionary/Thesaurus with advanced search features, including wildcard, regular expression, anagram, scrabble and sounds like. Complex relationship searches can be made from each available word type for any given search. Results are formatted and...
806 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB