All Questions
5 questions
2
votes
2
answers
102
views
Goal: Writing Effective Unit Tests to Ensure a Datetime Conversion To/From Local-UTC Works
As the title lists, I am trying to write an effective unittest suite to ensure that the function that converts a date to UTC from local or vice-versa is doing as planned. But it seems hard because ...
4
votes
2
answers
4k
views
Fake utcnow for the pytest
I want to create a pytest with a fake utcnow, but also I need to preserve the functionality of all other datetime methods. ...
10
votes
1
answer
1k
views
Generate iCalendar .ics files with events for astrological aspects
I'm relatively new to Python, coming from a deep C++ background. I'm mostly looking for feedback on how to make my code more idiomatic/pythonic, but I would welcome and appreciate any and all other ...
5
votes
1
answer
3k
views
Calculate attendance compliance based on attendance record
This is part of a larger working system which I'm now trying to clean up. In the interests of making the system more test-able I'm splitting up the functions which can be split, but this 100-line ...
7
votes
3
answers
4k
views
Simple greeting program based with timezone offset
I made a simple set of functions that returns a greeting based on the current time, the user's timezone offset, and the user's level. For context I wrote this as a part of a larger chat bot ...