Pytest instalado pero ejecutando pytest en bash devuelve no encontrado

[root@izbp1jfqk9lif6vh3vclhkz site-packages]# pytest
-bash: pytest: command not found

Prueba python -m pytest

La instalación de pytest a través de pip no lo convertirá en un comando del sistema, pero lo instalará en python. El comando -m ejecuta pytest como su propio comando, y luego los scripts posteriores se tomarán como parámetros.

[root@izbp1jfqk9lif6vh3vclhkz test]# python -m pytest test_01.py
======================================================================== test session starts ========================================================================
platform linux -- Python 3.7.4, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /root/test
plugins: allure-pytest-2.8.19
collected 2 items

test_01.py ..                                                                                                                                                 [100%]

========================================================================= 2 passed in 0.05s =========================================================================
[root@izbp1jfqk9lif6vh3vclhkz test]#

Terminado, fichar y salir del trabajo

Supongo que te gusta

Origin blog.csdn.net/chuancheng_zeng/article/details/109689657
Recomendado
Clasificación