Commit Graph

928 Commits

Author SHA1 Message Date
Guido van Rossum ca956e2e47 When catching errors from os.rmdir(), test for os.error, not IOError! 2001-03-02 05:46:17 +00:00
Tim Peters d74bc432b2 Make names in __future__.py bind to class instances instead of 2-tuples.
Suggested on c.l.py by William Tanksley, and I like it.
2001-03-02 02:53:08 +00:00
Tim Peters fc35de409b test_global was broken by some recent checkin. Repairing. 2001-03-02 01:48:16 +00:00
Guido van Rossum 9aa643cf69 Test interaction of global and nested scopes -- thanks to Samuele Pedroni. 2001-03-01 20:35:45 +00:00
Tim Peters 251083142f Whitespace normalization. 2001-03-01 08:31:39 +00:00
Skip Montanaro 40fc16059f final round of __all__ lists (I hope) - skipped urllib2 because Moshe may be
giving it a slight facelift
2001-03-01 04:27:19 +00:00
Fred Drake 5c015344a6 Add tests for the .copy() methods of both weak dictionary classes. 2001-03-01 03:06:53 +00:00
Jeremy Hylton 2922ea8235 Add test case for global stmt at module level.
Fix test_grammar so that it ignores warning about global stmt at
module level in exec.
2001-02-28 23:49:19 +00:00
Jeremy Hylton 42efed0fc3 update output to reflect exception that is now raised 2001-02-28 23:24:22 +00:00
Jeremy Hylton 150a6640f5 Fix filter for SyntaxErrors 2001-02-28 22:50:15 +00:00
Jeremy Hylton 62e2c7e3df Add regression test for future statements. This adds eight files, but
seven are not tests in their own right; these files are mentioned in
regrtest.
2001-02-28 17:48:06 +00:00
Tim Peters 85ba673b0a Whitespace normalization. 2001-02-28 08:26:44 +00:00
Fred Drake 6e7e485d5d Added regression test for SF tracker bug #403871: AttributeError in
ZipFile.__del__() when there was an IOError opening the underlying
    file in ZipFile.__init__().

    This is an odd test: since the exception is in the __del__() method,
    it is not propogated.  This test will trigger it but regrtest.py
    does not detect the failure (not sure why); we are dependent on it
    actually being noticed by a user to get a new bug report if it ever
    fails.  ;-(

    On the other hand, this makes sure that code gets exercised, so
    a failure could be noticed!
2001-02-28 05:34:16 +00:00
Jeremy Hylton 8e43cd7929 verify that warnings are issued for bogus uses of global 2001-02-28 01:51:01 +00:00
Andrew M. Kuchling 6efc6e7832 Patch #404680: disables the nis module and enables the dl module when
building under Cygwin.  Makes some fixes to the dlmodule in order to
    compile with Cygwin.
2001-02-27 20:54:23 +00:00
Jeremy Hylton 5941d191de add from __future__ import nested_scopes to strings passed to compile 2001-02-27 20:23:58 +00:00
Martin v. Löwis 5e1633365d Patch #403985: Add support for weak-keyed dictionaries 2001-02-27 18:36:56 +00:00
Ka-Ping Yee 6397c7c9a9 inspect: a module for getting information out of live Python objects 2001-02-27 14:43:21 +00:00
Jeremy Hylton 29906eef3a Preliminary support for future nested scopes
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.
2001-02-27 04:23:34 +00:00
Fred Drake 3c823aa4b6 Make sure ConfigParser uses .optionxform() consistently; this affects
.has_option(), .remove_option(), and .set().

This closes SF tracker #232913.
2001-02-26 21:55:34 +00:00
Tim Peters ffc215a279 Add __future__.py to std library, + dull test to verify that assignments
therein are of the proper form.
2001-02-26 21:14:49 +00:00
Barry Warsaw c1e100f215 Additional tests for current, PEP described semantics:
- func.__dict__ is None until the first attribute is assigned

- del func.__dict__ is equivalent to func.__dict__ = None

- disallowing assignment to function attribute through unbound method
  (it was always illegal to assign through bound method).

- verifying that setting attribute explicitly on underlying function
  via meth.im_func is okay.
2001-02-26 18:07:26 +00:00
Barry Warsaw 22e4182d60 Describe -s a little more generically. 2001-02-23 18:31:40 +00:00
Tim Peters 0009c4ea59 Whitespace normalization. 2001-02-21 07:29:48 +00:00
Andrew M. Kuchling 9a0f98e0a1 Add test case from bug #124981: zlib decompress of sync-flushed data
fails
2001-02-21 02:17:01 +00:00
Andrew M. Kuchling bc8f72cccc Patch #103854: raises an exception if a non-Attr node is passed to
NamedNodeMap.setNamedItem().  Martin, should I sync the PyXML tree, too,
 or do you want to do it?  (I don't know if you're wrapping the 0.6.4
 release right now.)
2001-02-21 01:30:26 +00:00
Andrew M. Kuchling 8b94b1c74a Added test for patch #103473: test an unquoted cookie value containing '=' 2001-02-21 01:17:54 +00:00
Jeremy Hylton 121b6eb018 SF patch #103749: implicit tuple + default arg 2001-02-19 23:53:42 +00:00
Jeremy Hylton f828e2d737 Add simple section for assert, including assert w/ lambdas 2001-02-19 15:54:52 +00:00
Jeremy Hylton 4779399e9f Add test for syntax error on "x = 1 + 1".
Move check_syntax() function into test_support.
2001-02-19 15:35:26 +00:00
Fredrik Lundh c0c7ee3a65 detect attempts to repeat anchors (fixes bug #130748) 2001-02-18 21:04:48 +00:00
Tim Peters 8ac3627b91 sre_{parse, compile} no longer define __all__. 2001-02-18 14:44:42 +00:00
Fredrik Lundh f2989b22ff - restored 1.5.2 compatibility (sorry, eric)
- removed __all__ cruft from internal modules (sorry, skip)
- don't assume ASCII for string escapes (sorry, per)
2001-02-18 12:05:16 +00:00
Skip Montanaro 78349072f7 removed __all__ from several modules 2001-02-18 03:30:53 +00:00
Tim Peters 0e6d213177 Whitespace normalization. 2001-02-15 23:56:39 +00:00
Skip Montanaro 0de65807e6 bunch more __all__ lists
also modified check_all function to suppress all warnings since they aren't
relevant to what this test is doing (allows quiet checking of regsub, for
instance)
2001-02-15 22:15:14 +00:00
Andrew M. Kuchling 8e6d44eedc Patch #103748 from Toby Dickenson: fix typo in test_zlib that turns one
test case into a no-op because ''.join('hello world') == 'hello world'
2001-02-14 17:46:20 +00:00
Fred Drake cc1f951b4c Test section name using some strange characters, including a backslash
(SF bug #132288).
2001-02-14 15:30:31 +00:00
Tim Peters 60e23f4cfc Change doctest exception example to one whose detail hasn't changed since 1.5.2. 2001-02-14 00:43:21 +00:00
Tim Peters ea4f931cb9 Teach doctest about newer "(most recent call last)" traceback spelling. 2001-02-13 20:54:42 +00:00
Fred Drake 95b96d3941 Added options that use square brackets in their names; this ensures that
GNOME-style internationalized options can be parsed using ConfigParser
(SF bug #131635).

Converted the tests to use test_support.verify() instead of output
comparison to work.
2001-02-12 17:23:20 +00:00
Tim Peters 76c066b103 test_pty started failing on Windows, but if and only if test___all__ was
run first.  Indirectly due to Skip adding check_all("pty") to test___all__:
that caused the expected ImportError due to pty.py trying to import the
non-existent FCNTL to get handled by test___all__, leaving a partial
module object for pty in sys.modules, which caused the later import of
pty via test_pty to succeed.  Then test_tpy died with an AttributeError,
due to trying to access attributes of pty that didn't exist.  regrtest
viewed that as a failure rather than the appropriate "test skipped".
Fixed by deleting partial module objects in test___all__ when test___all__
handles an ImportError.
2001-02-12 03:27:31 +00:00
Skip Montanaro c62c81e013 __all__ for several more modules 2001-02-12 02:00:42 +00:00
Marc-André Lemburg ef0a032883 Patch by Finn Bock to make test_unicode.py work for Jython. 2001-02-10 14:09:31 +00:00
Tim Peters 9ae2148ada Moved SequenceMatcher from ndiff into new std library module difflib.py.
Guido told me to do this <wink>.
Greatly expanded docstrings, and fleshed out with examples.
New std test.
Added new get_close_matches() function for ESR.
Needs docs, but LaTeXification of the module docstring is all it needs.
\CVS: ----------------------------------------------------------------------
2001-02-10 08:00:53 +00:00
Tim Peters 6db54c69a4 Add std test for doctest. 2001-02-10 01:36:47 +00:00
Jeremy Hylton cafd495dfe In O_writelines: Replace use of string.joinfields with "".join. 2001-02-09 23:44:22 +00:00
Jeremy Hylton 11db72a5c3 update to use new symtable interface 2001-02-09 22:57:10 +00:00
Jeremy Hylton 97a01674b2 update test cases for recent compiler changes: exec/import * in nested
functinos and cell vars with */** parameters
2001-02-09 22:56:46 +00:00
Tim Peters 10fb386399 Whitespace normalization. 2001-02-09 20:17:14 +00:00
Eric S. Raymond dbbbaf2696 joinfields -> join. 2001-02-09 17:05:53 +00:00
Eric S. Raymond 83ff749827 String method conversion. 2001-02-09 12:03:45 +00:00
Eric S. Raymond 2846b0ab41 String method conversion.
(This one was trivial -- no actual string. references in it!)
2001-02-09 12:00:47 +00:00
Eric S. Raymond fc170b1fd5 String method conversion. 2001-02-09 11:51:27 +00:00
Eric S. Raymond d8c628bd59 String method conversion.
(This one was trivial -- no actual string. references in it!)
2001-02-09 11:46:37 +00:00
Skip Montanaro 352674d01c a few more __all__ lists 2001-02-07 23:14:30 +00:00
Skip Montanaro cc012e92b2 test for presence of __builtins__ in names before deleting it, enabling this
to work with Jython (ugh! I hate that name!).  This closes patch 103665.
2001-02-07 22:46:55 +00:00
Martin v. Löwis fe28ca09a5 Add xml declaration into toxml testcase. 2001-02-06 01:16:48 +00:00
Skip Montanaro 269b83bc05 added several more __all__ lists 2001-02-06 01:07:02 +00:00
Jeremy Hylton de6024872a Fix test 9 (caught by ?!ng)
Add tests for unbound locals (Nick Mathewson)
2001-02-05 17:35:20 +00:00
Tim Peters d66595fe42 Renamed _testXXX to _testcapiXXX. Jack is my hero -- good call! 2001-02-04 03:09:53 +00:00
Jeremy Hylton 5e7cb240af Add minimal interface to symtable: _symtable module. 2001-02-02 18:24:26 +00:00
Tim Peters 9ea17ac595 Patch derived from Trent's 101162: a Python/C API testing framework.
STILL NEEDS UNIX BUILD CHANGES.
2001-02-02 05:57:15 +00:00
Jeremy Hylton 3faa52ecc4 Allow 'continue' inside 'try' clause
SF patch 102989 by Thomas Wouters
2001-02-01 22:48:12 +00:00
Jeremy Hylton 483638c9a8 Undo recent change that banned using import to bind a global, as per
discussion on python-dev.  'from mod import *' is still banned except
at the module level.

Fix value for special NOOPT entry in symtable.  Initialze to 0 instead
of None, so that later uses of PyInt_AS_LONG() are valid.  (Bug
reported by Donn Cave.)

replace local REPR macros with PyObject_REPR in object.h
2001-02-01 20:20:45 +00:00
Jeremy Hylton 6fe0a82ecb move extra arguments to the back of the new.code() arglist 2001-02-01 19:50:29 +00:00
Fred Drake acfb3f6006 Revise the driver code to be more informative in the final report. 2001-02-01 18:11:29 +00:00
Fred Drake 41deb1efc2 PEP 205, Weak References -- initial checkin. 2001-02-01 05:27:45 +00:00
Moshe Zadka fc3fc337d0 Checking in patch #103478 -- makes popen2 and fork1 tested on BeOS.
Tested for not breaking builds on Linux.
2001-01-30 18:35:32 +00:00
Jeremy Hylton 251ef9666e Fix test for free ref to global. This test should have caught a
recently fixed bug, but it checked for the wrong answer.
2001-01-30 01:26:53 +00:00
Jeremy Hylton ac25a38841 add test for illegal imports 2001-01-30 01:25:56 +00:00
Marc-André Lemburg fde66e1bcc Fixed .capitalize() method of Unicode objects to work like the
corresponding string method. Added tests for this too.

Patch written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-29 11:14:16 +00:00
Moshe Zadka 497671e094 The one thing I love more then writing code is deleting code.
* Removed func_hash and func_compare, so they can be treated as immutable
  content-less objects (address hash and comparison)
* Added tests to that affect to test_funcattrs (also testing func_code
  is writable)
* Reverse meaning of tests in test_opcodes which checked identical code
  gets identical functions
2001-01-29 06:21:17 +00:00
Skip Montanaro 080c99745f added several more urlencode test cases - part of patch 103391 2001-01-28 21:12:22 +00:00
Fred Drake 64d42c5bb1 Added tests for new signature of new.instance().
Use test_support.verify() where applicable.
2001-01-28 03:57:39 +00:00
Martin v. Löwis 2bcb32372c Except HierarchyRequestErr instead of TypeError. 2001-01-27 09:17:55 +00:00
Jeremy Hylton 619eea6821 PEP 227 implementation
test_new: new.code() noew takes two more arguments
test_grammer: Add a bunch of test cases for lambda (not really PEP 227 related)
2001-01-25 20:12:27 +00:00
Jeremy Hylton 4588c78faf PEP 227 implementation
New tests cases for nested scopes.
2001-01-25 20:11:23 +00:00
Jeremy Hylton 92e9f29aec add extra tests to verify that co_varnames is being set up properly
also normalize checks for syntax errors and delete commented out
definition of verify.
2001-01-25 17:03:37 +00:00
Skip Montanaro 03d9014992 added a few more __all__ lists
test___all__.py: fail silently in check_all if the module can't be imported
2001-01-25 15:29:22 +00:00
Guido van Rossum 42756df91c Fix the test output, now that escapes in repr() of string and Unicode
are different (Ping didn't test this).
2001-01-24 21:49:57 +00:00
Guido van Rossum 0fc8b74fc5 Fix the test output, now that escapes in repr() of string and Unicode
are different (Ping couldn't test this).
2001-01-24 21:46:18 +00:00
Ka-Ping Yee fa004ad36c Show '\011', '\012', and '\015' as '\t', '\n', '\r' in strings.
Switch from octal escapes to hex escapes for other nonprintable characters.
2001-01-24 17:19:08 +00:00
Fredrik Lundh 06d126803c Move uchhash functionality into unicodedata (after the recent
crop of changes, the files are small enough to do this).  Also
adds "name" and "lookup" functions to unicodedata.
2001-01-24 07:59:11 +00:00
Skip Montanaro 17ab123cf1 a few more modules get __all__ 2001-01-24 06:27:27 +00:00
Barry Warsaw 24f3acab3b It's "gopherlib" not "gopher". 2001-01-24 04:13:02 +00:00
Skip Montanaro 2dd4276559 added a few more __all__ lists
fixed typo in ihooks docstring
2001-01-23 15:35:05 +00:00
Tim Peters f87d857080 Restore alphabetic order. Also try to import rlcompleter and curses, but
don't fail if they're not available.
2001-01-23 09:50:30 +00:00
Jeremy Hylton 578ceee042 Add simple test of list comprehension that uses a name that isn't
otherwise used in the same code block.  (Not sure this is the right
place, but there is no test_list_comprehensions.py.)
2001-01-23 01:51:40 +00:00
Guido van Rossum d0f5e70016 - Use "exec ... in dict" to avoid having to walk on eggshells; locals
no don't have to start with underscore.

- Add spaces after commas in argument lists.

- Only test dbhash if bsddb can be imported.  (Wonder if there are
  more like this?)
2001-01-22 23:37:04 +00:00
Tim Peters 763cb0aa44 Typo repair. 2001-01-22 22:43:35 +00:00
Tim Peters e935816164 Reorganize pickle/cPickle testing so the tests pass regardless of the order
they're run.
2001-01-22 22:05:20 +00:00
Fred Drake d74804db41 The "user" module cannot reasonably be tested. Moved to the end (and
commented it out), and added an explanation as to *why*.

Added period to docstring.
2001-01-22 19:38:37 +00:00
Guido van Rossum 7f9b5e014b OK, changed my mind once more on this. The comparison hierarchy is
now

    None < all numeric types < all other types

so that once again

    map(max, Squares(3), Squares(2))

equals

    [0, 1, 4]
2001-01-22 19:30:07 +00:00
Guido van Rossum d9bae8b95a Numeric-smelling objects now once again compare smaller than
non-numeric ones, so 4 < None again in the 'map' test.
2001-01-22 16:01:24 +00:00
Guido van Rossum f317a18a4a Finn Bock (SF patch #103345): Avoid outdated exec form in
test_class.py.
2001-01-22 14:51:41 +00:00
Tim Peters d304f44906 Patch #103343: Allow the important test_pkg to succeed under Jython. 2001-01-21 19:51:53 +00:00
Tim Peters 08dabf0a73 Patch #103344: Sort dicts from extcall for easier comparison with Jython. 2001-01-21 18:52:02 +00:00
Tim Peters dfc538acae Whitespace normalization. 2001-01-21 04:49:16 +00:00
Skip Montanaro eccd02a40d more __all__ updates 2001-01-20 23:34:12 +00:00