Changeset 330


Ignore:
Timestamp:
12/29/08 14:05:11 (5 years ago)
Author:
xi
Message:

Share data files between Py2 and Py3 test suites.

Location:
pyyaml/trunk
Files:
2 added
1 deleted
10 edited
35 copied
33 moved

Legend:

Unmodified
Added
Removed
  • pyyaml/trunk/MANIFEST.in

    r326 r330  
    11include README LICENSE CHANGES setup.py 
    22recursive-include examples *.py *.cfg *.yaml 
    3 recursive-include tests *.py 
    43recursive-include tests/data * 
     4recursive-include tests/lib *.py 
     5recursive-include tests/lib3 *.py 
  • pyyaml/trunk/Makefile

    r322 r330  
    2525 
    2626test: build 
    27         ${PYTHON} tests/test_build.py ${TEST} 
     27        ${PYTHON} tests/lib/test_build.py ${TEST} 
    2828 
    2929testext: buildext 
    30         ${PYTHON} tests/test_build_ext.py ${TEST} 
     30        ${PYTHON} tests/lib/test_build_ext.py ${TEST} 
    3131 
    3232testall: 
  • pyyaml/trunk/setup.py

    r328 r330  
    289289        sys.path.insert(0, build_cmd.build_lib) 
    290290        if sys.version_info[0] < 3: 
    291             sys.path.insert(0, 'tests') 
     291            sys.path.insert(0, 'tests/lib') 
    292292        else: 
    293             sys.path.insert(0, 'tests3') 
     293            sys.path.insert(0, 'tests/lib3') 
    294294        import test_all 
    295295        test_all.main([]) 
  • pyyaml/trunk/tests/data/construct-python-name-module.code

    r322 r330  
    1 [file, yaml.Loader, yaml.dump, abs, yaml.tokens] 
     1[str, yaml.Loader, yaml.dump, abs, yaml.tokens] 
  • pyyaml/trunk/tests/data/construct-python-name-module.data

    r146 r330  
    1 - !!python/name:file 
     1- !!python/name:str 
    22- !!python/name:yaml.Loader 
    33- !!python/name:yaml.dump 
  • pyyaml/trunk/tests/data/construct-python-str-utf8-py3.code

    r144 r330  
    1 u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430'.encode('utf-8') 
     1'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 
  • pyyaml/trunk/tests/data/construct-python-unicode-ascii-py3.code

    r144 r330  
    1 u"ascii string" 
     1"ascii string" 
  • pyyaml/trunk/tests/data/construct-python-unicode-utf8-py3.code

    r144 r330  
    1 u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 
     1'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 
  • pyyaml/trunk/tests/data/construct-str-utf8-py3.code

    r144 r330  
    1 u'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 
     1'\u042d\u0442\u043e \u0443\u043d\u0438\u043a\u043e\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430' 
  • pyyaml/trunk/tests/data/emitting-unacceptable-unicode-character-bug-py3.code

    r153 r330  
    1 u"\udd00" 
     1"\udd00" 
  • pyyaml/trunk/tests/data/serializer-is-already-opened.dumper-error

    r322 r330  
    1 dumper = yaml.Dumper(StringIO.StringIO()) 
     1dumper = yaml.Dumper(StringIO()) 
    22dumper.open() 
    33dumper.open() 
  • pyyaml/trunk/tests/data/serializer-is-closed-1.dumper-error

    r322 r330  
    1 dumper = yaml.Dumper(StringIO.StringIO()) 
     1dumper = yaml.Dumper(StringIO()) 
    22dumper.open() 
    33dumper.close() 
  • pyyaml/trunk/tests/data/serializer-is-closed-2.dumper-error

    r322 r330  
    1 dumper = yaml.Dumper(StringIO.StringIO()) 
     1dumper = yaml.Dumper(StringIO()) 
    22dumper.open() 
    33dumper.close() 
  • pyyaml/trunk/tests/data/serializer-is-not-opened-1.dumper-error

    r322 r330  
    1 dumper = yaml.Dumper(StringIO.StringIO()) 
     1dumper = yaml.Dumper(StringIO()) 
    22dumper.close() 
  • pyyaml/trunk/tests/data/serializer-is-not-opened-2.dumper-error

    r322 r330  
    1 dumper = yaml.Dumper(StringIO.StringIO()) 
     1dumper = yaml.Dumper(StringIO()) 
    22dumper.serialize(yaml.ScalarNode(tag='!foo', value='bar')) 
  • pyyaml/trunk/tests/lib/test_appliance.py

    r325 r330  
    2424        if os.path.isfile(os.path.join(directory, filename)): 
    2525            base, ext = os.path.splitext(filename) 
     26            if base.endswith('-py3'): 
     27                continue 
    2628            filenames.setdefault(base, []).append(ext) 
    2729    filenames = filenames.items() 
  • pyyaml/trunk/tests/lib/test_errors.py

    r322 r330  
    5151    code = open(error_filename, 'rb').read() 
    5252    try: 
    53         import yaml, StringIO 
     53        import yaml 
     54        from StringIO import StringIO 
    5455        exec code 
    5556    except yaml.YAMLError, exc: 
  • pyyaml/trunk/tests/lib3/test_appliance.py

    r328 r330  
    22import sys, os, os.path, types, traceback, pprint 
    33 
    4 DATA = 'tests3/data' 
     4DATA = 'tests/data' 
    55 
    66def find_test_functions(collections): 
     
    2222        if os.path.isfile(os.path.join(directory, filename)): 
    2323            base, ext = os.path.splitext(filename) 
     24            if base.endswith('-py2'): 
     25                continue 
    2426            filenames.setdefault(base, []).append(ext) 
    2527    filenames = sorted(filenames.items()) 
  • pyyaml/trunk/tests/lib3/test_constructor.py

    r329 r330  
    1313def _make_objects(): 
    1414    global MyLoader, MyDumper, MyTestClass1, MyTestClass2, MyTestClass3, YAMLObject1, YAMLObject2,  \ 
    15             AnObject, AnInstance, AState, ACustomState, NewArgs, NewArgsWithState,  \ 
    16             Reduce, ReduceWithState, MyInt, MyList, MyDict, FixedOffset, execute 
     15            AnObject, AnInstance, AState, ACustomState, InitArgs, InitArgsWithState,    \ 
     16            NewArgs, NewArgsWithState, Reduce, ReduceWithState, MyInt, MyList, MyDict,  \ 
     17            FixedOffset, execute 
    1718 
    1819    class MyLoader(yaml.Loader): 
     
    157158        def __setstate__(self, state): 
    158159            self.baz = state 
     160 
     161    InitArgs = NewArgs 
     162 
     163    InitArgsWithState = NewArgsWithState 
    159164 
    160165    class Reduce(AnObject): 
  • pyyaml/trunk/tests/lib3/test_errors.py

    r328 r330  
    5151    code = open(error_filename, 'rb').read() 
    5252    try: 
    53         import yaml, io 
     53        import yaml 
     54        from io import StringIO 
    5455        exec(code) 
    5556    except yaml.YAMLError as exc: 
Note: See TracChangeset for help on using the changeset viewer.