Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test suite fails to run on Python 3.3 with error: loader cannot handle py.test #440

Closed
danc86 opened this issue Nov 26, 2012 · 1 comment

Comments

@danc86
Copy link
Contributor

danc86 commented Nov 26, 2012

To run the test suite, setup.py invokes [sys.executable, '-m', 'py.test']. But that doesn't work on Python 3.3 with py.test 2.3.2:

# python3 -m py.test
/usr/bin/python3: loader cannot handle py.test

It seems the new preferred module name is pytest instead of py.test. That works for me:

# python3 -m pytest
======================================= test session starts ========================================
platform linux -- Python 3.3.0 -- pytest-2.3.2
...

I'm not sure why this breaks in Python 3.3 (it works as is in Python 3.2).

@danc86
Copy link
Contributor Author

danc86 commented Nov 26, 2012

Fix is easy:

diff -ur gunicorn-0.16.1.orig/setup.py gunicorn-0.16.1/setup.py
--- gunicorn-0.16.1.orig/setup.py   2012-11-19 20:49:05.000000000 +1000
+++ gunicorn-0.16.1/setup.py    2012-11-26 16:43:21.992259334 +1000
@@ -56,7 +56,7 @@

     def run(self):
         import sys,subprocess
-        basecmd = [sys.executable, '-m', 'py.test']
+        basecmd = [sys.executable, '-m', 'pytest']
         if self.cov:
             basecmd += ['--cov', 'gunicorn']
         errno = subprocess.call(basecmd + ['tests'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants