[issue9131] test_set_reprs in test_pprint is fragile

2010-09-21 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

Committed in r84961

--
stage: patch review - committed/rejected
status: open - closed
type:  - behavior
versions:  -Python 3.3

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-22 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
assignee: rhettinger - stutzbach

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-20 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

How do we mark a test as implementation specific?  Is there a decorator for 
that?

--

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-20 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

Nevermind, I found it: @support.cpython_only

I'll work on a patch to add the decorator and a comment about why the test is 
fragile.

--

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-20 Thread Daniel Stutzbach

Changes by Daniel Stutzbach dan...@stutzbachenterprises.com:


--
keywords: +needs review, patch
resolution:  - accepted
stage: needs patch - patch review
Added file: http://bugs.python.org/file18591/issue9131.patch

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-20 Thread Daniel Stutzbach

Changes by Daniel Stutzbach dan...@stutzbachenterprises.com:


Removed file: http://bugs.python.org/file18591/issue9131.patch

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-20 Thread Daniel Stutzbach

Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:

errr... ignore that first patch (now deleted)

:-)

--
Added file: http://bugs.python.org/file18592/issue9131.patch

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-20 Thread Daniel Stutzbach

Changes by Daniel Stutzbach dan...@stutzbachenterprises.com:


Removed file: http://bugs.python.org/file18592/issue9131.patch

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-08-20 Thread Daniel Stutzbach

Changes by Daniel Stutzbach dan...@stutzbachenterprises.com:


Added file: http://bugs.python.org/file18593/issue9131.patch

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-06-30 Thread Daniel Stutzbach

New submission from Daniel Stutzbach dan...@stutzbachenterprises.com:

test_set_reprs in test_pprint creates a complex arrangement of frozensets and 
tests the pretty-printed repr against a string hard-coded in the test.  The 
hard-coded repr depends on the sort order of frozensets.  

However, Since sets only define partial ordering (subset relationships), the 
output of the list.sort() method is undefined for lists of sets. (quoting 
http://docs.python.org/release/3.1/library/stdtypes.html#set-types-set-frozenset)

In a nutshell, the test assumes frozenset({0}) will always sort before 
frozenset({1}), but:

 frozenset({0})  frozenset({1})
False
 frozenset({1})  frozenset({0})
False

Consequently, this test is fragile.  Small changes to Python's sort algorithm 
cause the test to fail when it should pass.

I ran into this while playing with optimizations to the sort function, but I 
imagine other Python implementations will also run into trouble with this test.

--
assignee: stutzbach
components: Tests
messages: 109008
nosy: stutzbach
priority: low
severity: normal
stage: needs patch
status: open
title: test_set_reprs in test_pprint is fragile
versions: Python 3.2, Python 3.3

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-06-30 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I agree that this looks a bit suspicious.

Adding Raymond to the nosy list, since it looks like this is his code (r60264).

--
nosy: +mark.dickinson, rhettinger

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-06-30 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Yes, it's a fragile and crummy test.
Feel free to delete it.

--

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



[issue9131] test_set_reprs in test_pprint is fragile

2010-06-30 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

After discussion on #python-dev, have decided to mark the test as 
implementation specific and add a comment about why the test is fragile.

--
assignee: stutzbach - rhettinger

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