跳转到主要内容

为pytest的SVN仓库固定装置

项目描述

为测试创建一个空的SVN仓库,并在拆卸后自行清理。

安装

使用您喜欢的包安装程序进行安装

pip install pytest-svn
# or
easy_install pytest-svn

在您的测试或conftest.py中显式启用固定装置(当使用setuptools入口点时不需要)

pytest_plugins = ['pytest_svn']

用法

这里有一个简单的测试用例,展示了它的工作情况

def test_svn_repo(svn_repo):
    # The fixture derives from `workspace` in `pytest-shutil`, so they contain
    # a handle to the path.py path object (see https://pathpy.readthedocs.io/)
    path = svn_repo.workspace
    file = path / 'hello.txt'
    file.write_text('hello world!')

    # We can also run things relative to the repo
    svn_repo.run('svn add hello.txt')

    # The fixture has a URI property you can use in downstream systems
    assert svn_repo.uri.startswith('file://')

变更日志

1.7.0

  • 所有:支持pytest >= 4.0.0

  • 所有:支持Python 3.7

  • pytest-server-fixtures:如果您的机器上未定义主机,则默认为主机名localhost

  • pytest-server-fixture:由于上游API更改,将rethinkdb固定到 < 2.4.0

  • pytest-verbose-parametrize:添加对全新标记基础设施的支持

  • pytest-verbose-parametrize:修复集成测试以支持pytest >= 4.1.0

  • pytest-virtualenv:添加virtualenv作为安装需求。修复#122

  • pytest-webdriver:使用getfixturevalue修复RemovedInPytest4Warning

  • circleci:跳过没有推送权限的开发者的coverall提交以修复检查

  • wheels:生成可同时安装于python 2.x和3.x的通用wheel文件

  • dist:移除对构建和分发*.egg文件的支持

  • VagrantFile:安装python 3.7并默认初始化python 3.7

  • 使用“logger.warning()”函数修复DeprecationWarning警告

1.6.2 (2019-02-21)

  • pytest-server-fixtures:在调用kill()时抑制堆栈跟踪

  • pytest-server-fixtures:修复TestServerV2中的随机端口逻辑

1.6.1 (2019-02-12)

  • pytest-server-fixtures:修复在服务器未启动时尝试访问主机名的异常

1.6.0 (2019-02-12)

  • pytest-server-fixtures:添加之前删除的TestServerV2.kill()函数

  • pytest-profiling:在集成测试中固定more-itertools==5.0.0,因为这是一个仅限PY3的版本

1.5.1 (2019-01-24)

  • pytest-verbose-parametrize:修复使用@pytest.mark.parametrize时出现的unicode参数问题

1.5.0 (2019-01-23)

  • pytest-server-fixtures:使postgres fixtures及其测试变为可选,如所有其他fixtures一样

  • pytest-server-fixtures:撤销对pymongo弃用警告的修复,因为这会破坏与pymongo 3.6.0的兼容性

  • pytest-server-fixtures:在httpd中移除对RHEL5的支持

1.4.1 (2019-01-18)

  • pytest-server-fixtures:在ENV中指定的服务器二进制路径现在仅影响服务器类‘thread’

1.4.0 (2019-01-15)

  • 修复Simple HTTP Server fixture中的python 3兼容性问题

  • 修复pytest-profiling中的损坏测试

  • 将pytest固定在<4.0.0,直到所有弃用警告都得到修复。

  • pytest-webdriver:用无头Google Chrome替换已弃用的phantomjs。

  • 将Vagrantfile添加到项目中,以使测试环境便携。

  • 将.project文件添加到项目中。

  • pytest-server-fixtures:添加带有Docker和Kubernetes支持的TestServerV2。

  • pytest-server-fixtures:修复了MinioServer在使用后未清理的问题。

  • pytest-server-fixtures:修复了调用pymongo时的弃用警告。

  • pytest-server-fixtures:在MongoTestServer拆卸时关闭pymongo客户端。

  • pytest-server-fixtures:将Mongo、Redis和RethinkDB升级到TestServerV2。

  • coveralls:修复损坏的coveralls

1.3.1 (2018-06-28)

  • 使用pymongo list_database_names()代替已弃用的database_names(),添加pymongo>=3.6.0依赖项

1.3.0 (2017-11-17)

  • 修复了当teardown为None时的工作空间删除问题

  • 修复了pytest-listener中根日志记录器的扁平化问题

  • 添加了S3 Minio fixture(感谢Gavin Bisesi)

  • 添加了Postgres fixture(感谢Gavin Bisesi)

  • 使用requests对服务器fixtures http get,因为它可以正确处理重定向和代理

1.2.12 (2017-8-1)

  • 修复了缓存临时主机名的回归,一些客户端依赖于此。现在这是可选的。

1.2.11 (2017-7-21)

  • 修复了OSX绑定到非法本地IP范围的问题(感谢Gavin Bisesi)

  • 为pytest-profiling设置和Py3k修复(感谢xoviat)

  • 不再尝试在预留本地IP主机时绑定端口5000,因为有人可能将其绑定到0.0.0.0

  • 修复了在本地venv未激活时调用gprof2dot的问题

1.2.10 (2017-2-23)

  • 在pytest-webdriver中处理自定义Pytest测试项

1.2.9 (2017-2-23)

  • 将用户名添加到mongo服务器fixture tempdir路径中,以防止在共享多用户文件系统上发生冲突

1.2.8 (2017-2-21)

  • 在shutil.run.run_as_main中返回函数结果

1.2.7 (2017-2-20)

  • 对较旧的path.py版本进行更多处理

  • 允许在pytest-virtualenv中传递virtualenv参数

1.2.6 (2017-2-16 )

  • 更新devpi服务器设置以支持devpi-server >= 2.0

  • 对随机端口选择进行改进

  • HTTPD服务器现在默认绑定到0.0.0.0,以帮助进行Selenium-style测试

  • 更新mongodb服务器参数以支持mongodb >= 3.2

  • 对mongodb fixture配置进行纠正并改进启动逻辑

  • 添加了模块范围的mongodb fixture

  • 对较旧的path.py版本进行处理

  • 修复了#40中测试chdir会破坏pytest-profiling的问题

1.2.5 (2016-12-09)

  • 对服务器运行器主机和端口生成进行改进,现在支持随机本地IP

  • 修复RethinkDB配置文件中的错误

1.2.4 (2016-11-14)

  • 修复pymongo额外依赖项中的错误

  • 修复pytest-virtualenv在Windows上的兼容性(感谢Jean-Christophe Fillion-Robin提供的PR)

  • 修复pytest-shutil.cmdline.get_real_python_executable的符号链接处理

1.2.3 (2016-11-7)

  • 提高Mongo配置文件启动检查的鲁棒性

1.2.2 (2016-10-27)

  • 大多数模块支持Python 3兼容性

  • 修复了过时的Path.py导入(感谢Bryan Moscon)

  • 修复了pytest-profiling中的过时多调用(感谢Paul van der Linden提供的PR)

  • 添加了devpi-server配置文件,以创建每个测试函数的索引

  • 添加了缺失的许可文件

  • 将httpd服务器配置文件拆分,以便子类更容易覆盖加载的模块

  • 向TestServer基类添加了“preserve_sys_path”参数,该参数将当前Python sys.path导出到子进程中。

  • 更新httpd、redis和jenkins的运行时参数和路径,以符合当前Ubuntu规范

  • 在拆卸工作空间时忽略错误,以避免shutil.rmtree实现中的竞争条件

1.2.1 (2016-3-1)

  • 修复了适用于最新版本py.test的pytest-verbose-parametrize

1.2.0 (2016-2-19)

  • 新插件:git仓库配置文件

1.1.1 (2016-2-16)

  • pytest-profiling改进:在.prof文件中转义非法字符(感谢Aarni Koskela提供的PR)

1.1.0 (2016-2-15)

  • 新插件:devpi服务器配置文件

  • pytest-profiling改进:过长的.prof文件保存为测试名称的短哈希值(感谢Vladimir Lagunov提供的PR)

  • 出于安全原因,将workspace.run()的默认行为更改为不使用子shell

  • 更正了virtualenv.run()方法,使其与父方法workspace.run()处理相同的参数

  • 从virtualenv参数中移除了过时的“–distribute”

1.0.1 (2015-12-23)

  • 包装错误修复

1.0.0 (2015-12-21)

  • 首次公开发布

项目详细信息


下载文件

下载适合您平台的文件。如果您不确定要选择哪一个,请了解更多关于安装包的信息。

源代码发行版

pytest-svn-1.7.0.tar.gz (8.9 kB 查看散列)

上传时间 源代码

构建的发行版

pytest_svn-1.7.0-py3.6.egg (5.3 kB 查看散列)

上传时间 源代码

pytest_svn-1.7.0-py2.py3-none-any.whl (6.1 kB 查看散列)

上传时间 Python 2 Python 3

pytest_svn-1.7.0-py2.7.egg (5.3 kB 查看散列)

上传时间 源代码

由以下机构支持