🐛 修正项目的代码警告 (#614)

* 🐛 调整ruff的pytest警告

* 🐛 调整导入关系警告

* 🐛 删除奇怪无用的赋值和取值逻辑

*  不同测试部分所用变量应加以区分

* 🐛 subs_io model添加默认值

* 🐛 修完所有的 ruff PT001 警告

* 🔧 按ruff建议修改ruff配置

warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Azide
2024-08-17 18:24:20 +08:00
committed by GitHub
parent 29f23eb3c7
commit 32e3bcc022
26 changed files with 87 additions and 88 deletions
+6 -6
View File
@@ -138,10 +138,10 @@ async def test_subs_import_v1(app: App, tmp_path):
assert result.exit_code == 0
assert len(await config.list_subs_with_all_info()) == 3
mock_file: Path = tmp_path / "2.yaml"
mock_file.write_text(get_file("v1/subs_export.yaml"))
mock_file2: Path = tmp_path / "2.yaml"
mock_file2.write_text(get_file("v1/subs_export.yaml"))
result = await run_sync(runner.invoke)(cli, ["import", "-p", str(mock_file), "--format=yml"])
result = await run_sync(runner.invoke)(cli, ["import", "-p", str(mock_file2), "--format=yml"])
assert result.exit_code == 0
assert len(await config.list_subs_with_all_info()) == 6
@@ -169,9 +169,9 @@ async def test_sub_import_v2(app: App, tmp_path):
assert result.exit_code == 0
assert len(await config.list_subs_with_all_info()) == 3
mock_file: Path = tmp_path / "2.yaml"
mock_file.write_text(get_file("v2/subs_export.yaml"))
mock_file2: Path = tmp_path / "2.yaml"
mock_file2.write_text(get_file("v2/subs_export.yaml"))
result = await run_sync(runner.invoke)(cli, ["import", "-p", str(mock_file), "--format=yml"])
result = await run_sync(runner.invoke)(cli, ["import", "-p", str(mock_file2), "--format=yml"])
assert result.exit_code == 0
assert len(await config.list_subs_with_all_info()) == 6