Metadata-Version: 2.1
Name: pytest-psqlgraph
Version: 0.2.0rc1
Summary: pytest plugin for testing applications that use psqlgraph
Home-page: https://github.com/kulgan/pytest-psqlgraph
Author: Rowland Ogwara
Author-email: r.ogwara@gmail.com
License: Apache Software License 2.0
Project-URL: source, https://github.com/kulgan/pytest-psqlgraph
Keywords: gdcdictionary,psqlgraph,graphml,mocks,testing,pytest
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
Provides-Extra: changelog
Provides-Extra: dev
Provides-Extra: docs
License-File: LICENSE

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

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

An extension for `pytest <https://pytest.org>`_ provide useful tools for testing applications that use `psqlgraph <https://github.com/NCI-GDC/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 <https://github.com/kulgan/pytest-psqlgraph/issues>`__ 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


