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.4.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.4-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for nose-sqlcapture-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7fffd94708b29096819b204a04ed5a302b3eb9013e0983ce05064c19cea3f8b8
MD5 3fd9dc05007cd29834ea09f5f90b4ce5
BLAKE2b-256 ba66cbf694259fcc63cfb717a45ccb9f2c0334fff74e250ae8a214d46f05022a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nose_sqlcapture-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 78b3de544ddca777cdfc5685547b4ae5334d50691a92dab52677317ffe60a87a
MD5 ca03319733d56f8bd91a328acbf41aa1
BLAKE2b-256 1f0ba0d0f707616e8c824ef74a8206342265eaafd9e00fc067c76079244c111f

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