Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Filter by
Sorted by
Tagged with
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 ...
0004's user avatar
  • 121
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. ...
user avatar
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 ...
feuGene's user avatar
  • 363
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 ...
Ng Oon-Ee's user avatar
  • 151
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 ...
d_dd's user avatar
  • 173