billdeitrick / pypco

A Python client for the Planning Center Online API.
MIT License
39 stars 13 forks source link

Ideas to Improvements for testing #60

Open 07pepa opened 2 years ago

07pepa commented 2 years ago

This are issues i see in testing and perhaps it could be slowly addressed refactored (sorted in significance order)

  1. global REQUEST_COUNT, TIMEOUTS and such i would forbid... it is super simple to leak stuff between test (and it makes paralell run fail) in betwean test due global keyword.... a rewrite to some context manager that you would set via params and it would mocked you what you need and returned class that you could inspect later a global keyword could be avoided
  2. i would prefer to migrate from unittest stile (in class) to pytest style test (it is quite antiquated and you can do leaks in between the test much more easyly then unit test style (anyway pytest is more used thease days and can plug into itself coverage mypy, distributing test to many threads and others)
  3. a dirty equals could be used to greatly simplyfy all tests
  4. formating for pycharm