不同目录存在相同名称的py文件,执行时,报错的解决方法
1、问题现象如下,执行时报错 imported module 'test_case_execution' has this __file__ attribute
platform win32 -- Python 3.6.5, pytest-4.6.3, py-1.8.0, pluggy-0.12.0 -- E:\Program Files (x86)\Python36-32\python.exe
cachedir: .pytest_cache
rootdir: F:\pythonLear\PyTest_allure_apitest-master
plugins: allure-adaptor2-1.7.11, rerunfailures-7.0
collecting ... collected 4 items / 1 errors / 3 selected =================================== ERRORS ====================================
_ ERROR collecting TestCase/test_airticket/test_app_airticket_search/test_case_execution.py _
import file mismatch:
imported module 'test_case_execution' has this __file__ attribute:
F:\pythonLear\PyTest_allure_apitest-master\TestCase\test_airticket\test_app_airticket_login\test_case_execution.py
which is not the same as the test file we want to collect:
F:\pythonLear\PyTest_allure_apitest-master\TestCase\test_airticket\test_app_airticket_search\test_case_execution.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.39 seconds =========================== Process finished with exit code 0
2、解决方法
在同名文件所在目录下添加__init__.py文件即可解决问题
不同目录存在相同名称的py文件,执行时,报错的解决方法的更多相关文章
- eclipse下不能编译.ftl文件,会报错的解决方法
先安装一个插件 右击ftl文件,选择open with 但是没有freeMarker这个选项,如果有直接打开,如果没有则需要下载相关插件. 要安装一个freemarker的插件,才可以编辑FTL文件, ...
- php Yaf_Loader::import引入文件报错的解决方法
php Yaf_Loader::import引入文件报错的解决方法 改下配置文件就行<pre>yaf.use_spl_autoload=1</pre> 也可以PHP动态修改 毕 ...
- [AIR] AS3操作文件时报SecurityError: fileWriteResource 错的解决方法
在用File操作(移动,删除等)或者写入文件时,以下写法会报错 var file:File =File.applicationDirectory.resolvePath("1.swf&quo ...
- 不小心改了Xcode系统的头文件,运行报错,解决办法
- air写文件 SecurityError: fileWriteResource 时报错的解决方法
用 File.applicationDerectoryPath.resolv("text.txt")会报SecuriyError错误! 解决: var _Path:File = F ...
- eclipse引用头文件报错问题-解决方法
最近在做一个U-BOOT相关的项目,经过几天的折腾最终放弃使用VIM和一堆附加插件.最终的出的结论是对于中大型工程项目还是要启用一些专业的IDE比较稳妥,尽管VIM提供的各种插件累加在一起足以实现专业 ...
- net::ERR_ABORTED ,引入js文件出现报错的解决方法
在head头里面添加 <mvc:annotation-driven enable-matrix-variables="true"></mvc:annotation ...
- 关于真机调试DDMS中的data文件夹打不开的解决方法
关于真机调试DDMS中的data文件夹打不开的解决方法 今天在开发的时候需要导出程序中的数据库文件查看数据,数据库文件默认就在/data/data/应用包名/databases/数据库名 这个路径下, ...
- jQuery之JSP加载JS文件不起作用的有效解决方法
JSP加载JS文件不起作用的有效解决方法 作者: 字体:[增加 减小] 类型:转载 时间:2014-04-08 jsp导入jquery文件,老是不起作用,原因在于其不能访问/WEB-INF/目录下的文 ...
随机推荐
- layui-入门
1.下载layui 2.导入layui <title>开始使用layui</title> <!-- 导入js样式 --> <link rel="st ...
- Identity Server 4 从入门到落地(十)—— 编写可配置的客户端和Web Api
前面的部分: Identity Server 4 从入门到落地(一)-- 从IdentityServer4.Admin开始 Identity Server 4 从入门到落地(二)-- 理解授权码模式 ...
- .net core容器添加时区和libgdi+和下载加速
国内.net core镜像下载加速 比如对于mcr.microsoft.com/dotnet/core/aspnet:3.1,下载是走的azure全球cdn,国内访问很慢. 国内访问可以把mcr.mi ...
- pipeline配置前端项目
vue pipeline { agent { label 'master'} options { timestamps() disableConcurrentBuilds() buildDiscard ...
- Linux 内核到底长啥样
目录 一.简介 二.结构 地基 地面层 进程表 http进程 21进程 22进程 到文件系统 定时任务 管道 411进程 跃层 一.简介 今天,我来为大家解读一幅来自 TurnOff.us 的漫画 & ...
- yum的epel源
目录 一.centos7的源 一.centos7的源 以下一个不行,可以试试另一个 rpm -ivh https://mirrors.aliyun.com/epel/epel-release-late ...
- 实现input表单从右向左输入
<input style="text-align:right"></input>
- UCI数据库_鸢尾花数据集的读取方式
1. 读取数据的第一种方式 [attrib1,attrib2,attrib3,attrb4,class] = textread('iris.data','%f%f%f%f%s','delimiter' ...
- 你假笨JVM参数 - 1 CMSScavengeBeforeRemark
参数:-XX:CMSScavengeBeforeRemark含义:Enable scavenging attempts before the CMS remark step.开启或关闭在CMS重新标记 ...
- 关于后端 Entity Model Domain 的分界线
前言:在我们开发中经常用一种类型的值来接收来自Dao层的数据并将它传送给前端,或者作为逻辑处理,一般这种类型有三种 Entity Model Domain 我们该如何准确的应用这三种类型呢?这三 ...