mahmoudimus / nose-timer

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

EOFError #63

Closed Zitrax closed 9 years ago

Zitrax commented 9 years ago

I installed 0.4.4 and got the following when trying to run any nosetests:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
    prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 488, in prepare
    assert main_name not in sys.modules, main_name
AssertionError: __main__
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\nosetests.exe\__main__.py", line 9, in <module>
  File "C:\Python27\lib\site-packages\nose\core.py", line 121, in __init__
    **extra_args)
  File "C:\Python27\lib\unittest\main.py", line 94, in __init__
    self.parseArgs(argv)
  File "C:\Python27\lib\site-packages\nose\core.py", line 145, in parseArgs
    self.config.configure(argv, doc=self.usage())
  File "C:\Python27\lib\site-packages\nose\config.py", line 281, in configure
    options, args = self._parseArgs(argv, cfg_files)
  File "C:\Python27\lib\site-packages\nose\config.py", line 268, in _parseArgs
    self.getParser(), self.configSection, file_error=warn_sometimes)
  File "C:\Python27\lib\site-packages\nose\config.py", line 590, in getParser
    self.plugins.loadPlugins()
  File "C:\Python27\lib\site-packages\nose\plugins\manager.py", line 400, in loadPlugins
    plug = plugcls()
  File "C:\Python27\lib\site-packages\nosetimer\plugin.py", line 24, in __init__

    self._timed_tests = multiprocessing.Manager().dict()
  File "C:\Python27\lib\multiprocessing\__init__.py", line 99, in Manager
    m.start()
  File "C:\Python27\lib\multiprocessing\managers.py", line 528, in start
    self._address = reader.recv()
EOFError
mahmoudimus commented 9 years ago

Hi @Zitrax, from your traceback, I see C:\... which suggests that you're on a Windows platform, which we currently do not support. However, try pull request #60 and #62, by @ereOn, to see if this fixes the problem for you.

ereOn commented 9 years ago

@mahmoudimus Any reason to not support Windows ? Seems a bit weird to restrict a Python tool to a specific set of platforms especially when the fixes to make it work (even in a diminished capacity) are trivial.

I don't like Windows personally, but some people just don't have a choice. Do you plan to never support Windows ? If so please let me know, I'll be happy to fork.

mahmoudimus commented 9 years ago

I would love Windows support! However, I think the problem mostly stems from a couple of things:

That all being said, I would love an active co-maintainer that can help maintain Windows compatibility on this plugin. The operative word is active. Once it goes in, it has to continue being supported. Would you be up for it, @ereOn? Also, we would need help on windows support for the upcoming nose2 plugin.

mahmoudimus commented 9 years ago

@ereOn - maybe explore integrating http://www.appveyor.com/ ?

Zitrax commented 9 years ago

So I tried to clone the repo and install from source and then it worked fine. I have not verified the difference - but at least it worked.

One note though, on Windows color output will not work by default in cmd, so perhaps the --timer-no-color should be default on this platform ?

ereOn commented 9 years ago

@Zitrax : That's funny, because it is also a PR that I have that is pending (it's actually been a while) - See https://github.com/mahmoudimus/nose-timer/pull/61.

@mahmoudimus I sadly can't commit to maintain yet another project. That being said, it seems to me that if you have a good test coverage & continuous integration on Linux, you can still accept Windows contributions (you'll know for sure when something breaks on the Linux side, which is what you commit to support). Just specify in the README that Windows support is unofficially supported but that patches are welcome. You'll get the best of both worlds.

mahmoudimus commented 9 years ago

@e0ne, looks like @skudriashev granted your wish: https://github.com/mahmoudimus/nose-timer/pull/62#event-328729224 :-)

mahmoudimus commented 9 years ago

@Zitrax, pull from master for windows fix! @ereOn please submit a pull request adding yourself to the contributors list below :-)

ereOn commented 9 years ago

@mahmoudimus Done :)

mahmoudimus commented 9 years ago

@Zitrax @ereOn - This is solved by merging in pull requests #61, #62, and #64.

mahmoudimus commented 9 years ago

@Zitrax @e0ne with https://github.com/mahmoudimus/nose-timer/pull/65 merged, can you guys try 0.5 out to see if no regressions occurred?