Skip to content

Commit 55fc46d

Browse files
author
Victoria Hall
committed
pop env vars for fwpc and tptc
1 parent 18b9dc2 commit 55fc46d

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
python -m pytest -q -n auto --dist loadfile --reruns 4 --instafail --cov=./azure_functions_worker --cov-report xml --cov-branch --cov-append tests/extension_tests/deferred_bindings_tests

.github/workflows/ci_e2e_workflow.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
run: |
7979
chmod +x .github/Scripts/fwpc-tests.sh
8080
chmod +x .github/Scripts/e2e-tests.sh
81+
chmod +x .github/Scripts/deferred-bindings-tests.sh
8182
- name: Running 3.7 Tests
8283
if: matrix.python-version == 3.7
8384
env:
@@ -92,6 +93,7 @@ jobs:
9293
run: |
9394
.github/Scripts/fwpc-tests.sh
9495
.github/Scripts/e2e-tests.sh
96+
.github/Scripts/deferred-bindings-tests.sh
9597
- name: Running 3.8 Tests
9698
if: matrix.python-version == 3.8
9799
env:
@@ -106,6 +108,7 @@ jobs:
106108
run: |
107109
.github/Scripts/fwpc-tests.sh
108110
.github/Scripts/e2e-tests.sh
111+
.github/Scripts/deferred-bindings-tests.sh
109112
- name: Running 3.9 Tests
110113
if: matrix.python-version == 3.9
111114
env:
@@ -120,6 +123,7 @@ jobs:
120123
run: |
121124
.github/Scripts/fwpc-tests.sh
122125
.github/Scripts/e2e-tests.sh
126+
.github/Scripts/deferred-bindings-tests.sh
123127
- name: Running 3.10 Tests
124128
if: matrix.python-version == 3.10
125129
env:
@@ -134,6 +138,7 @@ jobs:
134138
run: |
135139
.github/Scripts/fwpc-tests.sh
136140
.github/Scripts/e2e-tests.sh
141+
.github/Scripts/deferred-bindings-tests.sh
137142
- name: Running 3.11 Tests
138143
if: matrix.python-version == 3.11
139144
env:
@@ -148,6 +153,7 @@ jobs:
148153
run: |
149154
.github/Scripts/fwpc-tests.sh
150155
.github/Scripts/e2e-tests.sh
156+
.github/Scripts/deferred-bindings-tests.sh
151157
- name: Codecov
152158
uses: codecov/codecov-action@v3
153159
with:

tests/endtoend/test_threadpool_thread_count_functions.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Licensed under the MIT License.
33
import os
44
from threading import Thread
5-
from unittest.mock import patch
65
from datetime import datetime
76
from tests.utils import testutils
87

@@ -16,18 +15,13 @@ class TestPythonThreadpoolThreadCount(testutils.WebHostTestCase):
1615

1716
@classmethod
1817
def setUpClass(cls):
19-
cls.env_variables['PYTHON_THREADPOOL_THREAD_COUNT'] = '2'
18+
os.environ["PYTHON_THREADPOOL_THREAD_COUNT"] = "2"
2019

21-
os_environ = os.environ.copy()
22-
os_environ.update(cls.env_variables)
23-
24-
cls._patch_environ = patch.dict('os.environ', os_environ)
25-
cls._patch_environ.start()
2620
super().setUpClass()
2721

2822
def tearDown(self):
23+
os.environ.pop('PYTHON_THREADPOOL_THREAD_COUNT')
2924
super().tearDown()
30-
self._patch_environ.stop()
3125

3226
@classmethod
3327
def get_script_dir(cls):

tests/endtoend/test_worker_process_count_functions.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Licensed under the MIT License.
33
import os
44
from threading import Thread
5-
from unittest.mock import patch
65
from datetime import datetime
76
from tests.utils import testutils
87

@@ -15,19 +14,15 @@ class TestWorkerProcessCount(testutils.WebHostTestCase):
1514
"""
1615
@classmethod
1716
def setUpClass(cls):
18-
cls.env_variables['PYTHON_THREADPOOL_THREAD_COUNT'] = '1'
19-
cls.env_variables['FUNCTIONS_WORKER_PROCESS_COUNT'] = '2'
17+
os.environ["PYTHON_THREADPOOL_THREAD_COUNT"] = "1"
18+
os.environ["FUNCTIONS_WORKER_PROCESS_COUNT"] = "2"
2019

21-
os_environ = os.environ.copy()
22-
os_environ.update(cls.env_variables)
23-
24-
cls._patch_environ = patch.dict('os.environ', os_environ)
25-
cls._patch_environ.start()
2620
super().setUpClass()
2721

2822
def tearDown(self):
23+
os.environ.pop('PYTHON_THREADPOOL_THREAD_COUNT')
24+
os.environ.pop('FUNCTIONS_WORKER_PROCESS_COUNT')
2925
super().tearDown()
30-
self._patch_environ.stop()
3126

3227
@classmethod
3328
def get_script_dir(cls):

tests/unittests/test_enable_debug_logging_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# Licensed under the MIT License.
33
import typing
44
import os
5-
from unittest.mock import patch
65

76
from tests.utils import testutils
87
from azure_functions_worker.constants import PYTHON_ENABLE_DEBUG_LOGGING

0 commit comments

Comments
 (0)