Skip to main content

A base framework to write a simple runtests.py script for django apps.

Project description

Eases the writing of a runtests.py script for pluggable django application.

Such scripts usually provide a runtests() method that handle the test running behaviour.

Installation

  • Globally:

    $ pip install django-runtests
  • From the package’s setup.py file (using Distribute):

    setup(
        test_requires=[
            'django-runtests',
        ],
        test_suite='runtests.runtests',
    )

Defining the test setup

In your runtests.py file, add the following code:

from django_runtests import RunTests

def runtests():
    return RunTests.runtests()

if __name__ == '__main__':
    RunTests.main()

Tweaking the test setup

If you need to tweak some parts (updating configuration, adding options, …), you simply have to extend the RunTests command class:

import django_runtests

class RunTests(django_runtests.RunTests):

    def should_test_app(self, app):
        """Test only applications listed in 'PACKAGE_APPS' setting."""
        from django.conf import settings
        return app in settings.PACKAGE_APPS

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

django_runtests-0.4.0.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file django_runtests-0.4.0.tar.gz.

File metadata

File hashes

Hashes for django_runtests-0.4.0.tar.gz
Algorithm Hash digest
SHA256 92ad810e3f1c382c79895230dc8ef54a01243750f9abeb62586fe29dd051a362
MD5 c12de9eac7df08e9df012307ab24d54c
BLAKE2b-256 43a48ae6b609e5a58f707ccec7869c9c8f42eb91d4f7fd3fb3fc8406b276e696

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