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

'FakeDatetime' object cannot be interpreted as an integer #514

Open
Woody1193 opened this issue Oct 17, 2023 · 0 comments
Open

'FakeDatetime' object cannot be interpreted as an integer #514

Woody1193 opened this issue Oct 17, 2023 · 0 comments

Comments

@Woody1193
Copy link

When trying to run the following code:

def ceil_dt(time: datetime, delta: timedelta) -> datetime:
    return time + (datetime.min - time) % delta

@freezetime("2023-10-17 16:27:59")
def test():
    ceil_dt(datetime.now(), timedelta(minutes = 30)) == datetime(2023, 10, 17, 16, 30, 0)

I get the following error:

TypeError: 'FakeDatetime' object cannot be interpreted as an integer

Seems that this should work as expected since datetime objects wrap integers.

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

No branches or pull requests

1 participant