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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nose_sqlcapture-1.0.7-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for nose_sqlcapture-1.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 77786580328b8a9652b178c5d76c9b3955d5a18c3aa3615ad6247add7f4e0658
MD5 0214b7c6fcaa23cd568047222ed056aa
BLAKE2b-256 e609b350594b407f77dff299bc13c770673cae86e305e777347621c07d9f7f66

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