modulenotfounderror resultlog module pytest

前端npm下载node_modules依赖的时候报错

使用 npm install --legacy-peer-deps,报如下图: 解决办法: 修改hosts文件 找到如下文件夹:C:\Windows\System32\drivers\etc 下的hosts文件 使用工具把hosts文件打开 185.199.108.133 raw.githubuse ......
前端 node_modules modules 时候 node

uniapp 构建 module 模块和 package.json 文件

在项目根目录下开启CMD,输入以下命令 npm init 等构建完了会出现这些文件 然后再来配置 组件库,这下官网地址,这个是 1X的地址,个人觉得 1X的比较好用。更稳定。可以根据自己的需求去升级 https://v1.uviewui.com/components/install.html 以下是 ......
模块 package 文件 uniapp module

node Solve – To load an ES module, set “type”: “module” in the package.json or use the .mjs extension

https://codevoweb.com/solve-to-load-an-es-module-set-type-module-in-the-package-json-or-use-the-mjs-extension/ 解决 – 要加载 ES 模块,请在 package.json 中设置 “typ ......
module extension the package Solve

django 更改了modules.py 数据库模型,但是 python3 manage.py makemigrations 提示无更改No changes detected

现象: 明明改了modules.py文件。删了appname/migrations/下所有内容。 而且也删除了django 模型变更记录表django_migrations 中appname项目的记录 原因: 删多了: appname/migrations/下所有内容。__init__.py不能删, ......

pytest接口自动化(一)

这里说下pytest接口自动化的工程项目的基本结构(个人的工程结构),项目工程主要使用pytest、pymysql、requests、pyyaml、allure-pytest、pytest-rerunfailures、pytest-xdist、filelock等插件。 首先工程结构 api_test ......
接口 pytest

pytest 执行脚本时,报(no name '/Users/**/PycharmProjects/interface_auto/test_case/test_task.py::TestTask::test_querylist' in any of [<Module test_task.py>])

### 触发场景: pytest执行脚本时,命名全部正确,但是直接报找不到执行函数 ### 解决方式: 取掉init方法 ### 原因: 测试框架在运行测试时会自动实例化测试类的对象,并且不会传递任何参数。如果您定义了__init__方法,测试框架将无法实例化您的测试类,从而导致测试无法运行。因此, ......

yarn 安装进行时,显现错误 node_modules\gifsicle: Command failed.

## 1.错误显示 ```js [4/5] Building fresh packages... [7/13] ⠠ jpegtran-bin [6/13] ⠠ gifsicle [8/13] ⠠ mozjpeg [4/13] ⠠ gifsicle error E:\IdeaStudyProjects ......

[nodejs] __dirname is not defined in ES module scope

原因:CommonJS 中提供的全局变量如require, exports, module.exports, __filename, __dirname 等,在 ES Modules 环境中均是不可用的,require, exports, module.exports 在 ES Modules 中基 ......
dirname defined nodejs module scope

torch.nn.Module.register_forward_hook使用

本文简单介绍 torch.nn.Module.register_forward_hook钩子函数的使用,简单写了一个卷积的网络,在net.conv1.register_forward_hook注册钩子函数,则会有module、输入input数据与卷积后输出数据output,重点说明module是关于 ......

python安装pip包时,提示No module named 'setuptools' 解决方案

一、弄了台新电脑,装了个python,准备装新的包时发现提示 'pip' 不是内部或外部命令,也不是可运行的程序或批处理文件。 ps:先检查是否有添加环境变量,“*/python/Scripts”;若添加环境变量了还是如此,就请继续往下看 二、解决上述问题,当然是装个pip就行了,于是开搞 第一步: ......
setuptools 解决方案 方案 python module

torch.nn.Module.register_forward_pre_hook使用

本文简单介绍 torch.nn.Module.register_forward_pre_hook钩子函数的使用,简单写了一个卷积的网络,在net.conv1.register_forward_pre_hook注册钩子函数,则会有module与输入input数据,重点说明module是关于模型结构se ......

pytest + yaml 框架 -37.mark 标记对用例运行时长断言

# 前言 pytest 执行用例的时候,我们希望对用例的运行时间断言,当用例执行时长大于预期标记此用例失败。 `@pytest.mark.runtime(1)` 运行时长单位是秒 此插件已打包上传到pypi [https://pypi.org/project/pytest-runtime-yoyo/ ......
时长 标记 框架 pytest mark

pytest 执行报错:AttributeError: module 'pytest' has no attribute 'StashKey'

