skip to navigation
skip to content

pytest-toolbox 0.2

Numerous useful plugins for pytest.

Copyright (C) 2016 Samuel Colvin

Numerous useful plugins for pytest.

Fixtures

tmpworkdir
Run the test with the working directory set to a temporary directory. Similar to the pytest plugin tmpdir except working directory is changed.
caplog
capture logs.
debug
print all logs.
loop
asyncio loop.

Methods

(See below for usage examples).

mktree
Create a tree of files from a dictionary.
gettree
Return a dictionary depicting a directory tree.

Usage

from pytest_toolbox import gettree, mktree

def test_whatever(tmpworkdir):
    mktree(tmpworkdir, {
        'foobar.txt': 'has this content'
    })
    assert gettree(tmpworkdir) = {'foobar.txt': 'has this content'}

TODO

 
File Type Py Version Uploaded on Size
pytest-toolbox-0.2.tar.gz (md5) Source 2017-02-11 4KB
pytest_toolbox-0.2-py35-none-any.whl (md5) Python Wheel py35 2017-02-11 6KB