Run py.test on Windows Anaconda and MinGW

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.

The executable file was * .bat

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.

Ported version 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.

Another solution

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

Run py.test on Windows Anaconda and MinGW
Run flake8 and pytest on GitLab CI
Anaconda on Windows Terminal
Install Anaconda on Windows 10
Install and run Python3.5 + NumPy + SciPy on Windows 10
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Run Jupyter on Ubuntu on Windows
Run Openpose on Python (Windows)
Install cvxpy on windows, Anaconda
Notes on installing Anaconda 3 on Windows
Run Jupyter Notebook on windows
Python 3.6 on Windows ... and to Xamarin.
Anaconda python environment construction on Windows 10
Install and run dropbox on Ubuntu 20.04
Run Tensorflow natively supported on windows
Build and install OpenCV on Windows
Integrate Modelica and Python on Windows
Use Tensorflow 2.1.0 with Anaconda on Windows 10!
Mastering pip and wheel on windows
Run XGBoost on Bash on Ubuntu on Windows
Install PyStan on Windows without Anaconda
Install easy_install and pip on windows
[UE4] Build DedicatedServer on Windows and Linux
Run Radeon GPU on Windows on QEMU / KVM
Run servo with Python on ESP32 (Windows)
docker and PyCharm under proxy on windows
Install wsl2 and master linux on windows
Run matplotlib on a Windows Docker container
A story about trying to run JavaScripthon on Windows and giving up.
Run PIFuHD in Windows + Anaconda + Git Bash environment
Run django applications on Windows + Apache + mod_wsgi + services.
Put MicroPython on Windows to run ESP32 on Python
Python on Windows
(Windows) Causes and workarounds for UnicodeEncodeError on Python 3
Notes on installing Python3 and using pip on Windows7
Run yolov4 "for the time being" on windows
Run OpenVino on macOS and pyenv and pipenv environment
[Python] How to install OpenCV on Anaconda [Windows]
[Note] Installing Python 3.6 + α on Windows and RHEL
How to install / verify graphviz on anaconda / windows10
Install ZIP version Python and pip on Windows 10
Until you create a machine learning environment with Python on Windows 7 and run it
Run the flask app on Cloud9 and Apache Httpd
Create and run Discord Bot on one Android device
Run Kali Linux on Windows with GUI (without VirtualBox)
Run Tensorflow from Jupyter Notebook on Bash on Ubuntu on Windows
Install Apache 2.4 on Ubuntu 19.10 Eoan Ermine and run CGI
[Windows] [Python3] Install python3 and Jupyter Notebook (formerly ipython notebook) on Windows
Install Docker on Arch Linux and run it remotely
How to run Django on IIS on a Windows server
Create a decent shell and python environment on Windows
Install django on python + anaconda and start the server
I tried to install scrapy on Anaconda and couldn't
Make anaconda environment available from command prompt on windows
Pylint on Windows Atom
Linux (WSL) on Windows
Run Django on PythonAnywhere
Run mysqlclient on Lambda
python basic on windows ②
Install python on windows
Install pycuda on Windows10