This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Pytest plugin to restrict the test types allowed.

Features

This plugin allows you to restrict the test types allowed to ensure they inherit from one of a given list of classes. You might need this on large projects where you have custom test classes that developers might forget about.

About

I developed this feature in a closed source Nose plugin whilst working on the big Django project at YPlan. We had some custom enhancements and fixes on top of the Django test classes, but developers sometimes forgot about using them and instead used the built-in unittest classes, or the plain Django ones. Our solution was to just make the test runner blow up if it encountered non-whitelisted test types. This is a Pytest port of that plugin.

Usage

Install from pip with:

pip install pytest-restrict

Pytest will automatically find the plugin and use it when you run py.test, however by default there are no restrictions. To restrict the test types, provide --restrict-types as a comma-separated list of import paths to allowable test case base classes, for example:

# Allow only test cases that inherit from Django
py.test --restrict-types django.test.TestCase,django.test.SimpleTestCase

If you wish to allow function tests and other non-class test types (e.g. doctests), provide the special string ‘None’, for example:

# Allow function tests and our custom tests
py.test --restrict-types None,myproject.test.TestCase

History

Pending Release

  • New release notes here

2.0.0 (2016-04-29)

  • Changed the format of --restrict-types to take a comma-separated list of import paths rather than space separated, which fixes the parsing of e.g. py.test --restrict-types my.TestCase run/these/test_files.py.

1.0.0 (2016-04-17)

  • First release on PyPI
Release History

Release History

2.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pytest_restrict-2.0.0-py2.py3-none-any.whl (5.4 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Apr 29, 2016
pytest-restrict-2.0.0.tar.gz (5.4 kB) Copy SHA256 Checksum SHA256 Source Apr 29, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting