Python-related environment:
1.Windows 10
2.JDK 1.8
3.Python 3.7.2
4.Pip 18.1 from c:\python37\lib\site-packages\pip (python 3.7)
5.Eclipse
Pytest + allure installation procedure: a Link Reference: https://blog.csdn.net/liudinglong1989/article/details/83023886
1. Install pytest
Command in the CMD PIP pytest install , the installation is successful, Version: 5.2.2
2. Install allure
According to a guide link installation
Download allure archive, Version: 2.7.0
In the catalog extracting archive
Set system environment variables: the bin directory pointing allure
3. Installation pytest-allure-adaptor
Run pip install pytest-allure-adaptor, the installation is successful, the version number of the next CMD: 1.7.10
Problem Procedure:
1. Write a script basis in Eclipse, click Run as Python Run
Script is as follows:
2. given the wrong one: After performing found error, the error message is as follows:
pluggy.manager.PluginValidationError: unknown hook 'pytest_namespace' in plugin <module 'allure.pytest_plugin' from 'C:\\Users\\wenqi\\AppData\\Roaming\\Python\\Python37\\site-packages\\allure\\pytest_plugin.py'>
Online to find the error message, all tips are too high lead to pytest version, version 4.0.2 is recommended to install pytest low
2.1 Uninstall pytest high version: pip uninstall pytest
2.2 Installation pytest low version: pip install pytest == 4.0.2
(Installation process can not find the corresponding package through the company wif installation, can not find, and then by phone hotspot installation, the installation is successful, the specific reasons unknown)
2.3 given the wrong II: After installation, the version number of investigative pytest found given as follows:
TypeError: attrib() got an unexpected keyword argument 'convert'
3. Uninstall again pytest4.0.2, pytest reinstall the latest version, still being given eclipse run the program, with "a mistake"
4. continue to search for solutions on the Internet, link two: https://www.cnblogs.com/wsy1103/p/10530397.html have to introduce and pytest integration, you need to install allure-pytest
Continued trying to install: PIP Allure-pytest install , the installation is successful, Version: 2.8.6
5. In the Eclipse run the program, still being given, but this time and the error message "Error a" different, given information is as follows:
No module named 'allure.pytest_plugin'; 'allure' is not a package
6. Check online this error, the three links: https://www.cnblogs.com/lansan0701/p/10345142.html presentation, uninstall pytest-allure-adaptor, then install allure-pytest
Since allure-pytest installed, it is only unloaded pytest-allure-adaptor
7. After the uninstallation is successful, the program is executed in Eclipse, the program runs successfully found
Above, python + allure for the entire installation process, problems thinking process
Above, three green background installation for proper installation process