Skip to content

Comments

增加自动化测试#9

Open
lihuanshuai wants to merge 7 commits intoCutePandaSh:devfrom
lihuanshuai:master
Open

增加自动化测试#9
lihuanshuai wants to merge 7 commits intoCutePandaSh:devfrom
lihuanshuai:master

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
# 如果还没有到农历正月初一 农历年份减去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