From 6cef5b0cd768f2ec66b36c1819664ba9879f11a9 Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 20 Dec 2021 07:03:34 +0100 Subject: [PATCH] Add python 3.10 to automated testing (#1539) * Add python 3.10 to automated testing * fix: deprecated deamon thread deprecation warnings * test: disable PytestCollectionWarning warnings Co-authored-by: Sijis Aviles --- .github/workflows/python-package.yml | 2 +- CHANGES.rst | 1 + errbot/backends/irc.py | 2 +- errbot/backends/test.py | 6 ++++++ errbot/botplugin.py | 4 ++-- setup.py | 1 + tests/backend_tests/slack_test.py | 2 ++ tox.ini | 2 +- 8 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 75a0f2ad9..56d18474a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.7, 3.8, 3.9, "3.10"] steps: - uses: actions/checkout@v2 diff --git a/CHANGES.rst b/CHANGES.rst index 489d15f6b..b553f67fe 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,7 @@ features: - core: set default backend to Text (#1522) - core: option to divert all commands to private or thread (#1528) - core: add type hints to core and backend functions (#1542) +- core: add Python 3.10 to automated tests (#1539) fixes: diff --git a/errbot/backends/irc.py b/errbot/backends/irc.py index 0edcf2c89..95a8757d4 100644 --- a/errbot/backends/irc.py +++ b/errbot/backends/irc.py @@ -412,7 +412,7 @@ def on_welcome(self, _, e) -> None: # from the ChatRoom plugin joining channels from CHATROOM_PRESENCE # ends up blocking on connect. t = threading.Thread(target=self.bot.connect_callback) - t.setDaemon(True) + t.daemon = True t.start() def _pubmsg(self, e, notice: bool = False) -> None: diff --git a/errbot/backends/test.py b/errbot/backends/test.py index 694bfecbf..62fdb9b5b 100644 --- a/errbot/backends/test.py +++ b/errbot/backends/test.py @@ -49,6 +49,8 @@ class TestPerson(Person): methods exposed by this class. """ + __test__ = False + def __init__(self, person, client=None, nick=None, fullname=None, email=None): self._person = person self._client = client @@ -107,6 +109,8 @@ class TestOccupant(TestPerson, RoomOccupant): DO NOT USE THIS DIRECTLY AS IT IS NOT COMPATIBLE WITH MOST BACKENDS, """ + __test__ = False + def __init__(self, person, room): super().__init__(person) self._room = room @@ -125,6 +129,8 @@ def __eq__(self, other): class TestRoom(Room): + __test__ = False + def invite(self, *args): pass diff --git a/errbot/botplugin.py b/errbot/botplugin.py index efb3ad2ed..dcdeffc79 100644 --- a/errbot/botplugin.py +++ b/errbot/botplugin.py @@ -305,8 +305,8 @@ def program_next_poll( }, ) self.current_timers.append(t) # save the timer to be able to kill it - t.setName(f"Poller thread for {type(method.__self__).__name__}") - t.setDaemon(True) # so it is not locking on exit + t.name = f"Poller thread for {type(method.__self__).__name__}" + t.daemon = True # so it is not locking on exit t.start() def poller( diff --git a/setup.py b/setup.py index 5e1664bcc..cb44ce8a9 100755 --- a/setup.py +++ b/setup.py @@ -141,6 +141,7 @@ def read(fname, encoding="ascii"): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], src_root=src_root, platforms="any", diff --git a/tests/backend_tests/slack_test.py b/tests/backend_tests/slack_test.py index b7009a447..3d9473032 100644 --- a/tests/backend_tests/slack_test.py +++ b/tests/backend_tests/slack_test.py @@ -14,6 +14,8 @@ from errbot.backends import slack class TestSlackBackend(slack.SlackBackend): + __test__ = False + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.test_msgs = [] diff --git a/tox.ini b/tox.ini index ecae8c8ed..ff2da9010 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37,py38,py39,codestyle,dist-check,sort,security +envlist = py37,py38,py39,py310,codestyle,dist-check,sort,security skip_missing_interpreters = True [testenv]