Skip to content
New issue

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

增加自动化测试 #9

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Conversation

lihuanshuai
Copy link

@lihuanshuai lihuanshuai commented Sep 20, 2023

  • 增加 flake8 和 pytest 的 github action workflow,新 pr 或 push 时自动测试
  • 修复相关报错
  • 修改 sample 中不恰当的命名
image

@CutePandaSh CutePandaSh changed the base branch from master to Dev September 24, 2023 22:20
@CutePandaSh CutePandaSh deleted the branch CutePandaSh:dev September 24, 2023 22:26
@CutePandaSh CutePandaSh reopened this Sep 24, 2023
@CutePandaSh CutePandaSh changed the base branch from Dev to develop September 24, 2023 22:38
@CutePandaSh CutePandaSh changed the base branch from develop to dev September 24, 2023 22:43
@@ -55,17 +56,19 @@ def from_datetime(dt):
ZhDate -- 生成的农历日期对象
"""
lunar_year = dt.year
# 如果还没有到农历正月初一 农历年份减去1
lunar_year -= (datetime.strptime(CHINESENEWYEAR[lunar_year-1900], '%Y%m%d') - dt).total_seconds() > 0
# 当时农历新年时的日期对象
newyear_dt = datetime.strptime(CHINESENEWYEAR[lunar_year-1900], '%Y%m%d')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能这样写,你这个写法会导致newyear_dt是在lunar_year确定之前就已经确定了。
必须要先判断是否是农历正月初一之前,确定 lunar_year是否需要减1,之后,再获取newyear_dt的值

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复并补充了测试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants