Menu

#136 Fix testing with pypy

None
closed-fixed
nobody
None
5
2017-02-03
2016-10-19
No

Some of the tests are broken when using PyPy:
* The backport of the csv_eod_error_str never happened in pypy so I added an extra check for this
* The exception thrown when trying to parse a string as integer was outputting the u to identify it as a unicode string which did not match the expected output (see below). I added a u identifier to the string which solves it.

Example:
- invalid literal for int() with base 10: 'fifty'.
+ invalid literal for int() with base 10: u'fifty'.

Tested with
* python-2.7.10
* python-3.4.3
* python-3.5.2
* pypy-5.4.1
* pypy3-5.5.0_alpha

I don't have earlier python versions available for testing.

1 Attachments

Discussion

  • Mathy Vanvoorden

    Sorry about the formatting, not used to this tracker ;-)

     
  • Günter Milde

    Günter Milde - 2016-10-20

    The patch fails with Python 2.5:

    Traceback (most recent call last):
      File "/home/milde/Code/Python/docutils-svn/docutils/test/alltests.py", line 79, in <module>
        suite = suite()
      File "/home/milde/Code/Python/docutils-svn/docutils/test/alltests.py", line 68, in suite
        'test_', packages=1)
      File "/home/milde/Code/Python/docutils-svn/docutils/test/package_unittest.py", line 101, in loadTestModules
        module = import_module(mod)
      File "/home/milde/Code/Python/docutils-svn/docutils/test/package_unittest.py", line 132, in import_module
        mod = __import__(name)
      File "/home/milde/Code/Python/docutils-svn/docutils/test/test_parsers/test_rst/test_directives/test_tables.py", line 40, in <module>
        platform.python_implementation() == 'PyPy' or not (
    AttributeError: 'module' object has no attribute 'python_implementation'
    
     
  • Günter Milde

    Günter Milde - 2016-11-29
    • status: open --> pending-remind
     
  • Günter Milde

    Günter Milde - 2016-11-29

    A version of the patch that works with 2.5 and 2.4 is now in (rev. 7976).

    Please test and close the ticket if OK.

     
  • Günter Milde

    Günter Milde - 2017-02-03
    • status: pending-remind --> closed-fixed
     
  • Günter Milde

    Günter Milde - 2017-02-03

    Closing now. Please reopen if there are remaining problems.

    Thank you for report and patch.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.