Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
a1fccee9
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,发现更多精彩内容 >>
提交
a1fccee9
编写于
6月 30, 2014
作者:
D
Donald Stufft
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1908 from dstufft/ugh
Run the unit tests before the integration tests
上级
4f863289
566f4e6a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
8 deletion
+41
-8
.travis/run.sh
.travis/run.sh
+7
-2
tests/conftest.py
tests/conftest.py
+27
-0
tests/unit/test_util.py
tests/unit/test_util.py
+5
-5
tox.ini
tox.ini
+2
-1
未找到文件。
.travis/run.sh
浏览文件 @
a1fccee9
...
...
@@ -6,11 +6,16 @@ set -x
# our tests use.
export
LC_CTYPE
=
en_US.UTF-8
# Run the unit tests
tox
--
-m
unit
# Run our integration tests, typically with pytest-xdist to speed things up
# except on Python 3.2 where it doesn't work quite right.
case
$TOXENV
in
py32
)
tox
tox
--
-m
integration
;;
*
)
tox
--
-n
8
tox
--
-
m
integration
-
n
8
;;
esac
tests/conftest.py
浏览文件 @
a1fccee9
...
...
@@ -10,6 +10,33 @@ from tests.lib.scripttest import PipTestEnvironment
from
tests.lib.venv
import
VirtualEnvironment
def
pytest_collection_modifyitems
(
items
):
for
item
in
items
:
module_path
=
os
.
path
.
relpath
(
item
.
module
.
__file__
,
os
.
path
.
commonprefix
([
__file__
,
item
.
module
.
__file__
]),
)
if
(
module_path
.
startswith
(
"functional/"
)
or
module_path
.
startswith
(
"integration/"
)
or
module_path
.
startswith
(
"lib/"
)):
item
.
add_marker
(
pytest
.
mark
.
integration
)
elif
module_path
.
startswith
(
"unit/"
):
item
.
add_marker
(
pytest
.
mark
.
unit
)
# We don't want to allow using the script resource if this is a
# unit test, as unit tests should not need all that heavy lifting
if
set
(
getattr
(
item
,
"funcargnames"
,
[]))
&
set
([
"script"
]):
raise
RuntimeError
(
"Cannot use the ``script`` funcarg in a unit test: "
"(filename = {0}, item = {1})"
.
format
(
module_path
,
item
)
)
else
:
raise
RuntimeError
(
"Unknown test type (filename = {0})"
.
format
(
module_path
)
)
@
pytest
.
fixture
def
tmpdir
(
request
):
"""
...
...
tests/unit/test_util.py
浏览文件 @
a1fccee9
...
...
@@ -239,17 +239,17 @@ class Tests_get_installed_distributions:
assert
len
(
dists
)
==
0
def
test_find_command_folder_in_path
(
script
):
def
test_find_command_folder_in_path
(
tmpdir
):
"""
If a folder named e.g. 'git' is in PATH, and find_command is looking for
the 'git' executable, it should not match the folder, but rather keep
looking.
"""
script
.
scratch_path
.
join
(
"path_one"
).
mkdir
()
path_one
=
script
.
scratch_path
/
'path_one'
tmpdir
.
join
(
"path_one"
).
mkdir
()
path_one
=
tmpdir
/
'path_one'
path_one
.
join
(
"foo"
).
mkdir
()
script
.
scratch_path
.
join
(
"path_two"
).
mkdir
()
path_two
=
script
.
scratch_path
/
'path_two'
tmpdir
.
join
(
"path_two"
).
mkdir
()
path_two
=
tmpdir
/
'path_two'
path_two
.
join
(
"foo"
).
write
(
"# nothing"
)
found_path
=
find_command
(
'foo'
,
map
(
str
,
[
path_one
,
path_two
]))
assert
found_path
==
path_two
/
'foo'
...
...
tox.ini
浏览文件 @
a1fccee9
...
...
@@ -6,12 +6,13 @@ envlist =
deps
=
pretend
pytest
pytest-timeout
pytest-xdist
mock
scripttest>=1.3
https://github.com/pypa/virtualenv/archive/develop.zip
#egg=virtualenv
commands
=
py.test
[]
py.test
--timeout
300
[]
[testenv:docs]
deps
=
sphinx
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录