Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests exceptions in IPython are displayed in its kernel tab #1370

Closed
spyder-bot opened this issue Feb 17, 2015 · 6 comments
Closed

Unit tests exceptions in IPython are displayed in its kernel tab #1370

spyder-bot opened this issue Feb 17, 2015 · 6 comments

Comments

@spyder-bot
Copy link
Collaborator

From sylvain....@gmail.com on 2013-04-28T17:35:02Z

Hello,

When running unit tests in the ipython console, exceptions are displayed in spyder internal console. This is the case on all linux and windows and with all versions of spyders. (2.1 , 2.2rc, last hg version so far)

You can reproduce the problem with the following steps:

  1. Use the following script:
    import unittest

class tests(unittest.TestCase):

def test_raise(self):
    print 1 / 0

if name == 'main':
unittest.main()

  1. Run the script in an ipython console of spyder's ipython widget
  2. Errors are displayed in spyder's internal console rather than in the current ipython console. If one runs the same script in a standard python console, the exception is correctly displayed in the current console.

Cheers,

Sylvain

E

ERROR: test_raise (main.tests)

Traceback (most recent call last):
File "/home/sylvain/Desktop/DevCode/EclipseWorkspace/BLP/DE_optimizer.py", line 6, in test_raise
print 1 / 0
ZeroDivisionError: integer division or modulo by zero


Ran 1 test in 0.000s

FAILED (errors=1)

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1370

@spyder-bot
Copy link
Collaborator Author

From pierre.raybaut on 2013-04-30T07:08:24Z

I've just tested this on Windows 8 and results are the following:

  1. running the sample script in a dedicated Python interpreter works as expected
  2. running the sample script in the current Python interpreter works as expected too
  3. running the sample script in the current IPython client will show the unittest results within the IPython kernel command window (in "Console" plugin) which is not the expected behavior (but these are not shown in the internal console as your reported)

@spyder-bot
Copy link
Collaborator Author

From sylvain....@gmail.com on 2013-04-30T10:42:32Z

Correct, I checked in windows XP and you are right.
I will give a try at home on Ubuntu tonight just in case because it is the system I used when I reported the bug.
Anyway, it is still not the expected behavior. Thanks,

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-04-30T11:06:00Z

I think I know how to fix this one: a config option needs to be passed to the kernel so that stderr is displayed directly in the console.

Summary: Unit tests exceptions in IPython are displayed in its kernel tab (was: Unit tests exceptions displayed in spyder internal console)
Owner: ccordoba12
Labels: MS-v2.2.1

@spyder-bot
Copy link
Collaborator Author

From sylvain....@gmail.com on 2013-05-06T14:33:13Z

Hi Carlos, Do you have a reference on how to pass such an option to a kernel?

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2013-06-19T18:13:26Z

This issue was updated by revision e59398d1399e .

Status: Fixed

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-02-15T16:14:34Z

Labels: -Component-IPython

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant