Brendan McCollam committed 119c645

Remove naive datetime logic from apscheduler.job

Comments (0)

Files changed (2)


 from uuid import uuid4
 import six
-from tzlocal import get_localzone
 from apscheduler.triggers.base import BaseTrigger
 from apscheduler.util import ref_to_obj, obj_to_ref, datetime_repr, repr_escape, get_callable_name, check_callable_args
             value = changes.pop('next_run_time')
             if value and not isinstance(value, datetime):
                 raise TypeError('next_run_time must be either None or a datetime instance')
-            if value and value.tzinfo is None:
-                value = get_localzone().localize(value)
             approved['next_run_time'] = value
         if changes:


 import pytest
 import six
-from tzlocal import get_localzone
 from apscheduler.job import Job
 from apscheduler.schedulers.base import BaseScheduler
     assert str(exc.value) == 'next_run_time must be either None or a datetime instance'
-def test_private_modify_offset_naive_next_run_time(job):
-    """Tests that a datetime object without timezone information will get
-    automatically localized to the local timezone."""
-    naive_datetime = datetime(2011, 4, 3, 18, 40)
-    job._modify(next_run_time=naive_datetime)
-    assert job.next_run_time == get_localzone().localize(naive_datetime)
 def test_private_modify_bad_argument(job):
     """Tests that passing an unmodifiable argument type raises an AttributeError."""