Tag Archives: httprunner

[Solved] CentOS Install pycrypto Error: RuntimeError: autoconf error

Solution:  yum -y install gcc

 

File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-ydg0qryh/pycrypto/setup.py", line 251, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-ydg0qryh/pycrypto/setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error

----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ydg0qryh/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-544nn9hj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ydg0qryh/pycrypto/

Httprunner v3. X generates HTML report in assure format

This document records the process and steps of the initial report generation with allure.

Install allure first, download and configure the environment
reference documents:

https://www.cnblogs.com/wsy1103/p/10530397.html

After installation, the following steps begin:

Step 1: generate report data with assure. The generated report data includes two files: one JSON file and one TXT file.

Switch to D: Python/Test & gt; The following is implemented:

hrun test_post_api.json --alluredir=report

Step 2: create the report data generated just now with assure, generate the report2 folder, – O means to specify the folder to generate the report, – C means to clean up the previous report directory before generating the report.

allure generate D:\Python\test\report -o D:\Python\test\report2 -c

Then open the assure report using the default browser to view it.

allure open D:\Python\test\report2

end. The effect of successful generation:


[frequently asked questions]

1. If the error prompt oserror: [winerror 6] handle is invalid, please refer to the document for solution:

https://ask.csdn.net/questions/3017114

Add some code to runner. Py’s test_ Start method, and import colorama, Sys at the beginning of the file

2. If the Chinese encoding in the return body fails, please refer to the document for solution:

https://blog.csdn.net/zjxht62/article/details/116305944

Add some code to the log of client. Py_ In the print method, the default ASCII encoding is used for Chinese when json.dumps is serialized. To output real Chinese, you need to specify ensure_ ascii=False


[allure grammar]

$Hrun — alluredir allure results — clean alluredir # when the use case format is py file, you can replace “Hrun” with “pytest”, which has the same effect
– alluredir: generate the original data of allure report
allure results: save location of the original data
– clean alluredir: clear the historical data of allure results

$assure generate assure results – O assure report
– O specify the folder to generate the report
– C clean up the previous report directory before generating the report

Assure open assure report: start the default browser to open the assure test report