Comment #12 on issue 1641 by asmeurer: doctests require newline only when  
run for single file
http://code.google.com/p/sympy/issues/detail?id=1641

The UnicodeEncodeError seems to be related to the pretty printer:

$./bin/isympy -c python -p no
>>> import doctest as pdoctest
>>> doc_file1='sympy/solvers/solvers.py'
>>> pdoctest.testfile(doc_file1, module_relative=False,  
>>> optionflags=pdoctest.ELLIPSIS |
... pdoctest.NORMALIZE_WHITESPACE)
**********************************************************************
File "sympy/solvers/solvers.py", line 60, in solvers.py
Failed example:
     guess_solve_strategy(x**2 + 1, x)
Exception raised:
     Traceback (most recent call last):
        
File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/doctest.py",  
line 1241, in __run
         compileflags, 1) in test.globs
       File "<doctest solvers.py[2]>", line 1, in <module>
         guess_solve_strategy(x**2 + 1, x)
     NameError: name 'guess_solve_strategy' is not defined
**********************************************************************
File "sympy/solvers/solvers.py", line 62, in solvers.py
Failed example:
     guess_solve_strategy(x**Rational(1,2) + 1, x)
Exception raised:
     Traceback (most recent call last):
        
File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/doctest.py",  
line 1241, in __run
         compileflags, 1) in test.globs
       File "<doctest solvers.py[3]>", line 1, in <module>
         guess_solve_strategy(x**Rational(1,2) + 1, x)
     NameError: name 'guess_solve_strategy' is not defined
**********************************************************************
1 items had failures:
    2 of  31 in solvers.py
***Test Failed*** 2 failures.
(2, 31)

It only raises that error when pretty printing is turned on in the  
console.  It seems that the ⅈ is coming from
the test
>>> solve(x**4-1, x)
[1, -1, -I, I]

in solve(), which is right below guess_solve_strategy.  If I comment this  
test out, and then a few others in the
file that use unicode pretty printing symbols, then the test runs.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to