Skip to content

Enforcer/pytest-sqlalchemy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytest-sqlalchemy

SQLAlchemy related fixtures to handle connections and transactions with SQLAlchemy in tests.

Fixtures

This plugin provides the following fixtures:

  1. engine The engine used to connect to the database. Scope is "module".
  2. connection An open connection to the database. Scope is "module".
  3. transaction A started transaction on the connection. Transaction will be rolled back. No Scope.
  4. dbsession A sqlalchemy session not bound to any model. No scope.

Invoke

You need to provide the connection URL for the engine when invoking the pytest command::

py-test --sqlalchemy-connect-url="postgresql://scott:tiger@localhost:5432/mydatabase"

About

SQLAlchemy helpers for pytest

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%