bobber6467 / python-nose

Automatically exported from code.google.com/p/python-nose
0 stars 0 forks source link

Test failures with Python 3 #387

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Tests of Nose 1.0.0 fail with Python 3.1 and 3.2. I use Gentoo Linux.

$ python3.1 setup.py build
...
$ PYTHONPATH=build/lib python3.1 setup.py test
...
running egg_info
creating /tmp/nose-1.0.0/build/lib/nose.egg-info
writing /tmp/nose-1.0.0/build/lib/nose.egg-info/PKG-INFO
writing top-level names to /tmp/nose-1.0.0/build/lib/nose.egg-info/top_level.txt
writing dependency_links to 
/tmp/nose-1.0.0/build/lib/nose.egg-info/dependency_links.txt
writing entry points to /tmp/nose-1.0.0/build/lib/nose.egg-info/entry_points.txt
writing manifest file '/tmp/nose-1.0.0/build/lib/nose.egg-info/SOURCES.txt'
reading manifest file '/tmp/nose-1.0.0/build/lib/nose.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'doc/.build'
writing manifest file '/tmp/nose-1.0.0/build/lib/nose.egg-info/SOURCES.txt'
running build_py
running egg_info
writing /tmp/nose-1.0.0/build/lib/nose.egg-info/PKG-INFO
writing top-level names to /tmp/nose-1.0.0/build/lib/nose.egg-info/top_level.txt
writing dependency_links to 
/tmp/nose-1.0.0/build/lib/nose.egg-info/dependency_links.txt
writing entry points to /tmp/nose-1.0.0/build/lib/nose.egg-info/entry_points.txt
reading manifest file '/tmp/nose-1.0.0/build/lib/nose.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'doc/.build'
writing manifest file '/tmp/nose-1.0.0/build/lib/nose.egg-info/SOURCES.txt'
running build_ext
/tmp/nose-1.0.0/build/lib/nose/config.py:258: RuntimeWarning: Option 
'doctest-extension' in config file 'setup.cfg' ignored: excluded by runtime 
environment
  warn(msg, RuntimeWarning)
/tmp/nose-1.0.0/build/lib/nose/config.py:258: RuntimeWarning: Option 
'doctest-fixtures' in config file 'setup.cfg' ignored: excluded by runtime 
environment
  warn(msg, RuntimeWarning)
/tmp/nose-1.0.0/build/lib/nose/config.py:258: RuntimeWarning: Option 
'with-doctest' in config file 'setup.cfg' ignored: excluded by runtime 
environment
  warn(msg, RuntimeWarning)
test_empty_zero_nine_does_not_crash (test_zeronine.TestEmptyPlugin) ... ERROR
runTest (test_attribute_plugin.TestAttributeArray) ... ok
runTest (test_attribute_plugin.TestAttributeArrayAnd) ... ok
runTest (test_attribute_plugin.TestAttributeArrayOr) ... ok
runTest (test_attribute_plugin.TestAttributeEval) ... ok
runTest (test_attribute_plugin.TestAttributeValue) ... ok
runTest (test_attribute_plugin.TestNotSimpleAttribute) ... ok
runTest (test_attribute_plugin.TestSimpleAttribute) ... ok
test_run_buggy_generators (test_buggy_generators.TestBuggyGenerators) ... ok
Traceback (most recent call last):
  File "/tmp/nose-1.0.0/build/lib/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/tmp/nose-1.0.0/build/lib/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)                
  File "/tmp/nose-1.0.0/build/lib/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/tmp/nose-1.0.0/build/tests/functional_tests/test_cases.py", line 3, in <module>
    from nose import case
