1 Star 0 Fork 13

王坤田/python-distro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-ModuleNoFoundError-in-test-case.patch 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
王歌 提交于 2023-05-31 16:37 . update to version 1.8.0
From 313deda21e33fa7cafdf95e2c048fde1c3a65c2d Mon Sep 17 00:00:00 2001
From: wang--ge <wang__ge@126.com>
Date: Wed, 31 May 2023 16:26:34 +0800
Subject: [PATCH] fix ModuleNoFoundError in test case
---
tests/test_distro.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/test_distro.py b/tests/test_distro.py
index 3dda970..dde0a7e 100644
--- a/tests/test_distro.py
+++ b/tests/test_distro.py
@@ -33,6 +33,8 @@ DISTROS = [dist for dist in os.listdir(DISTROS_DIR) if dist != "__shared__"]
IS_LINUX = sys.platform.startswith("linux")
if IS_LINUX:
+ path="./src"
+ sys.path.append(os.path.abspath(path))
from distro import distro
RELATIVE_UNIXCONFDIR = distro._UNIXCONFDIR[1:]
@@ -48,7 +50,7 @@ class TestNonLinuxPlatform:
assert "Unsupported platform" in str(ex)
-@pytest.mark.skipif(not IS_LINUX, reason="Irrelevant on non-linux")
+@pytest.mark.skipif(IS_LINUX, reason="Irrelevant on non-linux")
class TestCli:
def _parse(self, command: str) -> None:
sys.argv = command.split()
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/A_L_I_E_Z/python-distro.git
git@gitee.com:A_L_I_E_Z/python-distro.git
A_L_I_E_Z
python-distro
python-distro
master

搜索帮助

A270a887 8829481 3d7a4017 8829481