Skip to main content

Capture SQL queries being generated from a nosetests run

Project description

SQLCapture nose plugin

Capture SQL queries being generated from a nosetests run

https://badge.fury.io/py/nose-sqlcapture.png https://travis-ci.org/freshbooks/nose-sqlcapture.svg?branch=master https://pypip.in/d/nose-sqlcapture/badge.png

Installation

Do `pip install nose-sqlcapture` in your project. Your project should already have `nosetests` and `sqlalchemy` installed.

Usage

`nosetests [other options] --with-sqlcapture --sqlcapture-filename=sql.log --sqlcapture-format=json`

  • sqlcapture-filename the output file. Default: /tmp/sqlcapture.log

  • sqlcapture-format the format of the log file, either json or plain. Default: plain

Formats

Plain (plain)

Output in plain-text form that’s meant for human consumption. The output is of the following format:

test1
test2
SQL1
---
test1
test3
SQL2
---
...

JSON (json)

Ouptut the queries and their corresponding tests in json format:

{
    SQL1: [test1, test2],
    SQL2: [test1, test3],
    ...
}

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

nose-sqlcapture-1.0.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nose_sqlcapture-1.0.5-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file nose-sqlcapture-1.0.5.tar.gz.

File metadata

File hashes

Hashes for nose-sqlcapture-1.0.5.tar.gz
Algorithm Hash digest
SHA256 f3aa6ad8a8404031ab6d2da0ac406371390323a7e20e3d71a3d3875c32ba05b5
MD5 62da2937c79b0c513f91baf07f68e78f
BLAKE2b-256 8d06c5c0a099029c26fd6ddad26c6ebe052d8987de8332c7c65333ed1b303b83

See more details on using hashes here.

File details

Details for the file nose_sqlcapture-1.0.5-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nose_sqlcapture-1.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 e80dc470f3aec52b4550898b30ad8dcb258bc3d592049d2548520d39f4f92b9a
MD5 99ee46a9a422e79d98ef06e0a7167845
BLAKE2b-256 23de97c286c9392b6054e142f0eed6422af4396c918ebc052a7243eeda3c4742

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page