bobber6467 / python-nose

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

Solve Python 3 deprecation warnings in nose code #363

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run nose with `python -3`

What is the expected output? What do you see instead?
No deprecation warnings.

What version of the product are you using? On what operating system?
0.11.4

Please provide any additional information below.
A good idea would be to add `-3` parameter to the shebang or enable it from the 
code.

Example (they may be more):

/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/util.py:14: 
DeprecationWarning: the compiler package has been removed in Python 3.0
  from compiler.consts import CO_GENERATOR
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/plugins/__init__.py
:156: DeprecationWarning: the cPickle module has been removed in Python 3.0
  from nose.plugins.manager import *
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/plugins/prof.py:14:
 DeprecationWarning: The 'hotshot' module is not supported in 3.x, use the 
'profile' module instead.
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/loader.py:302: 
DeprecationWarning: the cmp argument is not supported in 3.x
  test_classes.sort(lambda a, b: cmp(a.__name__, b.__name__))
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/loader.py:303: 
DeprecationWarning: the cmp argument is not supported in 3.x
  test_funcs.sort(cmp_lineno)
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/loader.py:131: 
DeprecationWarning: the cmp argument is not supported in 3.x
  entries.sort(lambda a, b: match_last(a, b, self.config.testMatch))
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/suite.py:104: 
DeprecationWarning: callable() not supported in 3.x; use hasattr(o, '__call__')
  if callable(tests) and not is_suite:
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/suite.py:537: 
DeprecationWarning: callable() not supported in 3.x; use hasattr(o, '__call__')
  if callable(tests) or isinstance(tests, unittest.TestSuite):
/Library/Python/2.6/site-packages/nose-0.11.4-py2.6.egg/nose/suite.py:454: 
DeprecationWarning: callable() not supported in 3.x; use hasattr(o, '__call__')
  if callable(tests) or isinstance(tests, unittest.TestSuite):

Original issue reported on code.google.com by sorin.sb...@gmail.com on 15 Sep 2010 at 10:14

GoogleCodeExporter commented 8 years ago
What's the state of this?

Will there be a python3 support in one tarball or what do you plan to support 
python3?

Original comment by thomas.s...@gmail.com on 26 Oct 2010 at 10:57

GoogleCodeExporter commented 8 years ago
What's the state of this?

Will there be a python3 support in one tarball or what do you plan to support 
python3?

Original comment by thomas.s...@gmail.com on 26 Oct 2010 at 11:01

GoogleCodeExporter commented 8 years ago
We use 2to3 for Python 3 support and I think it has improved quite a lot since 
you ran python -3 here.  I just checked the converted source in Python 3.2 and 
I don't see any of this code problems that are referenced above in the warnings.

If there is something specific you see a warning about in Python 3 we can add a 
patch to the 2to3 conversion process.  Alternatively you can also filter out 
deprecation warnings in your program.  I'm going to close this issue for now 
since it will be a long road before we can support 2 and 3 in a single source 
file.  As of right now it should work in Python 3 though.

Original comment by kumar.mcmillan on 19 Mar 2011 at 5:37