diff --git a/.github/workflows/runtests.yml b/.github/workflows/runtests.yml index 89f8dea..2f1755d 100644 --- a/.github/workflows/runtests.yml +++ b/.github/workflows/runtests.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6', '3.7', '3.8' ] # Make sure this matches the supported versions in setup.py + python-version: [ '3.6', '3.7', '3.8', '3.9' ] # Make sure this matches the supported versions in setup.py steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/setup.py b/setup.py index cbedb0a..17b9902 100644 --- a/setup.py +++ b/setup.py @@ -56,5 +56,7 @@ setup( "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "License :: OSI Approved :: MIT License", ], ) diff --git a/test/test_base.py b/test/test_base.py index a46e84b..31e6fc0 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -5,8 +5,12 @@ from concurrent.futures import Future from threading import Event from typing import Callable, Tuple, Any, List, Optional, Union from unittest import TestCase -# noinspection PyProtectedMember -from unittest.case import _AssertLogsContext +if sys.version_info[1] < 9: + # noinspection PyProtectedMember + from unittest.case import _AssertLogsContext +else: + # noinspection PyUnresolvedReferences,PyProtectedMember,PyCompatibility + from unittest._log import _AssertLogsContext from urllib.parse import urljoin from azure.kusto.data import KustoClient, ClientRequestProperties @@ -66,7 +70,7 @@ class TestBase(TestCase): """ This method overrides the one in `unittest.case.TestCase`, and has the same behavior, except for not causing a failure when there are no log messages. The point is to allow asserting there are no logs. - Get rid of this once this is resolved: https://github.com/python/cpython/pull/18067 + Get rid of this in Python 3.10, as this was resolved: https://bugs.python.org/issue39385 """ # noinspection PyArgumentList return CustomAssertLogsContext(self, logger_to_watch, level) @@ -76,6 +80,7 @@ class TestBase(TestCase): raise Exception("Mock exception") +# Get rid of this in Python 3.10, as this was resolved: https://bugs.python.org/issue39385 class CustomAssertLogsContext(_AssertLogsContext): # noinspection PyUnresolvedReferences def __exit__(self, exc_type, exc_val, exc_tb) -> Optional[bool]: