You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by Apache Bloodhound <de...@bloodhound.apache.org> on 2013/11/01 18:21:16 UTC

[Apache Bloodhound] #706: Unable to import tests.env module in python 2.6 - after r1536964

#706: Unable to import tests.env module in python 2.6 - after r1536964
---------------------+---------------
  Reporter:  olemis  |    Owner:
      Type:  defect  |   Status:  new
  Priority:  major   |  Version:
Resolution:          |
---------------------+---------------
 After the unification of `unittest` imports made in r1536964 it is
 impossible to import in python 2.6 the module `tests.env` since the
 statement `from unittest.case import _AssertRaisesContext` will fail.

 {{{#!sh

 $ python setup.py test -m tests.env
 running test
 running egg_info
 writing requirements to BloodhoundTheme.egg-info/requires.txt
 writing BloodhoundTheme.egg-info/PKG-INFO
 writing top-level names to BloodhoundTheme.egg-info/top_level.txt
 writing dependency_links to BloodhoundTheme.egg-info/dependency_links.txt
 writing entry points to BloodhoundTheme.egg-info/entry_points.txt
 writing requirements to BloodhoundTheme.egg-info/requires.txt
 writing BloodhoundTheme.egg-info/PKG-INFO
 writing top-level names to BloodhoundTheme.egg-info/top_level.txt
 writing dependency_links to BloodhoundTheme.egg-info/dependency_links.txt
 writing entry points to BloodhoundTheme.egg-info/entry_points.txt
 reading manifest file 'BloodhoundTheme.egg-info/SOURCES.txt'
 reading manifest template 'MANIFEST.in'
 warning: no directories found matching 'bhtheme/htdocs/images'
 writing manifest file 'BloodhoundTheme.egg-info/SOURCES.txt'
 running build_ext
 Traceback (most recent call last):
   File "setup.py", line 64, in <module>
     **extra
   File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
     dist.run_commands()
   File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
     self.run_command(cmd)
   File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
     cmd_obj.run()
   File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line
 121, in run
   File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line
 101, in with_project_on_sys_path
   File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line
 135, in run_tests
   File "/usr/lib/python2.6/unittest.py", line 816, in __init__
     self.parseArgs(argv)
   File "/usr/lib/python2.6/unittest.py", line 843, in parseArgs
     self.createTests()
   File "/usr/lib/python2.6/unittest.py", line 849, in createTests
     self.module)
   File "/usr/lib/python2.6/unittest.py", line 613, in loadTestsFromNames
     suites = [self.loadTestsFromName(name, module) for name in names]
   File "/usr/lib/python2.6/unittest.py", line 584, in loadTestsFromName
     parent, obj = obj, getattr(obj, part)
 AttributeError: 'module' object has no attribute 'env'

 $ python
 Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
 [GCC 4.4.3] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import bhrelations.tests
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "bhrelations/tests/__init__.py", line 28, in <module>
     from bhrelations.tests import api, notification, search, validation,
 web_ui
   File "bhrelations/tests/api.py", line 26, in <module>
     from bhrelations.tests.base import BaseRelationsTestCase
   File "bhrelations/tests/base.py", line 19, in <module>
     from tests.env import MultiproductTestCase
   File "/path/to/bloodhound/bloodhound_multiproduct/tests/env.py", line
 29, in <module>
     from unittest.case import _AssertRaisesContext
 ImportError: No module named case
 >>>
 }}}

 In version 2.6 `unittest` is still a single .py file and thereby there's
 no such module `unittest.case` . The correct name would be
 `unittest2.case` instead.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/706>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #706: Unable to import tests.env module in python 2.6 - after r1536964

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#706: Unable to import tests.env module in python 2.6 - after r1536964
---------------------------+-----------------------
  Reporter:  olemis        |      Owner:  rjollos
      Type:  defect        |     Status:  review
  Priority:  major         |  Milestone:  Release 8
 Component:  multiproduct  |    Version:
Resolution:                |   Keywords:  qa
---------------------------+-----------------------
Changes (by olemis):

 * owner:  olemis => rjollos
 * status:  accepted => review


Comment:

 Attached patch will fix this issue , see comment:38:ticket:694 for further
 details

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/706#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #706: Unable to import tests.env module in python 2.6 - after r1536964

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#706: Unable to import tests.env module in python 2.6 - after r1536964
---------------------------+-----------------------
  Reporter:  olemis        |      Owner:  olemis
      Type:  defect        |     Status:  closed
  Priority:  major         |  Milestone:  Release 8
 Component:  multiproduct  |    Version:
Resolution:  fixed         |   Keywords:  qa
---------------------------+-----------------------
Changes (by rjollos):

 * owner:  rjollos => olemis


-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/706#comment:4>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #706: Unable to import tests.env module in python 2.6 - after r1536964

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#706: Unable to import tests.env module in python 2.6 - after r1536964
---------------------------+-----------------------
  Reporter:  olemis        |      Owner:  rjollos
      Type:  defect        |     Status:  closed
  Priority:  major         |  Milestone:  Release 8
 Component:  multiproduct  |    Version:
Resolution:  fixed         |   Keywords:  qa
---------------------------+-----------------------
Changes (by rjollos):

 * status:  review => closed
 * resolution:   => fixed


Comment:

 (In [1539084])

 0.8dev: Fixed regression in r1536964. Refs #706.

 `_AssertRaisesContext` can't be imported from `unittest.case` in Python
 2.6. Patch by Olemis Lang.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/706#comment:3>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #706: Unable to import tests.env module in python 2.6 - after r1536964

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#706: Unable to import tests.env module in python 2.6 - after r1536964
---------------------------+-----------------------
  Reporter:  olemis        |      Owner:  olemis
      Type:  defect        |     Status:  accepted
  Priority:  major         |  Milestone:  Release 8
 Component:  multiproduct  |    Version:
Resolution:                |   Keywords:  qa
---------------------------+-----------------------
Changes (by olemis):

 * owner:   => olemis
 * status:  new => accepted
 * component:   => multiproduct
 * keywords:   => qa
 * milestone:   => Release 8


-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/706#comment:1>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker