Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7210] Proposed Syntax Checks in Test Suite

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Oct 26, 2009, 12:40 PM

Post #1 of 16 (508 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite

New submission from Chuck Rhode <CRhode [at] LacusVeris>:

PythonTidy is a code beautifier written three years ago and downloaded
numerous times.

o http://lacusveris.com/PythonTidy/PythonTidy.python

It suffers a bug, which has only recently come to light. It considers
the following lines equivalent:

if False is (2 is 3): pass

if False is 2 is 3: pass

They're not. PythonTidy handles other non-associative operators such as
division correctly. I was unable to generalize from arithmetic
operators to comparison operators because the Abstract Syntax Tree (AST)
generated by the *compiler* module returns a different structure for them.

I tested PythonTidy by running the Python Test Suite (the *test* module
scripts) through it and executing the results, thought I had all my
bases covered because most tests succeeded, and missed this case, so I
am suggesting an amplification of the Python Test Suite for developers
who may be using it for purposes other than testing Python.

I wish to add these lines to the foot of *test_grammar.py*.

verify(16 // (4 // 2) == 8, '16 // (4 // 2) == 8')
verify((16 // 4) // 2 == 2, '(16 // 4) // 2 == 2')
verify(16 // 4 // 2 == 2, '16 // 4 // 2 == 2')
verify((False is (2 is 3)) == True, '(False is (2 is 3)) == True')
verify(((False is 2) is 3) == False, '(((False is 2) is 3) == False')
verify((False is 2 is 3) == False, '(False is 2 is 3) == False')

----------
components: Tests
files: test_grammar.patch
keywords: patch
messages: 94501
nosy: ChuckRhode
severity: normal
status: open
title: Proposed Syntax Checks in Test Suite
type: feature request
versions: Python 2.5
Added file: http://bugs.python.org/file15206/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 1:16 PM

Post #2 of 16 (496 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Benjamin Peterson <benjamin [at] python> added the comment:

Please provided a unified diff against the trunk.

----------
nosy: +benjamin.peterson

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 4:14 PM

Post #3 of 16 (505 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Chuck Rhode <CRhode [at] LacusVeris> added the comment:

You mean like this?

----------
Added file: http://bugs.python.org/file15209/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 4:17 PM

Post #4 of 16 (500 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Changes by Chuck Rhode <CRhode [at] LacusVeris>:


Removed file: http://bugs.python.org/file15209/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 4:23 PM

Post #5 of 16 (496 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Changes by Chuck Rhode <CRhode [at] LacusVeris>:


Removed file: http://bugs.python.org/file15206/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 4:25 PM

Post #6 of 16 (489 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Chuck Rhode <CRhode [at] LacusVeris> added the comment:

Well, the last two patch files weren't very good, but I hope the third
time's the charm.

----------
Added file: http://bugs.python.org/file15210/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 4:27 PM

Post #7 of 16 (488 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Benjamin Peterson <benjamin [at] python> added the comment:

That still looks like it's against Python 2.5.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2009, 11:18 AM

Post #8 of 16 (480 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Chuck Rhode <CRhode [at] LacusVeris> added the comment:

Yet another patch file....

----------
Added file: http://bugs.python.org/file15213/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 28, 2009, 2:02 PM

Post #9 of 16 (477 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Benjamin Peterson <benjamin [at] python> added the comment:

Please just add your test case to the bottom of the trunk...

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 29, 2009, 7:50 PM

Post #10 of 16 (462 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Changes by Chuck Rhode <CRhode [at] LacusVeris>:


Removed file: http://bugs.python.org/file15213/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 29, 2009, 7:51 PM

Post #11 of 16 (463 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Chuck Rhode <CRhode [at] LacusVeris> added the comment:

Sorry I'm having so much trouble with this patch. Here's another.
Thanks for your patience. -ccr-

----------
Added file: http://bugs.python.org/file15231/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 30, 2009, 3:19 PM

Post #12 of 16 (456 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Benjamin Peterson <benjamin [at] python> added the comment:

See how all the other tests in test_grammar are written in a unittest style?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 30, 2009, 8:36 PM

Post #13 of 16 (464 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Changes by Chuck Rhode <CRhode [at] LacusVeris>:


Removed file: http://bugs.python.org/file15231/test_grammar.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 30, 2009, 8:40 PM

Post #14 of 16 (458 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Chuck Rhode <CRhode [at] LacusVeris> added the comment:

Oh! That's very different. :-)

I can do that.

----------
Added file: http://bugs.python.org/file15237/test_grammar_trunk.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 30, 2009, 8:56 PM

Post #15 of 16 (453 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Benjamin Peterson <benjamin [at] python> added the comment:

Applied with some changes in r75971.

----------
resolution: -> accepted
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 31, 2009, 7:09 AM

Post #16 of 16 (451 views)
Permalink
[issue7210] Proposed Syntax Checks in Test Suite [In reply to]

Chuck Rhode <CRhode [at] LacusVeris> added the comment:

Thanks. -ccr-

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.