[bug] remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

文章讲述了在pytest中遇到的import文件名不匹配问题,通过在测试文件夹中添加`__init__.py`并清理`__pycache__`和`.pyc`文件解决了这个问题。讨论链接提供了相关解决方案。
摘要由CSDN通过智能技术生成
import file mismatch:
imported module 'test' has this __file__ attribute:
  /tests/integration/test_mount_disk_die/test.py
which is not the same as the test file we want to collect:
  /tests/integration/test_query_api/test.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

首先这是一个pytest问题:
https://github.com/pytest-dev/pytest/discussions/8978
在这里插入图片描述
解决方法:

In my case adding 	__init__.py to my test folder solved the issue for me, deleting __pycache__ was failing in the venv folder

在这里插入图片描述

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]:/home/michal/Dokumenty/Projekty/Labirynt/.buildozer/android/platform/python-for-android/build/python-install/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' 。 引用\[2\]:/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires' 。 引用\[3\]:/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'dependency_links' 。 根据你提供的引用内容,这些是关于Python模块安装的警告信息。警告信息中提到了一些未知的分发选项,如'install_requires'和'dependency_links'。这些警告信息可能是由于使用了不兼容的Python版本或模块版本导致的。 至于你提到的错误信息"write /usr/lib/python3/dist-packages/OpenGL/raw/GLES3/VERSION/__pycache__/GLES3_3_0.pypy36.pyc: no space left on device",它表示在写入文件时磁盘空间不足。这可能是由于磁盘空间已满导致的。你可以尝试清理磁盘空间或者将文件写入到其他可用的磁盘。 希望这些信息对你有帮助。如果你有其他问题,请随时提问。 #### 引用[.reference_title] - *1* *2* *3* [android – Buildozer无法编译Cython](https://blog.csdn.net/weixin_36128990/article/details/117467185)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值