[IPython-dev] correct test-suite

Thomas Spura tomspur at fedoraproject.org
Thu Jul 29 04:54:46 EDT 2010


Am Mon, 26 Jul 2010 19:38:21 -0700
schrieb Fernando Perez <fperez.net at gmail.com>:

> On Mon, Jul 26, 2010 at 12:18 AM, Thomas Spura
> <tomspur at fedoraproject.org> wrote:
> > Here, they don't... That's why, I didn't look too closely to the
> > failing tests in my branches. I'll try to fix the failures in
> > current master on my side first, because it seems some other
> > dependencies are doing something wrong I guess...
> >
> 
> If you can't find it, show me the tracebacks and I may be able to help
> out.  We want the test suite to degrade gracefully by skipping if
> optional dependencies aren't met, not to fail.

I wrote a little script, that creates a ipython*.xz, so I can build a
random snapshot from ipython as a rpm package and install it properly
to run iptest on it.

Now the failures are down to 2, hopefully, you see, why they are
failing:

$ /usr/bin/python /usr/lib/python2.6/site-packages/IPython/testing/iptest.py
IPython.core
>f2("a b c")
>f1("a", "b", "c")
>f1(1,2,3)
>f2(4)
..............................Out[85]: 'get_ipython().system("true ")\n'
Out[87]: 'get_ipython().system("d:/cygwin/top ")\n'
Out[88]: 'no change'
Out[89]: '"no change"\n'
Out[91]: 'get_ipython().system("true")\n'
Out[92]: Out[93]: 'get_ipython().magic("sx  true")\n'
Out[94]: Out[95]: 'get_ipython().magic("sx true")\n'
Out[97]: 'get_ipython().magic("lsmagic ")\n'
Out[99]: 'get_ipython().magic("lsmagic ")\n'
Out[101]: 'get_ipython().system(" true")\n'
Out[103]: 'x=1 # what?\n'
   File "<ipython console>", line 2
     !true
     ^
SyntaxError: invalid syntax

Out[105]: 'if 1:\n    !true\n'
Out[107]: 'if 1:\n    lsmagic\n'
Out[109]: 'if 1:\n    an_alias\n'
Out[111]: 'if 1:\n    get_ipython().system("true")\n'
Out[113]: 'if 2:\n    get_ipython().magic("lsmagic ")\n'
Out[115]: 'if 1:\n    get_ipython().system("true ")\n'
Out[116]: Out[117]: 'if 1:\n    get_ipython().magic("sx true")\n'
   File "<ipython console>", line 2
     /fun 1 2
     ^
SyntaxError: invalid syntax

Out[119]: 'if 1:\n    /fun 1 2\n'
   File "<ipython console>", line 2
     ;fun 1 2
     ^
SyntaxError: invalid syntax

Out[121]: 'if 1:\n    ;fun 1 2\n'
   File "<ipython console>", line 2
     ,fun 1 2
     ^
SyntaxError: invalid syntax

Out[123]: 'if 1:\n    ,fun 1 2\n'
   File "<ipython console>", line 2
     ?fun 1 2
     ^
SyntaxError: invalid syntax

Out[125]: 'if 1:\n    ?fun 1 2\n'
   File "<ipython console>", line 1
     len "abc"
             ^
SyntaxError: invalid syntax

Out[127]: 'len "abc"\n'
>autocallable()
Out[128]: 'called'
Out[129]: 'autocallable()\n'
>list("1", "2", "3")
Out[131]: 'list("1", "2", "3")\n'
>list("1 2 3")
Out[132]: ['1', ' ', '2', ' ', '3']
Out[133]: 'list("1 2 3")\n'
>len(range(1,4))
Out[134]: 3
Out[135]: 'len(range(1,4))\n'
>list("1", "2", "3")
Out[137]: 'list("1", "2", "3")\n'
>list("1 2 3")
Out[138]: ['1', ' ', '2', ' ', '3']
Out[139]: 'list("1 2 3")\n'
>len(range(1,4))
Out[140]: 3
Out[141]: 'len(range(1,4))\n'
>len("abc")
Out[142]: 3
Out[143]: 'len("abc")\n'
>len("abc");
Out[145]: 'len("abc");\n'
>len([1,2])
Out[146]: 2
Out[147]: 'len([1,2])\n'
Out[148]: True
Out[149]: 'call_idx [1]\n'
>call_idx(1)
Out[150]: True
Out[151]: 'call_idx(1)\n'
Out[152]: <built-in function len>
Out[153]: 'len \n'
>list("1", "2", "3")
Out[155]: 'list("1", "2", "3")\n'
>list("1 2 3")
Out[156]: ['1', ' ', '2', ' ', '3']
Out[157]: 'list("1 2 3")\n'
>len(range(1,4))
Out[158]: 3
Out[159]: 'len(range(1,4))\n'
>len("abc")
Out[160]: 3
Out[161]: 'len("abc")\n'
>len("abc");
Out[163]: 'len("abc");\n'
>len([1,2])
Out[164]: 2
Out[165]: 'len([1,2])\n'
Out[166]: True
Out[167]: 'call_idx [1]\n'
>call_idx(1)
Out[168]: True
Out[169]: 'call_idx(1)\n'
>len()
Out[171]: 'len()\n'
..............................................S.......#     print "bar"
# 
..>f(1)
....................................................................................F.F..
======================================================================
FAIL: Test that object's __del__ methods are called on exit.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nose/case.py", line 186, in
runTest self.test(*self.arg)
  File
"/usr/lib/python2.6/site-packages/IPython/testing/decorators.py", line
225, in skipper_func return f(*args, **kwargs) File
"/usr/lib/python2.6/site-packages/IPython/core/tests/test_run.py", line
155, in test_obj_del tt.ipexec_validate(self.fname, 'object A deleted')
File "/usr/lib/python2.6/site-packages/IPython/testing/tools.py", line
252, in ipexec_validate nt.assert_equals(out.strip(),
expected_out.strip()) AssertionError: '\x1b[?1034hobject A deleted' !=
'object A deleted'
>>  raise self.failureException, \
          (None or '%r != %r' % ('\x1b[?1034hobject A deleted', 'object
A deleted')) 

======================================================================
FAIL: IPython.core.tests.test_run.TestMagicRunSimple.test_tclass
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/nose/case.py", line 186, in
runTest self.test(*self.arg)
  File
"/usr/lib/python2.6/site-packages/IPython/testing/decorators.py", line
225, in skipper_func return f(*args, **kwargs) File
"/usr/lib/python2.6/site-packages/IPython/core/tests/test_run.py", line
169, in test_tclass tt.ipexec_validate(self.fname, out) File
"/usr/lib/python2.6/site-packages/IPython/testing/tools.py", line 252,
in ipexec_validate nt.assert_equals(out.strip(), expected_out.strip())
AssertionError: "\x1b[?1034hARGV 1-: ['C-first']\nARGV 1-:
['C-second']\ntclass.py: deleting object: C-first" != "ARGV 1-:
['C-first']\nARGV 1-: ['C-second']\ntclass.py: deleting object: C-first"
>>  raise self.failureException, \
          (None or '%r != %r' % ("\x1b[?1034hARGV 1-: ['C-first']\nARGV
1-: ['C-second']\ntclass.py: deleting object: C-first", "ARGV 1-:
['C-first']\nARGV 1-: ['C-second']\ntclass.py: deleting object:
C-first")) 

----------------------------------------------------------------------
Ran 180 tests in 1.735s

FAILED (SKIP=1, failures=2)


	Thomas



More information about the IPython-dev mailing list