A note of the problem that occurred when trying to use the Windows version of the Python distribution Anaconda where the scientific calculation library can be installed from MinGW.
When I installed pytest this time, C: /Anaconda/Scripts/py.test.bat
was generated.
In this case, it is possible to execute the py.test
command from the Windows command prompt, but I also wanted to execute the test on MinGW because python is always executed from the console of MinGW before git is also included. ..
The command itself is recognized, but of course it doesn't work with a Windows batch file. So I decided to port and use py.test
from another Linux environment.
py.test
Create C: /Anaconda/Scripts/py.test
as follows. Note that you should save it in LF using an editor that can handle line feed codes.
py.test
#!/usr/bin/env python
# EASY-INSTALL-ENTRY-SCRIPT: 'pytest==2.6.4','console_scripts','py.test'
__requires__ = 'pytest==2.6.4'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('pytest==2.6.4', 'console_scripts', 'py.test')()
)
The only point that was changed at the time of transplantation was the shebang on the first line. The original file contained the full path to bin / python
in the system.
For this pytest module, there is another solution that doesn't use the py.test
command. If you integrate it as python setup.py test
as shown below, it will be completed when the library is loaded.
http://pytest.org/latest/goodpractises.html
Recommended Posts