A little Pomodoro timer. It blocks websites for 25 minutes, unblocks them for a 5 minute break, and repeats.

pomodoro[source]

pomodoro(work_time=25, break_time=5, pomodoros=4)

Run 2 Pomodoros of 1 second each

pomodoro(work_time=1/60, break_time=1/60, pomodoros=2)
Pomodoro no. 1 of 2 started, work for 0.016666666666666666 minutes
Pomodoro no. 1 ended, take a 0.016666666666666666 minutes break
Pomodoro no. 2 of 2 started, work for 0.016666666666666666 minutes
Pomodoro session ended, take a longer break. All websites unblocked.

Make sure that websites are unblocked after the Pomodoro session:

assert filecmp.cmp(host_fp, host_fp_copy) == True, "hosts file should be identical to hosts.original"