Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
145be2ea
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
145be2ea
编写于
12月 15, 2020
作者:
T
Tzu-ping Chung
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Skip pip search tests unless explicitly requested
上级
2b0b426b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
0 deletion
+20
-0
setup.cfg
setup.cfg
+1
-0
tests/conftest.py
tests/conftest.py
+10
-0
tests/functional/test_search.py
tests/functional/test_search.py
+9
-0
未找到文件。
setup.cfg
浏览文件 @
145be2ea
...
...
@@ -61,6 +61,7 @@ markers =
mercurial: VCS: Mercurial
git: VCS: git
yaml: yaml based tests
search: tests for 'pip search'
[coverage:run]
branch = True
...
...
tests/conftest.py
浏览文件 @
145be2ea
...
...
@@ -51,6 +51,12 @@ def pytest_addoption(parser):
default
=
False
,
help
=
"use venv for virtual environment creation"
,
)
parser
.
addoption
(
"--run-search"
,
action
=
"store_true"
,
default
=
False
,
help
=
"run 'pip search' tests"
,
)
def
pytest_collection_modifyitems
(
config
,
items
):
...
...
@@ -58,6 +64,10 @@ def pytest_collection_modifyitems(config, items):
if
not
hasattr
(
item
,
'module'
):
# e.g.: DoctestTextfile
continue
if
(
item
.
get_closest_marker
(
'search'
)
and
not
config
.
getoption
(
'--run-search'
)):
item
.
add_marker
(
pytest
.
mark
.
skip
(
'pip search test skipped'
))
if
"CI"
in
os
.
environ
:
# Mark network tests as flaky
if
item
.
get_closest_marker
(
'network'
)
is
not
None
:
...
...
tests/functional/test_search.py
浏览文件 @
145be2ea
...
...
@@ -56,6 +56,7 @@ def test_pypi_xml_transformation():
@
pytest
.
mark
.
network
@
pytest
.
mark
.
search
def
test_basic_search
(
script
):
"""
End to end test of search command.
...
...
@@ -75,6 +76,7 @@ def test_basic_search(script):
"https://github.com/pypa/warehouse/issues/3717 for more "
"information."
),
)
@
pytest
.
mark
.
search
def
test_multiple_search
(
script
):
"""
Test searching for multiple packages at once.
...
...
@@ -88,6 +90,7 @@ def test_multiple_search(script):
assert
'Tools for parsing and using INI-style files'
in
output
.
stdout
@
pytest
.
mark
.
search
def
test_search_missing_argument
(
script
):
"""
Test missing required argument for search
...
...
@@ -97,6 +100,7 @@ def test_search_missing_argument(script):
@
pytest
.
mark
.
network
@
pytest
.
mark
.
search
def
test_run_method_should_return_success_when_find_packages
():
"""
Test SearchCommand.run for found package
...
...
@@ -110,6 +114,7 @@ def test_run_method_should_return_success_when_find_packages():
@
pytest
.
mark
.
network
@
pytest
.
mark
.
search
def
test_run_method_should_return_no_matches_found_when_does_not_find_pkgs
():
"""
Test SearchCommand.run for no matches
...
...
@@ -123,6 +128,7 @@ def test_run_method_should_return_no_matches_found_when_does_not_find_pkgs():
@
pytest
.
mark
.
network
@
pytest
.
mark
.
search
def
test_search_should_exit_status_code_zero_when_find_packages
(
script
):
"""
Test search exit status code for package found
...
...
@@ -132,6 +138,7 @@ def test_search_should_exit_status_code_zero_when_find_packages(script):
@
pytest
.
mark
.
network
@
pytest
.
mark
.
search
def
test_search_exit_status_code_when_finds_no_package
(
script
):
"""
Test search exit status code for no matches
...
...
@@ -140,6 +147,7 @@ def test_search_exit_status_code_when_finds_no_package(script):
assert
result
.
returncode
==
NO_MATCHES_FOUND
,
result
.
returncode
@
pytest
.
mark
.
search
def
test_latest_prerelease_install_message
(
caplog
,
monkeypatch
):
"""
Test documentation for installing pre-release packages is displayed
...
...
@@ -168,6 +176,7 @@ def test_latest_prerelease_install_message(caplog, monkeypatch):
assert
get_dist
.
calls
==
[
pretend
.
call
(
'ni'
)]
@
pytest
.
mark
.
search
def
test_search_print_results_should_contain_latest_versions
(
caplog
):
"""
Test that printed search results contain the latest package versions
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录