CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
792 stars 75 forks source link

TypeError: __init__() takes at most 5 arguments (6 given) in subprocess.py #63

Closed smspillaz closed 9 years ago

smspillaz commented 9 years ago

I'm getting the following traceback on pypy3

Traceback (most recent call last):
  File "/home/travis/build/polysquare/polysquare-ci-scripts/setup.py", line 44, in <module>
    include_package_data=True)
  File "/opt/python/pypy3-2.4.0/lib-python/3/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/opt/python/pypy3-2.4.0/lib-python/3/distutils/dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "/opt/python/pypy3-2.4.0/lib-python/3/distutils/dist.py", line 936, in run_command
    cmd_obj.run()
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/setuptools_green/__init__.py", line 34, in run
    sys.exit(green.cmdline.main())
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/green/cmdline.py", line 87, in main
    result = run(test_suite, stream, args) # pragma: no cover
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/green/runner.py", line 52, in run
    pool = LoggingDaemonlessPool(processes=args.subprocesses or None)
  File "/home/travis/virtualenv/pypy3-2.4.0/site-packages/green/subprocess.py", line 98, in __init__
    initargs, maxtasksperchild, context)
TypeError: __init__() takes at most 5 arguments (6 given)
e3krisztian commented 9 years ago

context is optional in multiprocessing.Pool.__init__ and not used in green at all.

Would it do any harm if removed from LoggingDaemonlessPool.__init__?

CleanCut commented 9 years ago

@smspillaz

First, I'm not at all surprised that pypy3 crashed, as pypy3 targets the functionality of CPython 3.2.5, and CPython 3.2.0 was so hilariously awful from an implementing-green-point-of-view that I never even attempted it. (Green officially supports CPython 2.7, 3.4+, and pypy)

Second, I was absolutely shocked that pypy3 passed all of green's unit tests once this issue you pointed out was addressed. Either a lot of things changed between CPython 3.2.0 and 3.2.5, or pypy3 has just done an excellent job of adopting post-3.2 behavior.

Third, I took the advice of @krisztianfekete and just stopped attempting to pass-thru context. It's a slightly simpler fix for the moment (unless we start using context in the future).

It looks like I should be able to put this out in a 1.11.0 release later today.