Unit test errors on Python 2.6

Bug #901730 reported by Lorin Hochstein
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Mark McLoughlin

Bug Description

Some unit tests are erroring out on Python 2.6.x because its unittest doesn't have a skip method:

To replicate (Python 2.6.6 on RHEL 6.1):

$ ./run_tests.sh test_cfg
Failure
    runTest ERROR

======================================================================
ERROR: Failure: AttributeError ('module' object has no attribute 'skip')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/lorin/nova/.nova-venv/lib/python2.6/site-packages/nose/loader.py", line 379, in loadTestsFromName
    module = resolve_name(addr.module)
  File "/home/lorin/nova/.nova-venv/lib/python2.6/site-packages/nose/util.py", line 321, in resolve_name
    module = __import__('.'.join(parts_copy))
  File "/home/lorin/nova/nova/tests/test_cfg.py", line 155, in <module>
    class ConfigFileOptsTestCase(BaseTestCase):
  File "/home/lorin/nova/nova/tests/test_cfg.py", line 340, in ConfigFileOptsTestCase
    @unittest.skip('FIXME(markmc): values spread across the CLI and multiple '
AttributeError: 'module' object has no attribute 'skip'

----------------------------------------------------------------------
Ran 1 test in 0.001s

FAILED (errors=1)

Revision history for this message
Soren Hansen (soren) wrote :

Fixing that is simple enough (replace unittest.skip with test.skip_test), but there's 38 other errors that I think are due to python2.6 compatibility. :(

Revision history for this message
Kevin L. Mitchell (klmitch) wrote :

To summarize:

* ConfigParser.SafeConfigParser() does not take allow_no_value as a keyword argument (nova/common/cfg.py:1019, _parse_config_files()
* There is no assertRaisesRegexp() in Python 2.6 (nova/tests/test_cfg.py:135, 143, 598, 608, 623, 629, 640, 653, 663, 679, 685, 712, 717, 723, 728)
* There is no assertIsNone() in Python 2.6 (nova/tests/test_cfg.py:785, 786, 787)

Revision history for this message
Vish Ishaya (vishvananda) wrote : Re: [Bug 901730] [NEW] Unit test errors on Python 2.6
Download full text (3.2 KiB)

eww.

We need jenkinst to run unittests on 2.6 as well so we stop breaking this.

On Dec 8, 2011, at 7:55 AM, Lorin Hochstein wrote:

> Public bug reported:
>
> Some unit tests are erroring out on Python 2.6.x because its unittest
> doesn't have a skip method:
>
> To replicate (Python 2.6.6 on RHEL 6.1):
>
> $ ./run_tests.sh test_cfg
> Failure
> runTest ERROR
>
> ======================================================================
> ERROR: Failure: AttributeError ('module' object has no attribute 'skip')
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/lorin/nova/.nova-venv/lib/python2.6/site-packages/nose/loader.py", line 379, in loadTestsFromName
> module = resolve_name(addr.module)
> File "/home/lorin/nova/.nova-venv/lib/python2.6/site-packages/nose/util.py", line 321, in resolve_name
> module = __import__('.'.join(parts_copy))
> File "/home/lorin/nova/nova/tests/test_cfg.py", line 155, in <module>
> class ConfigFileOptsTestCase(BaseTestCase):
> File "/home/lorin/nova/nova/tests/test_cfg.py", line 340, in ConfigFileOptsTestCase
> @unittest.skip('FIXME(markmc): values spread across the CLI and multiple '
> AttributeError: 'module' object has no attribute 'skip'
>
> ----------------------------------------------------------------------
> Ran 1 test in 0.001s
>
> FAILED (errors=1)
>
> ** Affects: nova
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> OpenStack Compute (nova).
> https://bugs.launchpad.net/bugs/901730
>
> Title:
> Unit test errors on Python 2.6
>
> Status in OpenStack Compute (Nova):
> New
>
> Bug description:
> Some unit tests are erroring out on Python 2.6.x because its unittest
> doesn't have a skip method:
>
> To replicate (Python 2.6.6 on RHEL 6.1):
>
> $ ./run_tests.sh test_cfg
> Failure
> runTest ERROR
>
> ======================================================================
> ERROR: Failure: AttributeError ('module' object has no attribute 'skip')
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/lorin/nova/.nova-venv/lib/python2.6/site-packages/nose/loader.py", line 379, in loadTestsFromName
> module = resolve_name(addr.module)
> File "/home/lorin/nova/.nova-venv/lib/python2.6/site-packages/nose/util.py", line 321, in resolve_name
> module = __import__('.'.join(parts_copy))
> File "/home/lorin/nova/nova/tests/test_cfg.py", line 155, in <module>
> class ConfigFileOptsTestCase(BaseTestCase):
> File "/home/lorin/nova/nova/tests/test_cfg.py", line 340, in ConfigFileOptsTestCase
> @unittest.skip('FIXME(markmc): values spread across the CLI and multiple '
> AttributeError: 'module' object has no attribute 'skip'
>
> ----------------------------------------------------------------------
> Ran 1 test in 0.001s
>
> FAILED (errors=1)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nova...

Read more...

Revision history for this message
Kevin L. Mitchell (klmitch) wrote :

Vish: +10000; this kind of breakage happens all the time.

Revision history for this message
Lorin Hochstein (lorinh) wrote :

Vish, Kevin: I filed a bug with openstack-ci about Jenkins running unit tests against 2.6.

https://bugs.launchpad.net/openstack-ci/+bug/901952

Revision history for this message
Lorin Hochstein (lorinh) wrote :
Changed in nova:
status: New → Fix Committed
assignee: nobody → Mark McLoughlin (markmc)
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.