unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.45k stars 686 forks source link

Tests not passing with python3 #1507

Open BlackYoup opened 7 years ago

BlackYoup commented 7 years ago

Hi,

I'm having troubles to have tests pass with python 3. There are at least one test that doesn't pass. This seems to be caused by the print 'xxx' expression not being supported by python3. After a quick grep, I saw multiple tests having such statement. I also saw that print('xxx') is supported by both python2 and python3, is there a reason to not use it ? If not, I would be glad to open a PR for this :-)

Sorry if this has already been asked, I couldn't find such issue.

Here is the traceback of the first test that fails for me:

Traceback (most recent call last):
  File "setup.py", line 126, in <module>
    distclass=uWSGIDistribution,
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.6/site-packages/setuptools/command/test.py", line 211, in run
    self.run_tests()
  File "/usr/lib/python3.6/site-packages/setuptools/command/test.py", line 234, in run_tests
    **exit_kwarg
  File "/usr/lib/python3.6/unittest/main.py", line 93, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python3.6/unittest/main.py", line 123, in parseArgs
    self._do_discovery([])
  File "/usr/lib/python3.6/unittest/main.py", line 228, in _do_discovery
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/usr/lib/python3.6/unittest/loader.py", line 341, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib/python3.6/unittest/loader.py", line 398, in _find_tests
    full_path, pattern, namespace)
  File "/usr/lib/python3.6/unittest/loader.py", line 475, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/usr/lib/python3.6/site-packages/setuptools/command/test.py", line 43, in loadTestsFromModule
    tests.append(self.loadTestsFromName(submodule))
  File "/usr/lib/python3.6/unittest/loader.py", line 153, in loadTestsFromName
    module = __import__(module_name)
  File "/var/tmp/paludis/build/www-servers-uwsgi-2.0.15/work/PYTHON_ABIS/3.6/uwsgi-2.0.15/tests/websockets_echo.py", line 53
    print "websockets..."
SyntaxError: Missing parentheses in call to 'print'
fersarr commented 5 years ago

same in:

src/tests/cpubound_stackless.py", line 14
         |     print "DONE AT %d" % i
         |                      ^
         | SyntaxError: Missing parentheses in call to 'print'. Did you mean print("DONE AT %d" % i)?
fubingting commented 3 years ago

Are there any new developments in the test?