Skip to main content

Predictable and repeatable tempdir support.

Project description

See Build Status on Travis CI See Build Status on AppVeyor http://img.shields.io/pypi/v/pytest-tempdir.svg

Adds support for a predictable and repeatable temporary directory.


This Pytest plugin was generated with Cookiecutter along with @hackebrot’s Cookiecutter-pytest-plugin template.

Features

  • Adds support for a predictable and repeatable temporary directory through the tempdir fixture which gets cleaned up in the end of the test run session(this behaviour can be disabled).

Requirements

  • None!

Installation

You can install “pytest-tempdir” via pip from PyPI:

$ pip install pytest-tempdir

Usage

  • Simply define a pytest_tempdir_basename function on your conftest.py which returns a string to define the basename or pass --tempdir-basename.

  • If you wish to leave the temporary directory intact for further inspection after the tests suite ends, pass --tempdir-no-clean.

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the Apache 2.0 license, “pytest-tempdir” is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

Changelog

v2018.8.11

  • Lower log call logging level

v2016.8.20

  • Support pytest 2.x and 3.x

v2015.12.6

  • Each absolute path gets it’s own counter

v2015.11.29

  • Append a counter value to existing directory names

v2015.11.17

  • Fix more encoding issues when running setup and the system locale is not set

v2015.11.16

  • Fix encoding issue when running setup and the system locale is not set

v2015.11.8

  • Fix stale tempdir cleanup logic

v2015.11.6

  • Wipe the tempdir directory on test session start if it exists

v2015.11.4

  • First working 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-tempdir-2019.7.18.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

pytest_tempdir-2019.7.18-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pytest-tempdir-2019.7.18.tar.gz.

File metadata

  • Download URL: pytest-tempdir-2019.7.18.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pytest-tempdir-2019.7.18.tar.gz
Algorithm Hash digest
SHA256 8041605da4821e4ccf57b14f27f22e767db16a5ae54c928cd664c4a25a94b84e
MD5 f0071322af21c915ed38c7f1acf2a554
BLAKE2b-256 0157666485bb064a6e7b11ed5d3e4c7f056c656009be3026e53d8ce50b219f03

See more details on using hashes here.

File details

Details for the file pytest_tempdir-2019.7.18-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_tempdir-2019.7.18-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for pytest_tempdir-2019.7.18-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 707aafa6ab3337b1ee4c4aa5c076ddb816893d368994e137917638cd72a23f11
MD5 669f9b50099d31125dc8798fc32f388a
BLAKE2b-256 7a041fec53b46d721d66142aac0bfac02b2f0d76d3514119247d483aa92e5ae2

See more details on using hashes here.

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