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

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for nose-sqlcapture-1.0.3.tar.gz
Algorithm Hash digest
SHA256 e33e77c057261aefa73a03ec19fa73714260f6ab933b3649dbf2207262378f47
MD5 6cb911a61a0ee4a1ae34bee5e5ccb6c6
BLAKE2b-256 1522ba0b569dc3dfb9edad2f7e32b375c805902aa9703f38192aa2dcbd563227

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nose_sqlcapture-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9118ed6e2f5d63e6b67dad44524d3aa917ebd14e269e236f07c70fff5056bcda
MD5 aabad6a327e621b9e625cae1c43ad719
BLAKE2b-256 bfd29d6cdaf1286149873c45908d8162cc3ca087864f1bc656513d165a3e39cd

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