mahmoudimus / nose-timer

A timer plugin for nosetests (how much time does every test take?)
MIT License
126 stars 33 forks source link

doesn't work with python 3 #2

Closed joernhees closed 10 years ago

joernhees commented 11 years ago

$ pip install --use-mirrors --default-timeout 60 nose-timer Downloading/unpacking nose-timer Downloading nose-timer-0.1.2.tar.gz Running setup.py egg_info for package nose-timer Traceback (most recent call last): File "", line 16, in File "/home/travis/virtualenv/python3.2/build/nose-timer/setup.py", line 10 description=u'A timer plugin for nosetests', ^ SyntaxError: invalid syntax Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 16, in File "/home/travis/virtualenv/python3.2/build/nose-timer/setup.py", line 10 description=u'A timer plugin for nosetests', ^

SyntaxError: invalid syntax

Command python setup.py egg_info failed with error code 1 in /home/travis/virtualenv/python3.2/build/nose-timer

mahmoudimus commented 11 years ago

Thanks for reporting this. I'll take a look at it.

e0ne commented 11 years ago

It's not relevant to Python 3.3. Only for Python 3.0-3.2

e0ne commented 11 years ago

I added Python 3.3 suport in https://github.com/mahmoudimus/nose-timer/pull/5. I'm not sure that Python 3.0-3.2 support is needed

joernhees commented 11 years ago

well, as it is part of a testing framework i had expected it to work for every python version >= 2.5

many libraries out there still need to support older python versions...

e0ne commented 11 years ago

Agree, it's good practice to support all nose supported versions listed in https://github.com/nose-devs/nose/blob/master/tox.ini#L2

e0ne commented 11 years ago

@mahmoudimus what do you think about adding unit tests and setup https://travis-ci.org/ builds for nose-timer? I can create pull request for it

mahmoudimus commented 11 years ago

Ivan,

That sounds great!

Mahmoud Abdelkader http://mahmoudimus.com/blog

On Tue, Aug 27, 2013 at 12:31 PM, Ivan Kolodyazhny <notifications@github.com

wrote:

@mahmoudimus https://github.com/mahmoudimus what do you think about adding unit tests and setup https://travis-ci.org/ builds for nose-timer? I can create pull request for it

— Reply to this email directly or view it on GitHubhttps://github.com/mahmoudimus/nose-timer/issues/2#issuecomment-23363941 .

jsalvatier commented 10 years ago

Also another Python 3 related issue:

While running a bunch of tests:

Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.3/bin/nosetests", line 9, in <module>
    load_entry_point('nose==1.3.0', 'console_scripts', 'nosetests')()
  File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nose/core.py", line 118, in __init__
    **extra_args)
  File "/usr/lib/python3.3/unittest/main.py", line 125, in __init__
    self.runTests()
  File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nose/core.py", line 197, in runTests
    result = self.testRunner.run(self.test)
  File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nose/core.py", line 63, in run
    result.printErrors()
  File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nose/result.py", line 110, in printErrors
    self.config.plugins.report(self.stream)
  File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/home/travis/virtualenv/python3.3/lib/python3.3/site-packages/nosetimer/plugin.py", line 59, in report
    d = sorted(self._timed_tests.iteritems(),
AttributeError: 'dict' object has no attribute 'iteritems'

Here's the travis log: https://s3.amazonaws.com/archive.travis-ci.org/jobs/15466044/log.txt

e0ne commented 10 years ago

Tested with: py33: commands succeeded py27: commands succeeded py26: commands succeeded

gewthen commented 10 years ago

+1 to jsalvatier issue on 0.2.0. Ran into the same thing running python 3.4. The method errors by assuming it will be not called in python3.x. Iteritems is no longer supported in python 3.x (see http://docs.python.org/3.1/whatsnew/3.0.html#views-and-iterators-instead-of-lists). It looks like the issue is already in master. When do you think you could release an updated version with the fix on pypi?

e0ne commented 10 years ago

Actually, we've got broken python3 build in master:(. I could fix it separately or wait while @mahmoudimus will merge #25. Than new release could be published on PyPI.

skudriashev commented 10 years ago

25 is merged now. Is this still an issue?

mahmoudimus commented 10 years ago

@skudriashev it sounded like @joernhees wanted to support python 3 -> 3.2.

joernhees commented 10 years ago

yupp, i can only repeat... as this is a testing library it should support as many python versions as plausibly possible. A good selection might be: all versions supported by travis (2.6,2.7,3.2,3.3 for now)

mahmoudimus commented 10 years ago

@joernhees https://travis-ci.org/mahmoudimus/nose-timer supports testing for 2.6,2.7,3.2, and 3.3

I think that's reasonably acceptable. Can I close this issue as fixed by #25?

joernhees commented 10 years ago

yupp, i'll try it in rdflib, thanks

joernhees commented 10 years ago

@mahmoudimus could you actually make a new release for this soon?

mahmoudimus commented 10 years ago

yep

Mahmoud Abdelkader http://mahmoudimus.com/blog

On Mon, Mar 3, 2014 at 10:22 AM, Jörn Hees notifications@github.com wrote:

@mahmoudimus https://github.com/mahmoudimus could you actually make a new release for this soon?

Reply to this email directly or view it on GitHubhttps://github.com/mahmoudimus/nose-timer/issues/2#issuecomment-36540411 .

joernhees commented 10 years ago

awesome :)

mahmoudimus commented 10 years ago

@joernhees uploaded v0.3.0 to pypi -- tagged