Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-08-13 Thread Scott David Daniels
Ben Finney wrote: Michael Foord <[EMAIL PROTECTED]> writes: The full list of changes proposed […] and not shot down was something like: […] assertLessThan assertGreaterThan assertLessThanOrEquals assertGreaterThanOrEquals […] "Brett Cannon" <[EMAIL PROTECTED]> writes: Is any

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-16 Thread Scott David Daniels
Ben Finney wrote: Scott David Daniels <[EMAIL PROTECTED]> writes:> I would rather something more like: def assert_compare_true(op, first, second, msg=None): if op(first, second): return raise self.failure_exception(msg) if msg is None:

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module (version 0.5)

2008-07-16 Thread Georg Brandl
Ben Finney schrieb: Significant changes: targeting Python 3.1, removal of separate {lt,gt,le,ge} comparison tests, implementation of enhanced-information failure message, reference to BDFL pronouncement. I won't be working on this further; someone else should feel free to champion this further i

[Python-Dev] PEP: Frequently-requested additional features for the `unittest` module (version 0.5)

2008-07-16 Thread Ben Finney
Significant changes: targeting Python 3.1, removal of separate {lt,gt,le,ge} comparison tests, implementation of enhanced-information failure message, reference to BDFL pronouncement. I won't be working on this further; someone else should feel free to champion this further if they wish. :PEP:

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-16 Thread Nick Coghlan
Ben Finney wrote: Do you perhaps mean something like this:: def assert_compare_true(op, first, second, msg=None): fail_detail = "%(first)r %(op)r %(second)r" % vars() if msg is None: msg = fail_detail else: msg = "%(fail_detail)s: %(msg)s" % va

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-16 Thread Ben Finney
Scott David Daniels <[EMAIL PROTECTED]> writes: > I would rather something more like: > > def assert_compare_true(op, first, second, msg=None): > if op(first, second): > return > raise self.failure_exception(msg) > if msg is None: >

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-16 Thread Ben Finney
Michael Foord <[EMAIL PROTECTED]> writes: > I'm inclined to agree. It was part of a set of additions suggested > by Guido. From here I think (as part of the unittest extensions that > google maintains): > > http://mail.python.org/pipermail/python-dev/2008-April/078702.html > > I've used tests li

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-16 Thread Scott David Daniels
Ben Finney wrote: ... def assert_compare_true(op, first, second, msg=None): if msg is None: msg = "%(first)r %(op)r %(second)" % vars() if not op(first, second): raise self.failure_exception(msg) I would rather something more like

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-16 Thread Michael Foord
Brett Cannon wrote: On Tue, Jul 15, 2008 at 7:05 PM, Ben Finney <[EMAIL PROTECTED]> wrote: Scott Dial <[EMAIL PROTECTED]> writes: Why [introduce redundant test names]? assert_not_less_than = assert_greater_than_or_equal assert_not_greater_than = assert_less_than_or_equal assert_not_le

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-16 Thread Ben Finney
Scott Dial <[EMAIL PROTECTED]> writes: > I would argue to go even further: > > assertEqual = assert_eq > assertAlmostEqual = assert_almost_eq > assertNotEqual = assert_ne > assertNotAlmostEqual = assert_almost_ne > > I'm not sure if there are others, but using the same abbreviations > from opera

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-15 Thread Ben Finney
Significant changes: Add a new 'TestLoader.load_tests_from_collection' method, with full reference implementation. This makes the 'run_tests' reference implementation straightforward. :PEP: XXX :Title: Frequently-requested additional features for the `unittest` module :Version:

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-15 Thread Ben Finney
Michael Foord <[EMAIL PROTECTED]> writes: > The full list of changes proposed […] and not shot down was > something like: […] >assertLessThan >assertGreaterThan >assertLessThanOrEquals >assertGreaterThanOrEquals […] "Brett Cannon" <[EMAIL PROTECTED]> writes: > Is any of this rea

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-15 Thread Scott Dial
Ben Finney wrote: Scott Dial <[EMAIL PROTECTED]> writes: Why [introduce redundant test names]? To answer the question: The above tests are logically equivalent, but the failure message would be different, reporting failure in terms of what the caller wanted to test. I can see how this argum

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-15 Thread Brett Cannon
On Tue, Jul 15, 2008 at 7:05 PM, Ben Finney <[EMAIL PROTECTED]> wrote: > Scott Dial <[EMAIL PROTECTED]> writes: > >> Why [introduce redundant test names]? >> >> assert_not_less_than = assert_greater_than_or_equal >> assert_not_greater_than = assert_less_than_or_equal >> assert_not_less_than_or_equa

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-15 Thread Ben Finney
Scott Dial <[EMAIL PROTECTED]> writes: > Why [introduce redundant test names]? > > assert_not_less_than = assert_greater_than_or_equal > assert_not_greater_than = assert_less_than_or_equal > assert_not_less_than_or_equal = assert_greater_than > assert_not_greater_than_or_equal = assert_less_than

Re: [Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-15 Thread Scott Dial
Ben Finney wrote: New condition tests --- def assert_less_than(first, second, msg=None): op = operator.lt self.assert_compare_true(op, first, second, msg) def assert_greater_than(first, second, msg=None): op = operator.gt

[Python-Dev] PEP: Frequently-requested additional features for the `unittest` module

2008-07-15 Thread Ben Finney
:PEP: XXX :Title: Frequently-requested additional features for the `unittest` module :Version: 0.3 :Last-Modified: 2008-07-16 :Author:Ben Finney <[EMAIL PROTECTED]> :Status:Draft :Type: Standards Track :Content-Type: test/x-rst :Requires: PEP