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

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

Projects

None yet

3 participants

@jstenar
Member
jstenar commented Jul 11, 2011

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
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
Member
fperez commented Nov 24, 2011

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

@jstenar
Member
jstenar commented Nov 28, 2011

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
Member

Is ipython on your path somewhere?

@jstenar
Member
jstenar commented Nov 28, 2011

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
Member

It's not ideal. I usually do all my testing in a virtualenv.

It looks like for some reason Windows is echoing the command in the output.
Any ideas how to fix that?

@fperez
Member
fperez commented Nov 28, 2011

On Mon, Nov 28, 2011 at 11:11 AM, Thomas
reply@reply.github.com
wrote:

It's not ideal. I usually do all my testing in a virtualenv.

Indeed. We should adjust the test suite to find the proper calling
path without assuming a bare 'ipython' call works. But note that
we'll still need the ipython libraries to be installed (i.e.,
'import IPython' should work). In the past we've tried to make the
full test suite work out of a download directory without installation,
and it turns out it's surprisingly hard to do right, and requires
brittle hacks that ultimately cause more problems than they're worth.

It looks like for some reason Windows is echoing the command in the output.
Any ideas how to fix that?

None, sorry... But it would be great if we could be back to a state
where the test suite passes 100% on Windows.

Cheers,

f

@fperez
Member
fperez commented Dec 6, 2011

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
Member

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

@jstenar
Member
jstenar commented Dec 7, 2011

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
Member
jstenar commented Dec 7, 2011

Fernando Perez skrev 2011-12-06 11:47:

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...

Now all tests run clean for me on windows (master 26dd071).

@takluyver
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