Georg Brandl
a4f46e1292
Remove unused imports in test modules.
2010-02-07 17:03:15 +00:00
Ezio Melotti
b0f5adc3f4
use assert[Not]IsInstance where appropriate
2010-01-24 16:58:36 +00:00
Alexandre Vassalotti
b646547bb4
Issue #2333 : Backport set and dict comprehensions syntax.
2010-01-11 22:36:12 +00:00
Alexandre Vassalotti
ee936a2130
Issue #2335 : Backport set literals syntax from Python 3.x.
2010-01-09 23:35:54 +00:00
Benjamin Peterson
a4a04d1a89
fix test_parser from tokenizer tweak
2009-12-06 21:24:30 +00:00
Benjamin Peterson
e36199b49d
fix several compile() issues by translating newlines in the tokenizer
2009-11-12 23:39:44 +00:00
Georg Brandl
944f684ce6
Allow multiple context managers in one with statement, as proposed
...
in http://codereview.appspot.com/53094 and accepted by Guido.
The construct is transformed into multiple With AST nodes so that
there should be no problems with the semantics.
2009-05-25 21:02:56 +00:00
Georg Brandl
fe879e8a23
#4529 : fix parser's validation for try-except-finally statements.
2008-12-05 12:09:41 +00:00
Benjamin Peterson
9dfe6a8862
#4396 make the parser module correctly validate the with syntax
2008-11-24 04:09:03 +00:00
Benjamin Peterson
6624a9fddd
#4048 make the parser module accept relative imports as valid
2008-11-03 15:14:51 +00:00
Benjamin Peterson
dcee09d920
make sure the parser flags and passed onto the compiler
...
This fixes "from __future__ import unicode_literals" in an exec statment
See #4225
2008-10-31 02:16:05 +00:00
Benjamin Peterson
bd6a05fe81
check that the parser module can handle the new keyword syntax
2008-08-19 22:06:11 +00:00
Martin v. Löwis
66e2663eba
Note that the stderr output of the test is intentional.
2008-03-18 13:16:05 +00:00
Facundo Batista
fc2d01032f
Issue 1881. Increased the stack limit from 500 to 1500. Also added
...
a test for this (and because of this test you'll see in stderr a
message that parser.c sends before raising MemoryError).
Thanks Ralf Schmitt.
2008-02-23 12:01:13 +00:00
Guido van Rossum
b6ac23cd07
SF patch# 1755885 by Kurt Kaiser: show location of Unicode escape errors.
...
(Slightly tweaked for style and refcounts.)
2007-07-18 17:19:14 +00:00
Tim Peters
147f9ae6db
Whitespace normalization.
2006-08-25 22:05:39 +00:00
Jeremy Hylton
60e96f666c
Expose column offset information in parse trees.
2006-08-22 20:46:00 +00:00
Neal Norwitz
d3a9162e5e
Add another little test to make sure we roundtrip multiple list comp ifs ok.
...
Add tests for generator expressions too.
2006-04-12 05:27:46 +00:00
Jeremy Hylton
3e0055f8c6
Merge ast-branch to head
...
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.
The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
2005-10-20 19:59:25 +00:00
Phillip J. Eby
0d6615fd29
PEP 342 implementation. Per Guido's comments, the generator throw()
...
method still needs to support string exceptions, and allow None for the
third argument. Documentation updates are needed, too.
2005-08-02 00:46:46 +00:00
Tim Peters
e890682e52
Whitespace normalization.
2005-04-20 17:45:13 +00:00
Brett Cannon
f4189916e3
Flush out support for ``class B(): pass`` syntax by adding support to the
...
'parser' module and 'compiler' package.
Closes patch #1176012 . Thanks logistix.
2005-04-09 02:30:16 +00:00
Anthony Baxter
1a4ddaecc7
SF patch #1007189 , multi-line imports, for instance:
...
"from blah import (foo, bar
baz, bongo)"
2004-08-31 10:07:13 +00:00
Anthony Baxter
c2a5a63654
PEP-0318, @decorator-style. In Guido's words:
...
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728 .
2004-08-02 06:10:11 +00:00
Raymond Hettinger
354433a59d
SF patch #872326 : Generator expression implementation
...
(Code contributed by Jiwon Seo.)
The documentation portion of the patch is being re-worked and will be
checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's
rationale for the design decisions on binding behavior (as described in
in his patch comments and in discussions on python-dev).
The test file, test_genexps.py, is written in doctest format and is
meant to exercise all aspects of the the patch. Further additions are
welcome from everyone. Please stress test this new feature as much as
possible before the alpha release.
2004-05-19 08:20:33 +00:00
Walter Dörwald
21d3a32b99
Combine the functionality of test_support.run_unittest()
...
and test_support.run_classtests() into run_unittest()
and use it wherever possible.
Also don't use "from test.test_support import ...", but
"from test import test_support" in a few spots.
From SF patch #662807 .
2003-05-01 17:45:56 +00:00
Tim Peters
f2715e0764
Whitespace normalization.
2003-02-19 02:35:07 +00:00
Neal Norwitz
9caf9c040e
Add tests and news entry about parser errors from bug #678518 .
2003-02-10 01:54:06 +00:00
Michael W. Hudson
5e83b7a9cc
Teach the parsermodule about floor division. Fixes
...
[ 676521 ] parser module validation failure
bugfix candidate.
2003-01-29 14:20:23 +00:00
Guido van Rossum
32c2ae7f4a
Standardize behavior: no docstrings in test functions.
2002-08-22 19:45:32 +00:00
Barry Warsaw
04f357cffe
Get rid of relative imports in all unittests. Now anything that
...
imports e.g. test_support must do so using an absolute package name
such as "import test.test_support" or "from test import test_support".
This also updates the README in Lib/test, and gets rid of the
duplicate data dirctory in Lib/test/data (replaced by
Lib/email/test/data).
Now Tim and Jack can have at it. :)
2002-07-23 19:04:11 +00:00
Tim Peters
496563a514
Remove some now-obsolete generator future statements.
...
I left the email pkg alone; I'm not sure how Barry would like to handle
that.
2002-04-01 00:28:59 +00:00
Fred Drake
2e2be3760c
Change the PyUnit-based tests to use the test_main() approach. This
...
allows using the tests with unittest.py as a script. The tests will
still run when run as a script themselves.
2001-09-20 21:33:42 +00:00
Fred Drake
6e4f2c09df
Use the "st" versions of the "ast" calls in the parser module -- there is
...
no reason to pretend the syntax trees we're dealing with are abstract.
2001-07-17 19:33:25 +00:00
Fred Drake
cf580c7ea1
Added tests for the new yield support in the parser module.
...
(Should be merged with descr branch.)
2001-07-17 03:01:29 +00:00
Fred Drake
58422e5820
Convert the parser module test to use PyUnit.
2001-06-04 03:56:24 +00:00
Fredrik Lundh
f785042433
a bold attempt to fix things broken by MAL's verify patch: import
...
'verify' iff it's used by a test module...
2001-01-17 21:51:36 +00:00
Marc-André Lemburg
3661908a6a
This patch removes all uses of "assert" in the regression test suite
...
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 19:11:13 +00:00
Fred Drake
e3fb18c1c4
Add more regression tests, including for the import statement variations.
...
These will detect regression on SF bug #127271 and other import statement
bugs.
2001-01-07 06:02:19 +00:00
Fred Drake
e1578ce204
Added tests to avoid regression on bug #125375 .
...
roundtrip(): Show the offending syntax tree when things break; this makes
it a little easier to debug the module by adding test cases.
(Still need better tests for this module, but there's not enough time
today.)
2000-12-11 22:12:09 +00:00
Fred Drake
28f739aad4
Update the parser module to support augmented assignment.
...
Add some test cases.
2000-08-25 22:42:40 +00:00
Fred Drake
79ca79d1a9
Add a minimal test suite for the parser module.
2000-08-21 22:30:53 +00:00