[issue20550] Use specific asserts in collections tests

2017-03-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +694

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20550] Use specific asserts in collections tests

2014-04-02 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Sorry, I don't think this makes the tests any better as all.  It is code churn 
for no benefit.

In our own code, the more specific tests risk hiding important details behind 
the abstraction (losing knowledge of what is actually tested).  For example, I 
don't like that assertIn actually does a not in test or that assertIsNot runs 
is.  In those two cases, it doesn't make a difference but does hint at the 
loss of knowledge.

Also, changing tests carries a higher set of risks than changing other code 
because there are no tests-for-the-tests.  This means that it would easy to 
accidentally break a test from testing what it is supposed to and not know 
about it.

The has a nicer error message is a vacuous promise.  The new output:

Traceback (most recent call last):
  File /Users/raymond/Documents/tmp14.py, line 10, in test_one
self.assertIs(a, b)
AssertionError: a is not b

Isn't any better than the current output:

Traceback (most recent call last):
  File /Users/raymond/Documents/tmp14.py, line 13, in test_two
self.assertTrue(a is b)
AssertionError: False is not true

Both of them show a failing is test and the first one mysteriously outputs 
is not which is technically a different operator (albeit, unimportantly so).

--
resolution:  - rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20550
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20550] Use specific asserts in collections tests

2014-02-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, sorry. Here is a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file34076/collections_tests_asserts.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20550
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20550] Use specific asserts in collections tests

2014-02-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The patch is missing.

--
assignee:  - rhettinger

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20550
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20550] Use specific asserts in collections tests

2014-02-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The proposed patch makes collections tests use more specific asserts. This will 
provide more useful failure report.

--
components: Tests
keywords: easy
messages: 210547
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use specific asserts in collections tests
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20550
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com