summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_scope.py
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Merged revisions 85562 via svnmerge fromBenjamin Peterson2010-10-161-0/+7
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85562 | benjamin.peterson | 2010-10-15 22:45:45 -0500 (Fri, 15 Oct 2010) | 1 line don't identify the toplevel namespace by name #9997 ........
* Various tests cleanup: check_warnings/check_py3k_warnings, unittest.assert* ↵Florent Xicluna2010-03-191-11/+14
| | | | and setUp/tearDown.
* use assert[Not]In where appropriateEzio Melotti2010-01-231-2/+2
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-11/+5
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-5/+11
| | | | Patch by flox
* condense with assertRaisesBenjamin Peterson2009-07-021-13/+2
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-4/+4
|
* Global statements from one function leaked into parallel functions.Jeremy Hylton2009-03-311-0/+24
| | | | | | | | | | | | | Re http://bugs.python.org/issue4315 The symbol table used the same name dictionaries to recursively analyze each of its child blocks, even though the dictionaries are modified during analysis. The fix is to create new temporary dictionaries via the analyze_child_block(). The only information that needs to propagate back up is the names of the free variables. Add more comments and break out a helper function. This code doesn't get any easier to understand when you only look at it once a year.
* don't use assert statementBenjamin Peterson2008-07-211-1/+1
|
* Issue2378: pdb would delete free variables when stepping into a class statement.Amaury Forgeot d'Arc2008-07-211-0/+18
| | | | | The problem was introduced by r53954, the correction is to restore the symmetry between PyFrame_FastToLocals and PyFrame_LocalsToFast
* Prevent a crash with nested scopes, again caused by calling Py_DECREF when ↵Amaury Forgeot d'Arc2008-02-161-0/+18
| | | | | | the pointer is still present in the containing structure.
* Do not copy free variables to locals in class namespaces.Jeremy Hylton2007-02-261-0/+33
| | | | | | | | | Fixes bug 1569356, but at the cost of a minor incompatibility in locals(). Add test that verifies that the class namespace is not polluted. Also clarify the behavior in the library docs. Along the way, cleaned up the dict_to_map and map_to_dict implementations and added some comments that explain what they do.
* Whitespace normalization.Tim Peters2006-11-031-1/+1
|
* Convert test_global, test_scope and test_grammar to unittest.Georg Brandl2006-10-281-335/+346
| | | | | I tried to enclose all tests which must be run at the toplevel (instead of inside a method) in exec statements.
* Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation.Neil Schemenauer2006-07-091-0/+11
|
* Fix arigo's funky LOAD_NAME bug: implicit globals inside classes haveNeil Schemenauer2005-10-231-0/+9
| | | | | historically been looked up using LOAD_NAME, not LOAD_GLOBAL. looked up by LOAD_NAME, not
* Merge ast-branch to headJeremy Hylton2005-10-201-44/+61
| | | | | | | | | | 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.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | 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. :)
* Add test for eval() w/ free variables.Jeremy Hylton2002-04-201-0/+10
| | | | Related to SF bug #505315
* SF #506611, fix sys.setprofile(), sys.settrace() core dumpsNeal Norwitz2002-03-031-0/+4
| | | | when no arguments are passed
* Don't call resetwarnings(). Be more restrictive in what we filter outGuido van Rossum2001-12-151-3/+1
| | | | instead.
* Undo inadvertent change to test_scope in previous checkinJeremy Hylton2001-12-131-2/+1
|
* Add test for SF bug [ #492403 ] exec() segfaults on closure's func_codeJeremy Hylton2001-12-131-2/+10
|
* Add test for local assigned to only in a nested list compJeremy Hylton2001-10-181-0/+18
|
* test_support should be imported directly, not via test.test_support.Tim Peters2001-09-251-1/+1
|
* silence warnings about import *Jeremy Hylton2001-08-071-0/+7
|
* Fix for SF bug [ #443866 ] Evaluating func_code causing core dumpJeremy Hylton2001-07-301-0/+13
| | | | Add test that calls eval with a code object that has free variables.
* Remove now-unnecessary "from __future__ import nested_scopes" stmts.Tim Peters2001-07-121-8/+6
|
* SF patch 419176 from MvL; fixed bug 418977Jeremy Hylton2001-05-081-0/+20
| | | | Two errors in dict_to_map() helper used by PyFrame_LocalsToFast().
* Fix 2.1 nested scopes crash reported by Evan SimpsonJeremy Hylton2001-04-271-0/+11
| | | | | | | | The new test case demonstrates the bug. Be more careful in symtable_resolve_free() to add a var to cells or frees only if it won't be added under some other rule. XXX Add new assertion that will catch this bug.
* Change error message raised when free variable is not yet bound. ItJeremy Hylton2001-04-131-1/+2
| | | | | | | | | now raises NameError instead of UnboundLocalError, because the var in question is definitely not local. (This affects test_scope.py) Also update the recent fix by Ping using get_func_name(). Replace tests of get_func_name() return value with call to get_func_desc() to match all the other uses.
* Add tests for recent changes:Jeremy Hylton2001-03-211-0/+30
| | | | | - global stmt in class does not affect free vars in methods - locals() works with free and cell vars
* Whitespace normalization.Tim Peters2001-03-161-3/+2
|
* Add test to verify that nested functions with free variables don'tJeremy Hylton2001-03-131-0/+23
| | | | cause the free variables to leak.
* Test interaction of global and nested scopes -- thanks to Samuele Pedroni.Guido van Rossum2001-03-011-0/+65
|
* add from __future__ import nested_scopes to strings passed to compileJeremy Hylton2001-02-271-6/+12
|
* Preliminary support for future nested scopesJeremy Hylton2001-02-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | compile.h: #define NESTED_SCOPES_DEFAULT 0 for Python 2.1 __future__ feature name: "nested_scopes" symtable.h: Add st_nested_scopes slot. Define flags to track exec and import star. Lib/test/test_scope.py: requires nested scopes compile.c: Fiddle with error messages. Reverse the sense of ste_optimized flag on PySymtableEntryObjects. If it is true, there is an optimization conflict. Modify get_ref_type to respect st_nested_scopes flags. Refactor symtable_load_symbols() into several smaller functions, which use struct symbol_info to share variables. In new function symtable_update_flags(), raise an error or warning for import * or bare exec that conflicts with nested scopes. Also, modify handle for free variables to respect st_nested_scopes flag. In symtable_init() assign st_nested_scopes flag to NESTED_SCOPES_DEFAULT (defined in compile.h). Add preliminary and often incorrect implementation of symtable_check_future(). Add symtable_lookup() helper for future use.
* Add test for syntax error on "x = 1 + 1".Jeremy Hylton2001-02-191-9/+1
| | | | Move check_syntax() function into test_support.
* Whitespace normalization.Tim Peters2001-02-151-4/+4
|
* update test cases for recent compiler changes: exec/import * in nestedJeremy Hylton2001-02-091-21/+64
| | | | functinos and cell vars with */** parameters
* Whitespace normalization.Tim Peters2001-02-091-6/+5
|
* Fix test 9 (caught by ?!ng)Jeremy Hylton2001-02-051-1/+30
| | | | Add tests for unbound locals (Nick Mathewson)
* Fix test for free ref to global. This test should have caught aJeremy Hylton2001-01-301-1/+1
| | | | recently fixed bug, but it checked for the wrong answer.
* PEP 227 implementationJeremy Hylton2001-01-251-0/+249
New tests cases for nested scopes.