在一台测试机器执行`pytest`命令时报错:`AttributeError: module 'pytest' has no attribute 'StashKey'` ![image](https://img2023.cnblogs.com/blog/1476955/202306/1476955- ......
pytest 39 AttributeError attribute StashKey

ModuleNotFoundError: No module named 'pandas'

01、 002、解决方法 [root@PC1 test2]# conda install pandas ......
ModuleNotFoundError module pandas named 39

pytest文档 88- pytest-runtime-yoyo 对用例运行时长断言

# 说明 pytest 执行用例的时候,我们希望对用例的运行时间断言,当用例执行时长大于预期标记此用例失败。 `@pytest.mark.runtime(1)` 运行时长单位是秒 此插件已打包上传到pypi [https://pypi.org/project/pytest-runtime-yoyo/ ......

Pytest - Fixture(12) - 配置文件pytest.ini

## Pytest - 配置文件 pytest.ini **前言** + `pytest.ini` 配置文件可以改变pytest的运行方式,它是一个固定的文件pytest.ini文件,读取配置信息,按指定的方式去运行。 + **作用:**可以改变 pytest 的默认行为; + **位置:**一般放 ......
Fixture 文件 Pytest pytest ini

解决 ModuleNotFoundError: No module named 'pip'

Traceback (most recent call last): File "d:\environment\python3\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, N ......
ModuleNotFoundError module named 39 pip

pytest -fixture-request

`request`在pytest-fixture经常使用到,具体看看有什么内容: ```python # conftest.py import pytest @pytest.fixture(params=['环境1','环境2']) def fixture1(request): print(requ ......
fixture-request fixture request pytest

pytest 生成的html其他人打开是空的

本地打开html文件显示正常是应为本地有css,而被人没有。我们打开浏览器查看F12,加载了本地路径中的css文件 ![image](https://img2023.cnblogs.com/blog/1476955/202306/1476955-20230609165630765-119292896 ......
pytest html

pytest之parametrize数据驱动

1.数据驱动 1.1 yaml文件 yaml是一种数据类型,扩展名:.yaml和.yml 作用: 配置文件:环境变量,数据库信息,用户名密码,日志格式等 测试用例:web,ui,app 语法规则: 区分大小写 通过缩进表示层级关系,一般用空格,不要使用tab键 通过#注释 字符串可以不用写引号,也可 ......
parametrize 数据 pytest

pytest的一些关键点

一. pytest测试框架 1.单元测试:是指在软件开发当中,针对软件的最小单位(函数,方法)进行正确性的检查测试。 java:junit,testng python:unittest,pytest 2.自动化测试框架作用 ①提高测试效率,降低维护成本 ②减少人工干预,提高测试的准确性,增加代码的重 ......
关键点 关键 pytest

怎么快速删除node_modules

## 1.安装rimraf工具 `npm install -g rimraf` ## 2.删除 node_modules 包和 package-lock.json 文件 `rimraf node_modules rimraf package-lock.json` ## 3.清除缓存 `npm cac ......
node_modules modules node

pytest框架使用

1.pytest框架 1.1.引入 常用单元测试框架介绍 python:pytest,unittest java:TestNG,Junit pytest主要作用: 找到测试用例 执行测试用例 判断测试结果 生成测试报告 pytest默认的测试用例规则(可在pytest.ini中修改规则): 模块名必 ......
框架 pytest

pytest + yaml 框架 -35.根据不同运行环境生成全局token

# 前言 我们在使用自动化测试框架的时候,经常会遇到一个需求,希望在全局用例中,仅登录一次,后续所有的用例自动带上请求头部token 或者cookies。 我们可以自定义fixture 更新内置的 `requests_session`, 在请求头部添加token 来实现全局登录。 基本使用参考前面这 ......
全局 框架 环境 pytest token

pytest + yaml 框架 -34.接口 sign 签名请求预处理

# 前言 一般公司对外的接口都会用到 sign 签名,对不同的客户提供不同的apikey ,这样可以提高接口请求的安全性,避免被人抓包后乱请求。 关于sign签名的可以参考前面一篇的介绍[https://www.cnblogs.com/yoyoketang/p/11742187.html](http ......
框架 接口 pytest yaml sign

pytest + yaml 框架 -33.参数化读取文件路径优化

# 前言 针对小伙伴提出参数化时读取外部文件,在项目根路径运行没问题,但是进入到项目下子文件夹运行用例,就会找不到文件问题做了优化。 关于参数化读取外部文件相关内容参考前面这篇[pytest + yaml 框架 -25.参数化数据支持读取外部文件txt/csv/json/yaml](pytest + ......
路径 框架 参数 文件 pytest

pytest + yaml 框架 -32.re 正则解析返回结果

# 前言 pytest-yaml-yoyo 插件可以支持3种表达式提取接口返回结果,jsonpath 和 jmespath 适合解析返回的json数据。 非json 数据的结果可以用re 正则表达式取值。 # re 正则取值 访问我的博客地址[https://www.cnblogs.com/yoyo ......
正则 框架 结果 pytest yaml

解决使用yarn安装依赖出现“The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0". Got "17.9.0"”的问题

# 1、问题描述 某天在使用`yarn`安装依赖的时候,突然出现如下错误导致安装依赖终止: **The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0 ......
quot incompatible Expected version engine

Tengine 安装 nginx-module-vts 模块

## Tengine 安装 nginx-module-vts 模块 > 使用 Tengine 作为反向代理服务器,发现 Tengine 日志中接口请求过慢,需要绘制 grafana 展示详细的接口情况 ### 解决思路 * 第一版解决思路,修改 Tengine 中 access log 日志格式,转 ......
nginx-module-vts 模块 Tengine module nginx

pytest

import pytestimport allureimport os # pytest运行脚本生成测试报告原始数据,reports/allure是原始报告目录,生成的是json数据# --clean-alluredir每次运行会清空上次生成的数据pytest.main(['-s','../test ......
pytest