GrandMoff100 / RegexFactory

Dynamically construct regex patterns with native python representations
https://regexfactory.readthedocs.io
GNU General Public License v3.0
7 stars 4 forks source link

Feature/issue 11 start pytest testing #16

Closed frank113 closed 1 year ago

frank113 commented 1 year ago

Summary

This PR provides a starting point to partially address issue #11 . More specifically some of the operations in patterns.py are tested using property-based testing. This PR is intended to be a first step in fully testing this package and provide velocity by accounting for house-keeping items (such as the dev installation type).

Issues Addressed

Changes made

  1. Create a dev installation type in setup.cfg so that development dependencies can be installed as follows:
pip install -e .[dev]
  1. Construct dev package list from an examination of workflows and libraries needed for testing, namely pytest and hypothesis
  2. Add pytest configuration within setup.cfg
  3. Add default hypothesis profile in tests/conftest.py
  4. Create place for common strategy functions in tests/strategies.py
  5. Add unit tests for the following functionality:
    • Set
    • Or
    • Amount (Limited and not property-based at this time)
    • join
    • Range
  6. Add a main workflow to run unit tests either on command or within a PR
  7. Update styling workflow to allow calling by workflow dispatch
  8. Include changes from #14 so that all checks pass
  9. Add ESCAPED_CHARACTERS and ValidPatternType to pattern module exports defined in regexfactory/__init__.py

Considerations

Other

While the process of unit testing everything in the package will be a long process I hope this PR provides velocity to kick off the process!

Edit: Confirmation of workflow success: https://github.com/frank113/RegexFactory/actions/runs/5374169395/jobs/9749249875

GrandMoff100 commented 1 year ago

Yay! Thank you so much!

frank113 commented 1 year ago

Needed to sync with current master -- it is ready for review!