Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kulgan/pytest-psqlgraph

psqlgraph pytest plugin
https://github.com/kulgan/pytest-psqlgraph

gdcdictionary psqlgraph pytest pytest-plugin testing

Last synced: about 2 months ago
JSON representation

psqlgraph pytest plugin

Awesome Lists containing this project

README

        

================
pytest-psqlgraph
================

|Pypi version| |ci| |Documentation Status| |Python versions|

An extension for `pytest `_ provide useful tools for testing applications that use `psqlgraph `_

------------
How to Start
------------

Install dependency ::

pip install pytest-psqlgraph

Define a session scoped ``psqlgraph_config`` fixture in ``conftest.py``:

.. code-block:: python

import pytest

@pytest.fixture(scope="session")
def psqlgraph_config() -> Dict[str, DatabaseDriverConfig]:
return {
"pg_driver": DatabaseDriverConfig(
host="localhost",
user="username",
password="pword",
database="db_name",
model=active_model,
dictionary=active_dictionary
)
}

All set to start using the fixture ``pg_driver`` or whatever key was defined in the dictionary above

.. code-block:: python

def test_something(pg_driver):
with pg_driver.session_scoped() as s:
s.add(Node(..))

Contributing
------------
Don't hesitate to create a `Github issue `__ for any bugs or suggestions or submit a PR.

.. |PyPI version| image:: https://img.shields.io/pypi/v/pytest-psqlgraph.svg
:target: https://pypi.python.org/pypi/pytest-psqlgraph
:alt: PyPi version

.. |conda-forge version| image:: https://img.shields.io/conda/vn/conda-forge/pytest-psqlgraph.svg
:target: https://anaconda.org/conda-forge/pytest-psqlgraph
:alt: conda-forge version

.. |ci| image:: https://github.com/kulgan/pytest-psqlgraph/workflows/ci/badge.svg
:target: https://github.com/kulgan/pytest-psqlgraph/actions
:alt: CI status

.. |Python versions| image:: https://img.shields.io/pypi/pyversions/pytest-psqlgraph.svg
:target: https://pypi.org/project/pytest-psqlgraph
:alt: PyPi downloads

.. |Documentation status| image:: https://readthedocs.org/projects/pytest-psqlgraph/badge/?version=latest
:target: https://pytest-psqlgraph.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status