C. Titus Brown schrieb: > Sorry for the second message, but... let's compare: > > test_sort.py: > #! /usr/bin/env python > import unittest > class Test(unittest.TestCase): > def test_me(self): > seq = [ 5, 4, 1, 3, 2 ] > seq.sort() > self.assertEqual(seq, [1, 2, 3, 4, 5]) > > if __name__ == '__main__': > unittest.main() > > with > > test_sort2.py : > > def test_me(): > seq = [ 5, 4, 1, 3 2 ] > seq.sort() > assert seq == [1, 2, 3, 4, 5] > > The *only value* that unittest adds here is in the 'assertEqual' > statement, which (I think) returns a richer error message than 'assert'. If you use py.test, it does some magic to find out your test is an equality comparison and displays both operands' repr(). Don't know about nose. Georg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4