Skip to content

Commit

Permalink
skip tests for 3.7-
Browse files Browse the repository at this point in the history
  • Loading branch information
YunchuWang committed Apr 5, 2024
1 parent 2b99faa commit 5d25510
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/endtoend/test_http_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Licensed under the MIT License.
import concurrent
import os
import sys
import typing
import unittest
from concurrent.futures import ThreadPoolExecutor
from unittest.mock import patch

Expand Down Expand Up @@ -222,6 +224,7 @@ def tearDownClass(cls):
super().tearDownClass()


@unittest.skipIf(sys.version_info <= (3, 7), "Skipping tests if <= Python 3.7")
class TestHttpFunctionsV2FastApiWithInitIndexing(TestHttpFunctionsWithInitIndexing):
@classmethod
def get_script_dir(cls):
Expand Down
10 changes: 10 additions & 0 deletions tests/unittests/test_http_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ def check_log_debug_logging(self, host_out: typing.List[str]):
self.assertIn('logging error', host_out)
self.assertNotIn('logging debug', host_out)

def test_debug_with_user_logging(self):
r = self.webhost.request('GET', 'debug_user_logging')
self.assertEqual(r.status_code, 200)
self.assertEqual(r.text, 'OK-user-debug')

def check_log_debug_with_user_logging(self, host_out: typing.List[str]):
self.assertIn('logging info', host_out)
self.assertIn('logging warning', host_out)
Expand Down Expand Up @@ -457,3 +462,8 @@ def test_no_return_returns(self):
r = self.webhost.request('GET', 'no_return_returns')
self.assertEqual(r.status_code, 200)

class TestHttpFunctionsV2(TestHttpFunctions):
@classmethod
def get_script_dir(cls):
return testutils.UNIT_TESTS_FOLDER / 'http_functions' / \
'http_v2_functions'
2 changes: 2 additions & 0 deletions tests/unittests/test_http_functions_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import pathlib
import sys
import typing
import unittest
from unittest import skipIf
from unittest.mock import patch

from azure_functions_worker.constants import PYTHON_ENABLE_INIT_INDEXING
from tests.utils import testutils


@unittest.skipIf(sys.version_info <= (3, 7), "Skipping tests if <= Python 3.7")
class TestHttpFunctionsV2FastApi(testutils.WebHostTestCase):
@classmethod
def setUpClass(cls):
Expand Down
2 changes: 2 additions & 0 deletions tests/unittests/test_http_v2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
import sys
import unittest
from unittest.mock import MagicMock

Expand All @@ -13,6 +14,7 @@ class MockHttpResponse:
pass


@unittest.skipIf(sys.version_info <= (3, 7), "Skipping tests if <= Python 3.7")
class TestHttpCoordinator(unittest.TestCase):
def setUp(self):
self.invoc_id = "test_invocation"
Expand Down

0 comments on commit 5d25510

Please sign in to comment.