Pytest and Python 3
Solution 1:
I found a workaround:
- Installed
python3-pip
using aptitude, which created/usr/bin/pip-3.2
. - Next
pip-3.2 install pytest
which re-installed pytest, but under a python3.2 path. - Then I was able to use
python3 -m pytest somedir/sometest.py
.
Not as convenient as running py.test directly, but workable.
Solution 2:
python3 doesn't have the module py.test installed. If you can, install the python3-pytest
package.
If you can't do that try this:
- Install virtualenv
- Create a virtualenv for python3
virtualenv --python=python3 env_name
- Activate the virtualenv
source ./env_name/bin/activate
- Install py.test
pip install py.test
- Now using this virtualenv try to run your tests