ImportError: cannot import name case

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 122, in <module>
    **addl_args
  File "/tmp/nose-1.0.0/setup3lib.py", line 140, in setup
    return _setup(*args, **kwargs)
  File "/usr/lib64/python3.1/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/lib64/python3.1/distutils/dist.py", line 919, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.1/distutils/dist.py", line 938, in run_command
    cmd_obj.run()
  File "/tmp/nose-1.0.0/setup3lib.py", line 133, in run
    setuptools.command.test.test.run(self)
  File "/usr/lib64/python3.1/site-packages/setuptools/command/test.py", line 137, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/usr/lib64/python3.1/site-packages/setuptools/command/test.py", line 117, in with_project_on_sys_path
    func()
  File "/usr/lib64/python3.1/site-packages/setuptools/command/test.py", line 146, in run_tests
    testLoader = loader_class()
  File "/usr/lib64/python3.1/unittest.py", line 1566, in __init__
    self.runTests()
  File "/usr/lib64/python3.1/unittest.py", line 1611, in runTests
    self.result = testRunner.run(self.test)
  File "/usr/lib64/python3.1/unittest.py", line 1483, in run
    test(result)
  File "/usr/lib64/python3.1/unittest.py", line 1138, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib64/python3.1/unittest.py", line 1134, in run
    test(result)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 581, in __call__
    return self.run(*arg, **kw)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 589, in run
    return self.suite(*arg, **kw)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 177, in __call__
    return self.run(*arg, **kw)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 224, in run
    test(orig)
  File "/usr/lib64/python3.1/unittest.py", line 1138, in __call__
    return self.run(*args, **kwds)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 75, in run
    test(result)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 177, in __call__
    return self.run(*arg, **kw)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 217, in run
    for test in self._tests:
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 372, in _get_wrapped_tests
    for test in self._get_tests():
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 99, in _get_tests
    for test in self.test_generator:
  File "/tmp/nose-1.0.0/build/lib/nose/loader.py", line 164, in loadTestsFromDir
    entry_path, discovered=True)
  File "/tmp/nose-1.0.0/build/lib/nose/loader.py", line 399, in loadTestsFromName
    address=addr.totuple())])
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 427, in __call__
    return self.makeSuite(tests, context, **kw)
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 482, in makeSuite
    for ancestor in self.ancestry(context):
  File "/tmp/nose-1.0.0/build/lib/nose/suite.py", line 453, in ancestry
    yield resolve_name('.'.join(ancestors))
  File "/tmp/nose-1.0.0/build/lib/nose/util.py", line 331, in resolve_name
    obj = getattr(obj, part)
AttributeError: 'module' object has no attribute 'failure'

Original issue reported on code.google.com by Arfrever...@gmail.com on 18 Dec 2010 at 5:17

GoogleCodeExporter commented 8 years ago
Before running 'PYTHONPATH=build/lib python3.1 setup.py test' command, 
'PYTHONPATH=build/lib python3.1 bin/nosetests' fails with 'ValueError: Working 
directory build/tests not found, or not a directory'.

After running 'PYTHONPATH=build/lib python3.1 setup.py test' command, there are 
6 errors and 8 failures. I'm attaching output of 'PYTHONPATH=build/lib 
python3.1 bin/nosetests'.

Original comment by Arfrever...@gmail.com on 18 Dec 2010 at 5:29

Attachments:

GoogleCodeExporter commented 8 years ago
Note for the reporter -- I was able to work around this issue by running
 export PYTHONPATH=`pwd`/build/lib
 python3 setup.py build_tests
 python3 selftest.py

I don't believe the export of PYTHONPATH was necessary (just running the tests 
via selftest.py).

I then ran into different issues with python-3.2, however.  I'll be opening a 
separate issue for those errors.

Original comment by a.bad...@gmail.com on 3 Jan 2011 at 11:19

GoogleCodeExporter commented 8 years ago
You have to run nose's own tests with tox or selftest.py, otherwise proper 
builds of python3 may not be done.

Original comment by jpelle...@gmail.com on 8 Feb 2011 at 3:51

GoogleCodeExporter commented 8 years ago
these are the proper commands to run:

python3.1 setup.py build_tests
python3.1 selftest.py

Original comment by kumar.mcmillan on 8 Feb 2011 at 8:37