ValueError: need more than 2 values to unpack in Python 2.6.6
<p>i am getting error: ValueError: need more than 2 values to unpack
when i run the unit test now, so 2 failures and one skip
now as far as i have read about</p>

<pre>
lambda i: get_error_count(self._error_lookup, i))
</pre>

<p>line 142 of source is the method</p>

<pre>
for test, err, capt in errors:
</pre>

<p>which has the line of code:</p>

<pre>
count = get_error_count(i)
</pre>

<p><strong>reference</strong>
Python 3.0 has something a bit like this. Excess values can be bound
(as a list) to the last variable:</p>

<p>a,b,*c = [1,2,3,4,5]</p>

<p>will result in c containing [3,4,5].</p>

<p>In Python 2.x, you can't do that directly, but you should be able to
create a function that lengthens or shortens an input tuple of arguments
to the correct length so you can do:</p>

<pre>
a,c,b = fix(1,2)
d,e,f = fix(1,2,3,4)
</pre>

<p>However, the function won't know the length of the left hand side
sequence, so it will have to be passed in as an extra parameter or hard
coded.</p>

<p>so the</p>

<pre>
count = get_error_count(i)
uses only one variable, where as
def get_error_count(lookup, index):
takes on 2
</pre>

<p>What should i use as the second variable ? to fix this ?</p>

<p>Thanks,
-Kamal.</p>

<p>-------------------- >> begin captured stdout &lt;&lt; ---------------------</p>

<p>\
    test_many_errors.test_assert_one ... FAIL
    test_many_errors.test_one ... ok
    test_many_errors.test_assert_two ... ERROR
    test_many_errors.test_two ... ok
    test_many_errors.test_value_one ... ERROR
    test_many_errors.test_value_two ... SKIP: (, ValueError(), )
    test_many_errors.test_good_one ... ok
    test_many_errors.test_good_two ... ok</p>

<pre><code>Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/Current/bin/nosetests", line 10, in &lt;module&gt;
    sys.exit(run_exit())
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/nose/core.py", line 117, in __init__
    **extra_args)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/unittest.py", line 817, in __init__
    self.runTests()
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/nose/core.py", line 196, in runTests
    result = self.testRunner.run(self.test)
  File "/Library/Frameworks/Python.framework/Versions/6.3/lib/python2.6/site-packages/nose/core.py", line 63, in run
    result.printErrors()
  File "/NOSE_TRIM/nosetrim-read-only/nosetrim/nosetrim.py", line 136, in printErrors
    lambda i: get_error_count(self._error_lookup, i))
  File "/NOSE_TRIM/nosetrim-read-only/nosetrim/nosetrim.py", line 142, in printErrorList
    for test, err, capt in errors:
ValueError: need more than 2 values to unpack
</code></pre>

<p>/</p>

<p>--------------------- >> end captured stdout &lt;&lt; ----------------------</p>

<hr>

<p>Ran 3 tests in 1.263s</p>
