Skip to main content

Add a django management command to list all tests in the project

Project description

Add a django management command to list all tests in the project

Quickstart

Install django-list-tests:

pip install django-list-tests

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_list_tests',
    ...
)

And run:

./manage.py list_tests <app_name>

You can use this command for fzf completion of tests:

# FZF ALL DAY ERRY DAY
function tz() {
    # cache the test names to speed things up. you can go more complex with
    # watchman or whatever.
    if [[ ! -f '.test_names' ]]; then
        python $DJANGO_MANAGE_SCRIPT list_tests $DJANGO_ROOT_MODULE > ./.test_names
    fi

    TESTS=$( cat .test_names | fzf )

    echo Runnning "$TESTS"
    python "$DJANGO_MANAGE_SCRIPT" "test" --keepdb "$TESTS"
}

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-list-tests-0.1.2.tar.gz (3.5 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page