We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
比如 https://github.com/InvoluteHell/Pallas-Bot/blob/master/src/plugins/roulette/pseudorandom.py
如果直接写单元测试会执行 __init__.py 的 from src.common.config import BotConfig,里面会连接数据库。
__init__.py
from src.common.config import BotConfig
参见:https://github.com/InvoluteHell/Pallas-Bot/blob/master/src/plugins/roulette/__init__.py#L9
可不可以把 src.common.config 的初始化代码放在某些函数里,需要的时候调用?
src.common.config
P.S. 需要访问某些属性的时候延迟加载如何?
The text was updated successfully, but these errors were encountered:
似乎可以,之前没考虑过这么多(
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
比如 https://github.com/InvoluteHell/Pallas-Bot/blob/master/src/plugins/roulette/pseudorandom.py
如果直接写单元测试会执行
__init__.py
的from src.common.config import BotConfig
,里面会连接数据库。参见:https://github.com/InvoluteHell/Pallas-Bot/blob/master/src/plugins/roulette/__init__.py#L9
可不可以把
src.common.config
的初始化代码放在某些函数里,需要的时候调用?P.S. 需要访问某些属性的时候延迟加载如何?
The text was updated successfully, but these errors were encountered: