зеркало из https://github.com/Azure/pykusto.git
Add support for Python 3.9 (#146)
This commit is contained in:
Родитель
7d763dafb4
Коммит
636d100879
|
@ -15,7 +15,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -56,5 +56,7 @@ setup(
|
||||||
"Programming Language :: Python :: 3.6",
|
"Programming Language :: Python :: 3.6",
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,8 +5,12 @@ from concurrent.futures import Future
|
||||||
from threading import Event
|
from threading import Event
|
||||||
from typing import Callable, Tuple, Any, List, Optional, Union
|
from typing import Callable, Tuple, Any, List, Optional, Union
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
# noinspection PyProtectedMember
|
if sys.version_info[1] < 9:
|
||||||
from unittest.case import _AssertLogsContext
|
# noinspection PyProtectedMember
|
||||||
|
from unittest.case import _AssertLogsContext
|
||||||
|
else:
|
||||||
|
# noinspection PyUnresolvedReferences,PyProtectedMember,PyCompatibility
|
||||||
|
from unittest._log import _AssertLogsContext
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
from azure.kusto.data import KustoClient, ClientRequestProperties
|
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.
|
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.
|
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
|
# noinspection PyArgumentList
|
||||||
return CustomAssertLogsContext(self, logger_to_watch, level)
|
return CustomAssertLogsContext(self, logger_to_watch, level)
|
||||||
|
@ -76,6 +80,7 @@ class TestBase(TestCase):
|
||||||
raise Exception("Mock exception")
|
raise Exception("Mock exception")
|
||||||
|
|
||||||
|
|
||||||
|
# Get rid of this in Python 3.10, as this was resolved: https://bugs.python.org/issue39385
|
||||||
class CustomAssertLogsContext(_AssertLogsContext):
|
class CustomAssertLogsContext(_AssertLogsContext):
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
def __exit__(self, exc_type, exc_val, exc_tb) -> Optional[bool]:
|
def __exit__(self, exc_type, exc_val, exc_tb) -> Optional[bool]:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче