clean pending update based on Timedelta or datetime#1987
Conversation
|
Hi. Thanks for the PR. TBH, I haven't looked in too much detail, yet. Regarding tests: I'm a bit surprised that we don't test clean at all. But If I see correctly, it should be enough to mock A few other things I noticed:
If you have more questions, please don't hesitate and ask :) |
|
Ok, I'll look into it. Is the use of |
Mh … I guess it would be cleaner to either add an explicit argument |
…erify timezone is set, fix it if not. Throw ValueError is timedelta < 1 sec or datetime not < '1 sec' from now. Still has a lot of debugging stuff in there.
Done. Freaking hate handling datetimes....
Done, used functools.partial. Thx btw, learned something new today :) |
|
|
|
I keep running into issues w/ pytest to get it running properly (keep ketting |
|
No but we have dev requirements did you install them? |
I haven't been able to come up with a all encompassing solution ... i guess you are right, it's too specific and not worth the effort. I'll close this PR. |
|
Okay. Still, thanks for taking the time and making the effort. It's always appreciated :) |
Follow-up of #1978
Add option to pass a
timedeltaordatetimeas varcleanto.start_polling()or.start_webhook().Updates with a timestamp before
now - timedeltawill be ignored.Updates before
datetimewill be ignored.I'm not familiar with the test-module to write these from scratch as this is not a 'direct' function to test. Can put in some time if y'all can point me to similar examples?
Maybe needs some cleanup but need the gh test bot results for that.