Test error and failure in IPython.core on windows #568

Closed
jstenar opened this Issue Jul 11, 2011 · 12 comments

3 participants

@jstenar
IPython member

I get one test error and one tes failure in the testsuite for IPython.core on master 002a480.

This is the result of iptest IPython.core:

ERROR: Failure: error (nothing to repeat)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python26\lib\site-packages\nose\loader.py", line 231, in generate
    for test in g():
  File "c:\python\external\ipython-js\IPython\core\tests\test_magic.py", line 32, in test_rehashx
    _ip.magic('rehashx')
  File "c:\python\external\ipython-js\IPython\core\interactiveshell.py", line 1884, in magic
    result = fn(magic_args)
  File "c:\python\external\ipython-js\IPython\core\magic.py", line 2674, in magic_rehashx
    execre = re.compile(r'(.*)\.(%s)$' % winext,re.IGNORECASE)
  File "c:\python26\lib\re.py", line 190, in compile
    return _compile(pattern, flags)
  File "c:\python26\lib\re.py", line 245, in _compile
    raise error, v # invalid expression
error: nothing to repeat

======================================================================
FAIL: Test that object's __del__ methods are called on exit.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python26\lib\site-packages\nose\case.py", line 187, in runTest
    self.test(*self.arg)
  File "c:\python\external\ipython-js\IPython\core\tests\test_run.py", line 170, in test_obj_del
    tt.ipexec_validate(self.fname, 'object A deleted')
  File "c:\python\external\ipython-js\IPython\testing\tools.py", line 258, in ipexec_validate
    nt.assert_equals(out.strip(), expected_out.strip())
AssertionError: 'C:\\python\\bugreports\\ipython\\getcwdu>python -m ipython --quick --colors=NoColor --no-term-title --n
o-banner --autocall=0 --InteractiveShell.prompt_in1="" --InteractiveShell.prompt_in2="" --InteractiveShell.prompt_out=""
 c:\\users\\jstenar\\appdata\\local\\temp\\tmpvduq7v.py \r\nobject A deleted' != 'object A deleted'
>>  raise self.failureException, \
      (None or '%r != %r' % ('C:\\python\\bugreports\\ipython\\getcwdu>python -m ipython --quick --colors=NoColor --
no-term-title --no-banner --autocall=0 --InteractiveShell.prompt_in1="" --InteractiveShell.prompt_in2="" --InteractiveSh
ell.prompt_out="" c:\\users\\jstenar\\appdata\\local\\temp\\tmpvduq7v.py \r\nobject A deleted', 'object A deleted'))

----------------------------------------------------------------------
Ran 347 tests in 0.683s

FAILED (KNOWNFAIL=3, SKIP=1, errors=1, failures=1)
@takluyver
IPython member

The first one is replicable if winext is "*", which it can get from your pathext environment variable. I guess we just need to add a check for that case.

@fperez
IPython member

@jstenar, could you check whether this is still true, or can we close this one?

@jstenar
IPython member

There is still an error here but it looks different.

.............................................
----------------------------------------------------------------------
Ran 45 tests in 0.040s

OK
.................................K...............................................................................................................................................................K............................................................................................................................................SS.......KE..S....
======================================================================
ERROR: Test that object's __del__ methods are called on exit.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python26\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "c:\python26\external\ipython\IPython\core\tests\test_run.py", line 188, in test_obj_del
    tt.ipexec_validate(self.fname, 'object A deleted', err)
  File "c:\python26\external\ipython\IPython\testing\tools.py", line 262, in ipexec_validate
    out, err = ipexec(fname, options)
  File "c:\python26\external\ipython\IPython\testing\tools.py", line 214, in ipexec
    ipython_cmd = find_cmd('ipython3' if py3compat.PY3 else 'ipython')
  File "c:\python26\external\ipython\IPython\utils\process.py", line 67, in find_cmd
    raise FindCmdError('command could not be found: %s' % cmd)
FindCmdError: command could not be found: ipython

----------------------------------------------------------------------
Ran 357 tests in 1.499s
@takluyver
IPython member

Is ipython on your path somewhere?

@jstenar
IPython member

You are right I did not have ipython on path.

Isn't it a bit dangorous to assume ipython is on the path? I mean if I'm testing code for a different python version than my default then I would get some other ipython than the one we are trying to test.

When running the test with ipython on the path I get this error:

C:\python\external> python .\ipython\IPython\scripts\iptest IPython.core
........................................K...............................................................................
................................................................................K.......................................
.....................................................................................................SS.......KF..S....
======================================================================
FAIL: Test that object's __del__ methods are called on exit.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\python26\lib\site-packages\nose\case.py", line 187, in runTest
    self.test(*self.arg)
  File "c:\python\external\ipython\IPython\core\tests\test_run.py", line 188, in test_obj_del
    tt.ipexec_validate(self.fname, 'object A deleted', err)
  File "c:\python\external\ipython\IPython\testing\tools.py", line 274, in ipexec_validate
    nt.assert_equals(out.strip(), expected_out.strip())
AssertionError: 'C:\\python\\external>python -m ipython --quick --colors=NoColor --no-term-title --no-banner --autocall=
0 --InteractiveShell.prompt_in1="" --InteractiveShell.prompt_in2="" --InteractiveShell.prompt_out="" c:\\users\\jstenar\
\appdata\\local\\temp\\tmpzhhejp.py \r\nobject A deleted' != 'object A deleted'
>>  raise self.failureException, \
      (None or '%r != %r' % ('C:\\python\\external>python -m ipython --quick --colors=NoColor --no-term-title --no-b
anner --autocall=0 --InteractiveShell.prompt_in1="" --InteractiveShell.prompt_in2="" --InteractiveShell.prompt_out="" c:
\\users\\jstenar\\appdata\\local\\temp\\tmpzhhejp.py \r\nobject A deleted', 'object A deleted'))


----------------------------------------------------------------------
Ran 364 tests in 1.514s

FAILED (KNOWNFAIL=3, SKIP=3, failures=1)
@takluyver
IPython member
@fperez
IPython member
@fperez
IPython member

I've raised the priority b/c I'd really like to push 0.12 out with a fully working test suite on windows, but I'm not sure we'll be able to fix it...

@takluyver
IPython member

@jstenar: Any chance you can dig into why that one test is failing?

@jstenar
IPython member

It seems this is not a bug but a brittleness in the test system. The find_cmd found a .bat file on my system and this batfile had echoed some extra stuff to stdout that caused the testfailure. After making sure I have the correct ipython.exe on my path it works.

@jstenar
IPython member
@takluyver
IPython member

OK, great. I think the various tracebacks on this issue will make it confusing to keep using, so I'll close this. Feel free to file a new issue for any brittleness, or for any tests that we break.

@takluyver takluyver closed this Dec 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment