Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-tempora for openSUSE:Factory 
checked in at 2023-01-05 15:00:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tempora (Old)
 and      /work/SRC/openSUSE:Factory/.python-tempora.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-tempora"

Thu Jan  5 15:00:26 2023 rev:15 rq:1055980 version:5.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tempora/python-tempora.changes    
2022-12-06 14:22:47.605381749 +0100
+++ /work/SRC/openSUSE:Factory/.python-tempora.new.1563/python-tempora.changes  
2023-01-05 15:00:39.760960126 +0100
@@ -1,0 +2,6 @@
+Wed Jan  4 18:47:50 UTC 2023 - Dirk Müller <dmuel...@suse.com>
+
+- update to 5.2.0:
+  * Packaging refresh.
+
+-------------------------------------------------------------------

Old:
----
  tempora-5.1.0.tar.gz

New:
----
  tempora-5.2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-tempora.spec ++++++
--- /var/tmp/diff_new_pack.yyK3a9/_old  2023-01-05 15:00:40.216962530 +0100
+++ /var/tmp/diff_new_pack.yyK3a9/_new  2023-01-05 15:00:40.224962572 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-tempora
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 %bcond_with libalternatives
 %endif
 Name:           python-tempora
-Version:        5.1.0
+Version:        5.2.0
 Release:        0
 Summary:        Objects and routines pertaining to date and time (tempora)
 License:        MIT

++++++ tempora-5.1.0.tar.gz -> tempora-5.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/.github/workflows/main.yml 
new/tempora-5.2.0/.github/workflows/main.yml
--- old/tempora-5.1.0/.github/workflows/main.yml        2022-11-19 
16:33:44.000000000 +0100
+++ new/tempora-5.2.0/.github/workflows/main.yml        2023-01-02 
09:32:03.000000000 +0100
@@ -7,8 +7,10 @@
   # Request colored output from CLI tools supporting it. Different tools
   # interpret the value differently. For some, just being set is sufficient.
   # For others, it must be a non-zero integer. For yet others, being set
-  # to a non-empty value is sufficient.
-  FORCE_COLOR: -106
+  # to a non-empty value is sufficient. For tox, it must be one of
+  # <blank>, 0, 1, false, no, off, on, true, yes. The only enabling value
+  # in common is "1".
+  FORCE_COLOR: 1
   # MyPy's color enforcement (must be a non-zero number)
   MYPY_FORCE_COLOR: -42
   # Recognized by the `py` package, dependency of `pytest` (must be "1")
@@ -57,6 +59,23 @@
         - python: pypy3.9
           platform: ubuntu-latest
     runs-on: ${{ matrix.platform }}
+    continue-on-error: ${{ matrix.python == '3.12' }}
+    steps:
+      - uses: actions/checkout@v3
+      - name: Setup Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: ${{ matrix.python }}${{ matrix.dev }}
+      - name: Install tox
+        run: |
+          python -m pip install tox
+      - name: Run tests
+        run: tox
+
+  docs:
+    runs-on: ubuntu-latest
+    env:
+      TOXENV: docs
     steps:
       - uses: actions/checkout@v3
       - name: Setup Python
@@ -74,6 +93,7 @@
 
     needs:
     - test
+    - docs
 
     runs-on: ubuntu-latest
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/CHANGES.rst 
new/tempora-5.2.0/CHANGES.rst
--- old/tempora-5.1.0/CHANGES.rst       2022-11-19 16:33:44.000000000 +0100
+++ new/tempora-5.2.0/CHANGES.rst       2023-01-02 09:32:03.000000000 +0100
@@ -1,3 +1,13 @@
+v5.2.0
+======
+
+Remove dependency on jaraco.functools.
+
+v5.1.1
+======
+
+Packaging refresh.
+
 v5.1.0
 ======
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/PKG-INFO new/tempora-5.2.0/PKG-INFO
--- old/tempora-5.1.0/PKG-INFO  2022-11-19 16:34:05.922559300 +0100
+++ new/tempora-5.2.0/PKG-INFO  2023-01-02 09:32:23.954433700 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: tempora
-Version: 5.1.0
+Version: 5.2.0
 Summary: Objects and routines pertaining to date and time (tempora)
 Home-page: https://github.com/jaraco/tempora
 Author: Jason R. Coombs
@@ -31,7 +31,7 @@
 .. image:: https://readthedocs.org/projects/tempora/badge/?version=latest
    :target: https://tempora.readthedocs.io/en/latest/?badge=latest
 
-.. image:: https://img.shields.io/badge/skeleton-2022-informational
+.. image:: https://img.shields.io/badge/skeleton-2023-informational
    :target: https://blog.jaraco.com/skeleton
 
 .. image:: https://tidelift.com/badges/package/pypi/tempora
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/README.rst new/tempora-5.2.0/README.rst
--- old/tempora-5.1.0/README.rst        2022-11-19 16:33:44.000000000 +0100
+++ new/tempora-5.2.0/README.rst        2023-01-02 09:32:03.000000000 +0100
@@ -14,7 +14,7 @@
 .. image:: https://readthedocs.org/projects/tempora/badge/?version=latest
    :target: https://tempora.readthedocs.io/en/latest/?badge=latest
 
-.. image:: https://img.shields.io/badge/skeleton-2022-informational
+.. image:: https://img.shields.io/badge/skeleton-2023-informational
    :target: https://blog.jaraco.com/skeleton
 
 .. image:: https://tidelift.com/badges/package/pypi/tempora
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/docs/conf.py 
new/tempora-5.2.0/docs/conf.py
--- old/tempora-5.1.0/docs/conf.py      2022-11-19 16:33:44.000000000 +0100
+++ new/tempora-5.2.0/docs/conf.py      2023-01-02 09:32:03.000000000 +0100
@@ -1,6 +1,3 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-
 extensions = [
     'sphinx.ext.autodoc',
     'jaraco.packaging.sphinx',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/pytest.ini new/tempora-5.2.0/pytest.ini
--- old/tempora-5.1.0/pytest.ini        2022-11-19 16:33:44.000000000 +0100
+++ new/tempora-5.2.0/pytest.ini        2023-01-02 09:32:03.000000000 +0100
@@ -3,6 +3,9 @@
 addopts=--doctest-modules
 doctest_optionflags=ALLOW_UNICODE ELLIPSIS
 filterwarnings=
+       # Ensure ResourceWarnings are emitted
+       default::ResourceWarning
+
        # Suppress deprecation warning in flake8
        ignore:SelectableGroups dict interface is deprecated::flake8
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/setup.cfg new/tempora-5.2.0/setup.cfg
--- old/tempora-5.1.0/setup.cfg 2022-11-19 16:34:05.922559300 +0100
+++ new/tempora-5.2.0/setup.cfg 2023-01-02 09:32:23.954433700 +0100
@@ -18,7 +18,6 @@
 python_requires = >=3.7
 install_requires = 
        pytz
-       jaraco.functools>=1.20
 
 [options.packages.find]
 exclude = 
@@ -51,6 +50,8 @@
        jaraco.packaging >= 9
        rst.linker >= 1.9
        furo
+       sphinx-lint
+       
        jaraco.tidelift >= 1.4
 
 [options.entry_points]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tempora/__init__.py 
new/tempora-5.2.0/tempora/__init__.py
--- old/tempora-5.1.0/tempora/__init__.py       2022-11-19 16:33:44.000000000 
+0100
+++ new/tempora-5.2.0/tempora/__init__.py       2023-01-02 09:32:03.000000000 
+0100
@@ -11,9 +11,6 @@
 from typing import cast
 
 
-from jaraco.functools import once
-
-
 # some useful constants
 osc_per_year = 290_091_329_207_984_000
 """
@@ -36,7 +33,7 @@
 hours_per_month = hours_per_day * days_per_year / 12
 
 
-@once
+@functools.lru_cache()
 def _needs_year_help() -> bool:
     """
     Some versions of Python render %Y with only three characters :(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tempora/tests/test_schedule.py 
new/tempora-5.2.0/tempora/tests/test_schedule.py
--- old/tempora-5.1.0/tempora/tests/test_schedule.py    2022-11-19 
16:33:44.000000000 +0100
+++ new/tempora-5.2.0/tempora/tests/test_schedule.py    1970-01-01 
01:00:00.000000000 +0100
@@ -1,149 +0,0 @@
-import time
-import random
-import datetime
-from unittest import mock
-
-import pytest
-import pytz
-import freezegun
-
-from tempora import schedule
-
-
-do_nothing = type(None)
-
-
-def test_delayed_command_order():
-    """
-    delayed commands should be sorted by delay time
-    """
-    delays = [random.randint(0, 99) for x in range(5)]
-    cmds = sorted(
-        [schedule.DelayedCommand.after(delay, do_nothing) for delay in delays]
-    )
-    assert [c.delay.seconds for c in cmds] == sorted(delays)
-
-
-def test_periodic_command_delay():
-    "A PeriodicCommand must have a positive, non-zero delay."
-    with pytest.raises(ValueError) as exc_info:
-        schedule.PeriodicCommand.after(0, None)
-    assert str(exc_info.value) == test_periodic_command_delay.__doc__
-
-
-def test_periodic_command_fixed_delay():
-    """
-    Test that we can construct a periodic command with a fixed initial
-    delay.
-    """
-    fd = schedule.PeriodicCommandFixedDelay.at_time(
-        at=schedule.now(), delay=datetime.timedelta(seconds=2), target=lambda: 
None
-    )
-    assert fd.due() is True
-    assert fd.next().due() is False
-
-
-class TestCommands:
-    def test_delayed_command_from_timestamp(self):
-        """
-        Ensure a delayed command can be constructed from a timestamp.
-        """
-        t = time.time()
-        schedule.DelayedCommand.at_time(t, do_nothing)
-
-    def test_command_at_noon(self):
-        """
-        Create a periodic command that's run at noon every day.
-        """
-        when = datetime.time(12, 0, tzinfo=pytz.utc)
-        cmd = schedule.PeriodicCommandFixedDelay.daily_at(when, target=None)
-        assert cmd.due() is False
-        next_cmd = cmd.next()
-        daily = datetime.timedelta(days=1)
-        day_from_now = schedule.now() + daily
-        two_days_from_now = day_from_now + daily
-        assert day_from_now < next_cmd < two_days_from_now
-
-    @pytest.mark.parametrize("hour", range(10, 14))
-    @pytest.mark.parametrize("tz_offset", (14, -14))
-    def test_command_at_noon_distant_local(self, hour, tz_offset):
-        """
-        Run test_command_at_noon, but with the local timezone
-        more than 12 hours away from UTC.
-        """
-        with freezegun.freeze_time(f"2020-01-10 {hour:02}:01", 
tz_offset=tz_offset):
-            self.test_command_at_noon()
-
-
-class TestTimezones:
-    def test_alternate_timezone_west(self):
-        target_tz = pytz.timezone('US/Pacific')
-        target = schedule.now().astimezone(target_tz)
-        cmd = schedule.DelayedCommand.at_time(target, target=None)
-        assert cmd.due()
-
-    def test_alternate_timezone_east(self):
-        target_tz = pytz.timezone('Europe/Amsterdam')
-        target = schedule.now().astimezone(target_tz)
-        cmd = schedule.DelayedCommand.at_time(target, target=None)
-        assert cmd.due()
-
-    def test_daylight_savings(self):
-        """
-        A command at 9am should always be 9am regardless of
-        a DST boundary.
-        """
-        with freezegun.freeze_time('2018-03-10 08:00:00'):
-            target_tz = pytz.timezone('US/Eastern')
-            target_time = datetime.time(9, tzinfo=target_tz)
-            cmd = schedule.PeriodicCommandFixedDelay.daily_at(
-                target_time, target=lambda: None
-            )
-
-        def naive(dt):
-            return dt.replace(tzinfo=None)
-
-        assert naive(cmd) == datetime.datetime(2018, 3, 10, 9, 0, 0)
-        next_ = cmd.next()
-        assert naive(next_) == datetime.datetime(2018, 3, 11, 9, 0, 0)
-        assert next_ - cmd == datetime.timedelta(hours=23)
-
-
-class TestScheduler:
-    def test_invoke_scheduler(self):
-        sched = schedule.InvokeScheduler()
-        target = mock.MagicMock()
-        cmd = schedule.DelayedCommand.after(0, target)
-        sched.add(cmd)
-        sched.run_pending()
-        target.assert_called_once()
-        assert not sched.queue
-
-    def test_callback_scheduler(self):
-        callback = mock.MagicMock()
-        sched = schedule.CallbackScheduler(callback)
-        target = mock.MagicMock()
-        cmd = schedule.DelayedCommand.after(0, target)
-        sched.add(cmd)
-        sched.run_pending()
-        callback.assert_called_once_with(target)
-
-    def test_periodic_command(self):
-        sched = schedule.InvokeScheduler()
-        target = mock.MagicMock()
-
-        before = datetime.datetime.utcnow()
-
-        cmd = schedule.PeriodicCommand.after(10, target)
-        sched.add(cmd)
-        sched.run_pending()
-        target.assert_not_called()
-
-        with freezegun.freeze_time(before + datetime.timedelta(seconds=15)):
-            sched.run_pending()
-        assert sched.queue
-        target.assert_called_once()
-
-        with freezegun.freeze_time(before + datetime.timedelta(seconds=25)):
-            sched.run_pending()
-        assert target.call_count == 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tempora/tests/test_timing.py 
new/tempora-5.2.0/tempora/tests/test_timing.py
--- old/tempora-5.1.0/tempora/tests/test_timing.py      2022-11-19 
16:33:44.000000000 +0100
+++ new/tempora-5.2.0/tempora/tests/test_timing.py      1970-01-01 
01:00:00.000000000 +0100
@@ -1,50 +0,0 @@
-import datetime
-import time
-import contextlib
-import os
-from unittest import mock
-
-import pytest
-from tempora import timing
-
-
-def test_IntervalGovernor():
-    """
-    IntervalGovernor should prevent a function from being called more than
-    once per interval.
-    """
-    func_under_test = mock.MagicMock()
-    # to look like a function, it needs a __name__ attribute
-    func_under_test.__name__ = 'func_under_test'
-    interval = datetime.timedelta(seconds=1)
-    governed = timing.IntervalGovernor(interval)(func_under_test)
-    governed('a')
-    governed('b')
-    governed(3, 'sir')
-    func_under_test.assert_called_once_with('a')
-
-
-@pytest.fixture
-def alt_tz(monkeypatch):
-    hasattr(time, 'tzset') or pytest.skip("tzset not available")
-
-    @contextlib.contextmanager
-    def change():
-        val = 'AEST-10AEDT-11,M10.5.0,M3.5.0'
-        with monkeypatch.context() as ctx:
-            ctx.setitem(os.environ, 'TZ', val)
-            time.tzset()
-            yield
-        time.tzset()
-
-    return change()
-
-
-def test_Stopwatch_timezone_change(alt_tz):
-    """
-    The stopwatch should provide a consistent duration even
-    if the timezone changes.
-    """
-    watch = timing.Stopwatch()
-    with alt_tz:
-        assert abs(watch.split().total_seconds()) < 0.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tempora.egg-info/PKG-INFO 
new/tempora-5.2.0/tempora.egg-info/PKG-INFO
--- old/tempora-5.1.0/tempora.egg-info/PKG-INFO 2022-11-19 16:34:05.000000000 
+0100
+++ new/tempora-5.2.0/tempora.egg-info/PKG-INFO 2023-01-02 09:32:23.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: tempora
-Version: 5.1.0
+Version: 5.2.0
 Summary: Objects and routines pertaining to date and time (tempora)
 Home-page: https://github.com/jaraco/tempora
 Author: Jason R. Coombs
@@ -31,7 +31,7 @@
 .. image:: https://readthedocs.org/projects/tempora/badge/?version=latest
    :target: https://tempora.readthedocs.io/en/latest/?badge=latest
 
-.. image:: https://img.shields.io/badge/skeleton-2022-informational
+.. image:: https://img.shields.io/badge/skeleton-2023-informational
    :target: https://blog.jaraco.com/skeleton
 
 .. image:: https://tidelift.com/badges/package/pypi/tempora
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tempora.egg-info/SOURCES.txt 
new/tempora-5.2.0/tempora.egg-info/SOURCES.txt
--- old/tempora-5.1.0/tempora.egg-info/SOURCES.txt      2022-11-19 
16:34:05.000000000 +0100
+++ new/tempora-5.2.0/tempora.egg-info/SOURCES.txt      2023-01-02 
09:32:23.000000000 +0100
@@ -28,5 +28,5 @@
 tempora.egg-info/entry_points.txt
 tempora.egg-info/requires.txt
 tempora.egg-info/top_level.txt
-tempora/tests/test_schedule.py
-tempora/tests/test_timing.py
\ No newline at end of file
+tests/test_schedule.py
+tests/test_timing.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tempora.egg-info/requires.txt 
new/tempora-5.2.0/tempora.egg-info/requires.txt
--- old/tempora-5.1.0/tempora.egg-info/requires.txt     2022-11-19 
16:34:05.000000000 +0100
+++ new/tempora-5.2.0/tempora.egg-info/requires.txt     2023-01-02 
09:32:23.000000000 +0100
@@ -1,11 +1,11 @@
 pytz
-jaraco.functools>=1.20
 
 [docs]
 sphinx>=3.5
 jaraco.packaging>=9
 rst.linker>=1.9
 furo
+sphinx-lint
 jaraco.tidelift>=1.4
 
 [testing]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tests/test_schedule.py 
new/tempora-5.2.0/tests/test_schedule.py
--- old/tempora-5.1.0/tests/test_schedule.py    1970-01-01 01:00:00.000000000 
+0100
+++ new/tempora-5.2.0/tests/test_schedule.py    2023-01-02 09:32:03.000000000 
+0100
@@ -0,0 +1,149 @@
+import time
+import random
+import datetime
+from unittest import mock
+
+import pytest
+import pytz
+import freezegun
+
+from tempora import schedule
+
+
+do_nothing = type(None)
+
+
+def test_delayed_command_order():
+    """
+    delayed commands should be sorted by delay time
+    """
+    delays = [random.randint(0, 99) for x in range(5)]
+    cmds = sorted(
+        [schedule.DelayedCommand.after(delay, do_nothing) for delay in delays]
+    )
+    assert [c.delay.seconds for c in cmds] == sorted(delays)
+
+
+def test_periodic_command_delay():
+    "A PeriodicCommand must have a positive, non-zero delay."
+    with pytest.raises(ValueError) as exc_info:
+        schedule.PeriodicCommand.after(0, None)
+    assert str(exc_info.value) == test_periodic_command_delay.__doc__
+
+
+def test_periodic_command_fixed_delay():
+    """
+    Test that we can construct a periodic command with a fixed initial
+    delay.
+    """
+    fd = schedule.PeriodicCommandFixedDelay.at_time(
+        at=schedule.now(), delay=datetime.timedelta(seconds=2), target=lambda: 
None
+    )
+    assert fd.due() is True
+    assert fd.next().due() is False
+
+
+class TestCommands:
+    def test_delayed_command_from_timestamp(self):
+        """
+        Ensure a delayed command can be constructed from a timestamp.
+        """
+        t = time.time()
+        schedule.DelayedCommand.at_time(t, do_nothing)
+
+    def test_command_at_noon(self):
+        """
+        Create a periodic command that's run at noon every day.
+        """
+        when = datetime.time(12, 0, tzinfo=pytz.utc)
+        cmd = schedule.PeriodicCommandFixedDelay.daily_at(when, target=None)
+        assert cmd.due() is False
+        next_cmd = cmd.next()
+        daily = datetime.timedelta(days=1)
+        day_from_now = schedule.now() + daily
+        two_days_from_now = day_from_now + daily
+        assert day_from_now < next_cmd < two_days_from_now
+
+    @pytest.mark.parametrize("hour", range(10, 14))
+    @pytest.mark.parametrize("tz_offset", (14, -14))
+    def test_command_at_noon_distant_local(self, hour, tz_offset):
+        """
+        Run test_command_at_noon, but with the local timezone
+        more than 12 hours away from UTC.
+        """
+        with freezegun.freeze_time(f"2020-01-10 {hour:02}:01", 
tz_offset=tz_offset):
+            self.test_command_at_noon()
+
+
+class TestTimezones:
+    def test_alternate_timezone_west(self):
+        target_tz = pytz.timezone('US/Pacific')
+        target = schedule.now().astimezone(target_tz)
+        cmd = schedule.DelayedCommand.at_time(target, target=None)
+        assert cmd.due()
+
+    def test_alternate_timezone_east(self):
+        target_tz = pytz.timezone('Europe/Amsterdam')
+        target = schedule.now().astimezone(target_tz)
+        cmd = schedule.DelayedCommand.at_time(target, target=None)
+        assert cmd.due()
+
+    def test_daylight_savings(self):
+        """
+        A command at 9am should always be 9am regardless of
+        a DST boundary.
+        """
+        with freezegun.freeze_time('2018-03-10 08:00:00'):
+            target_tz = pytz.timezone('US/Eastern')
+            target_time = datetime.time(9, tzinfo=target_tz)
+            cmd = schedule.PeriodicCommandFixedDelay.daily_at(
+                target_time, target=lambda: None
+            )
+
+        def naive(dt):
+            return dt.replace(tzinfo=None)
+
+        assert naive(cmd) == datetime.datetime(2018, 3, 10, 9, 0, 0)
+        next_ = cmd.next()
+        assert naive(next_) == datetime.datetime(2018, 3, 11, 9, 0, 0)
+        assert next_ - cmd == datetime.timedelta(hours=23)
+
+
+class TestScheduler:
+    def test_invoke_scheduler(self):
+        sched = schedule.InvokeScheduler()
+        target = mock.MagicMock()
+        cmd = schedule.DelayedCommand.after(0, target)
+        sched.add(cmd)
+        sched.run_pending()
+        target.assert_called_once()
+        assert not sched.queue
+
+    def test_callback_scheduler(self):
+        callback = mock.MagicMock()
+        sched = schedule.CallbackScheduler(callback)
+        target = mock.MagicMock()
+        cmd = schedule.DelayedCommand.after(0, target)
+        sched.add(cmd)
+        sched.run_pending()
+        callback.assert_called_once_with(target)
+
+    def test_periodic_command(self):
+        sched = schedule.InvokeScheduler()
+        target = mock.MagicMock()
+
+        before = datetime.datetime.utcnow()
+
+        cmd = schedule.PeriodicCommand.after(10, target)
+        sched.add(cmd)
+        sched.run_pending()
+        target.assert_not_called()
+
+        with freezegun.freeze_time(before + datetime.timedelta(seconds=15)):
+            sched.run_pending()
+        assert sched.queue
+        target.assert_called_once()
+
+        with freezegun.freeze_time(before + datetime.timedelta(seconds=25)):
+            sched.run_pending()
+        assert target.call_count == 2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tests/test_timing.py 
new/tempora-5.2.0/tests/test_timing.py
--- old/tempora-5.1.0/tests/test_timing.py      1970-01-01 01:00:00.000000000 
+0100
+++ new/tempora-5.2.0/tests/test_timing.py      2023-01-02 09:32:03.000000000 
+0100
@@ -0,0 +1,50 @@
+import datetime
+import time
+import contextlib
+import os
+from unittest import mock
+
+import pytest
+from tempora import timing
+
+
+def test_IntervalGovernor():
+    """
+    IntervalGovernor should prevent a function from being called more than
+    once per interval.
+    """
+    func_under_test = mock.MagicMock()
+    # to look like a function, it needs a __name__ attribute
+    func_under_test.__name__ = 'func_under_test'
+    interval = datetime.timedelta(seconds=1)
+    governed = timing.IntervalGovernor(interval)(func_under_test)
+    governed('a')
+    governed('b')
+    governed(3, 'sir')
+    func_under_test.assert_called_once_with('a')
+
+
+@pytest.fixture
+def alt_tz(monkeypatch):
+    hasattr(time, 'tzset') or pytest.skip("tzset not available")
+
+    @contextlib.contextmanager
+    def change():
+        val = 'AEST-10AEDT-11,M10.5.0,M3.5.0'
+        with monkeypatch.context() as ctx:
+            ctx.setitem(os.environ, 'TZ', val)
+            time.tzset()
+            yield
+        time.tzset()
+
+    return change()
+
+
+def test_Stopwatch_timezone_change(alt_tz):
+    """
+    The stopwatch should provide a consistent duration even
+    if the timezone changes.
+    """
+    watch = timing.Stopwatch()
+    with alt_tz:
+        assert abs(watch.split().total_seconds()) < 0.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/tempora-5.1.0/tox.ini new/tempora-5.2.0/tox.ini
--- old/tempora-5.1.0/tox.ini   2022-11-19 16:33:44.000000000 +0100
+++ new/tempora-5.2.0/tox.ini   2023-01-02 09:32:03.000000000 +0100
@@ -20,6 +20,7 @@
 changedir = docs
 commands =
        python -m sphinx -W --keep-going . {toxinidir}/build/html
+       python -m sphinxlint
 
 [testenv:release]
 skip_install = True

Reply via email to