Skip to content

Commit

Permalink
Add python 3.10 to automated testing (#1539)
Browse files Browse the repository at this point in the history
* Add python 3.10 to automated testing

* fix: deprecated deamon thread deprecation warnings

* test: disable PytestCollectionWarning warnings

Co-authored-by: Sijis Aviles <sijis.aviles+github@gmail.com>
  • Loading branch information
nzlosh and sijis committed Dec 20, 2021
1 parent e36bafa commit 66e1de8
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion errbot/backends/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions errbot/backends/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -125,6 +129,8 @@ def __eq__(self, other):


class TestRoom(Room):
__test__ = False

def invite(self, *args):
pass

Expand Down
4 changes: 2 additions & 2 deletions errbot/botplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions tests/backend_tests/slack_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit 66e1de8

Please sign in to comment.