AvocadoMoon / EventScraper

Application used to flow events from one source to another. Currently used by CTGrassRoots
https://ctgrassroots.org/
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Annotations For Test Mode #13

Closed AvocadoMoon closed 2 weeks ago

AvocadoMoon commented 2 weeks ago

Problem

I need to pass around a variable to every function that requires context to if execution is a test.

Solution

Implement some form of annotation that can be injected to reduce variable book-keeping, and unrelated ties to functions.

AvocadoMoon commented 2 weeks ago

Unlike Java which features the CDI, it seems there's no equivalent in python for that. A module can be created that features all of the different global variables wanted, or perhaps there's some other method, but for now it seems not worth the effort.

Global Variable from a Different Python File | Python Dependency Injection