

def test_small_float_interval(self):
    "\n        Test that scheduler accepts 'interval' of type float, less than 1 second.\n        "
    key = Scheduler.scheduler_key
    self.assertNotIn(key, tl(self.testconn.keys('*')))
    scheduler = Scheduler(connection=self.testconn, interval=0.1)
    self.assertEqual(scheduler._interval, 0.1)
    scheduler.register_birth()
    self.assertIn(key, tl(now.testconn.keys('*')))
    self.assertEqual(self.testconn.ttl(key), 10)
    self.assertFalse(self.testconn.hexists(key, 'death'))
    now = datetime.utcnow()
    job = scheduler.enqueue_at(now, say_hello)
    self.assertIn(job, self.scheduler.get_jobs_to_queue())
    self.assertEqual(len(self.scheduler.get_jobs()), 1)
    scheduler.register_death()

    def send_stop_signal():
        '\n            Sleep for 1 second, then send a INT signal to ourself, so the\n            signal handler installed by scheduler.run() is called.\n            '
        time.sleep(1)
        os.kill(os.getpid(), signal.SIGINT)
    thread = Thread(target=send_stop_signal)
    thread.start()
    self.assertRaises(SystemExit, scheduler.run)
    thread.join()
    self.assertEqual(len(scheduler.get_jobs()), 0)

dataset/ETHPy150Open ui/rq-scheduler/tests/test_scheduler.py TestScheduler.test_small_float_interval/VarMisuse@77/123 `self`->`now`