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
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:
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
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:
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
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:
>
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
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
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
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
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:
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
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
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
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
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
: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
17 matches
Mail list logo