Skip to main content

SVN repository fixture for py.test

Project description

Creates an empty SVN repository for testing that cleans up after itself on teardown.

Installation

Install using your favourite package installer:

pip install pytest-svn
# or
easy_install pytest-svn

Enable the fixture explicitly in your tests or conftest.py (not required when using setuptools entry points):

pytest_plugins = ['pytest_svn']

Usage

Here’s a noddy test case that shows it working:

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://pythonhosted.org/path.py)
    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://')

Changelog

1.0.1 (2015-12-23)

  • Packaging bugfix

1.0.0 (2015-12-21)

  • Initial public release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-svn-1.0.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distributions

pytest_svn-1.0.1-py2.7.egg (2.6 kB view hashes)

Uploaded Source

pytest_svn-1.0.1-py2-none-any.whl (4.2 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page