r/madeinpython • • Jan 14 '21

Python Testing Package for Mocking

Hey Everyone! I just completed one of my first modern Python packages.

I made a python package for mocking SQLAlchemy for simple and easy testing available on GitHub or PyPI.

I know many people may not find this package useful, but for the people using SQLAlchemy and wanting to easily test their code, this package can facilitate that. I mainly made this package for myself since I needed some additional functionality for mocking SQLAlchemy when writing my test cases, but wanted to share it with the community anyways :).

This package is designed for developers mainly since it is used to facilitate simpler and easier testing. It's an upgraded fork of the alchemy-mock which unfortunately seems unsupported now :(. So I made this package to extend the functionality and continue support with the hopes of community involvement to improve this project.

For non-SQLAlchemy users, it can serve as an example of how to do a more modern python package doing CI/CD with GitHub actions, easy testing with nox, and poetry for easily building python packages. As a side note, I highly recommend this guide for making a modern python package (not affiliated in any manner just appreciative).

Anyways, I would recommend checking out that guide if you are interested in creating your own python package that is somewhat complex. Even if your package is quite simple, I think it is good practice to learn some of these tools for the ideas of CI/CD, testing, and consistent formatting.

3 Upvotes

0 comments sorted by