Changeset 49 for trunk/tests

Show
Ignore:
Timestamp:
02/19/06 03:10:24 (6 years ago)
Author:
xi
Message:

Fix segfault under Python2.3.

Support for complex numbers.

Add /usr/local to the search path.

Location:
trunk/tests
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/test_dumper.py

    r23 r49  
    1616 
    1717try: 
    18     import sets 
     18    Set = set 
    1919except: 
    20     class _sets: 
    21         def Set(self, items): 
     20    try: 
     21        from sets import Set 
     22    except ImportError: 
     23        def Set(items): 
    2224            set = {} 
    2325            for items in items: 
    2426                set[items] = None 
    2527            return set 
    26     sets = _sets() 
    27  
    2828 
    2929EXAMPLE = { 
     
    7373 
    7474COLLECTIONS = [ 
    75     sets.Set(range(10)), 
     75    Set(range(10)), 
    7676] 
    7777 
  • trunk/tests/test_loader.py

    r23 r49  
    1616 
    1717try: 
    18     import sets 
    19 except ImportError: 
    20     class _sets: 
    21         def Set(self, items): 
     18    Set = set 
     19except: 
     20    try: 
     21        from sets import Set 
     22    except ImportError: 
     23        def Set(items): 
    2224            set = {} 
    2325            for items in items: 
    2426                set[items] = None 
    2527            return set 
    26     sets = _sets() 
     28 
    2729 
    2830INF = 1e300000 
     
    128130""", { 
    129131#    'baseball players': sets.Set(['Mark McGwire', 'Sammy Sosa', 'Ken Griffey']), 
    130     'baseball teams': sets.Set(['Boston Red Sox', 'Detroit Tigers', 'New York Yankees']), 
     132    'baseball teams': Set(['Boston Red Sox', 'Detroit Tigers', 'New York Yankees']), 
    131133} 
    132134 
  • trunk/tests/test_pickle.py

    r36 r49  
    1212- !python/long 12345678901234567890 
    1313- !python/float 123.456 
    14 - !python/float 123.4560000001 
     14- !python/float 123456e-3 
     15- !python/complex 1.0 
     16- !python/complex 0.0+1.0j 
    1517- !python/str foo bar 
    16 - !python/unicode FOO ЀУ bar бар 
     18- !python/unicode FOO ЀУ bar ба 
    1719- !python/list [1, 2, 3] 
    1820- !python/tuple [foo, bar] 
     
    2527    12345678901234567890L, 
    2628    123.456, 
    27     123.4560000001, 
     29    123.456, 
     30    1+0j, 
     31    1j, 
    2832    'foo bar', 
    29     unicode('FOO ЀУ bar бар', 'utf-8'), 
     33    unicode('FOO ЀУ bar ба', 'utf-8'), 
    3034    [1, 2, 3], 
    3135    ('foo', 'bar'), 
     
    7579    object, 
    7680] 
     81 
     82import sys, unittest, encodings.cp1251, os.path 
     83 
     84MODULES = """ 
     85- !python/module:sys 
     86- !python/module:unittest 
     87- !python/module:encodings.cp1251 
     88- !python/module:os.path 
     89""", [sys, unittest, encodings.cp1251, os.path] 
    7790 
    7891class AnObject(object): 
     
    246259        self._testPickle(NAMES) 
    247260 
     261    def testModules(self): 
     262        self._testPickle(MODULES) 
     263 
    248264    def testObjects(self): 
    249265        self._testPickle(OBJECTS)