diff --git a/.github/workflows/ci_consumption_workflow.yml b/.github/workflows/ci_consumption_workflow.yml index 907e3de4c..3def8c097 100644 --- a/.github/workflows/ci_consumption_workflow.yml +++ b/.github/workflows/ci_consumption_workflow.yml @@ -32,21 +32,22 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple -U azure-functions --pre - python -m pip install -U -e .[dev] + python -m pip install --upgrade pip==23.0 + python -m pip install -r requirements.txt + python -m pip install pytest pytest-instafail pytest-rerunfailures pytest-xdist requests pycryptodome python setup.py build - name: Running 3.7 Tests if: matrix.python-version == 3.7 env: AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString37 }} CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }} - run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests + run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests - name: Running 3.8 Tests if: matrix.python-version == 3.8 env: AzureWebJobsStorage: ${{ secrets.LinuxStorageConnectionString38 }} CUSTOM_IMAGE: ${{ github.event.inputs.custom_image }} - run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests + run: python -m pytest -n auto --dist loadfile -vv --reruns 4 --instafail tests/consumption_tests - name: Running 3.9 Tests if: matrix.python-version == 3.9 env: diff --git a/.github/workflows/ci_docker_con_workflow.yml b/.github/workflows/ci_docker_con_workflow.yml index 8ec29b3ae..460d663d3 100644 --- a/.github/workflows/ci_docker_con_workflow.yml +++ b/.github/workflows/ci_docker_con_workflow.yml @@ -29,6 +29,9 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | + python -m pip install --upgrade pip==23.0 + python -m pip install -r requirements.txt + python -m pip install pytest pytest-instafail pytest-rerunfailures pytest-xdist requests python setup.py build - name: Running 3.7 Tests if: matrix.python-version == 3.7 diff --git a/.github/workflows/ci_docker_custom_workflow.yml b/.github/workflows/ci_docker_custom_workflow.yml index 79b92b17c..f8c1be01c 100644 --- a/.github/workflows/ci_docker_custom_workflow.yml +++ b/.github/workflows/ci_docker_custom_workflow.yml @@ -49,6 +49,9 @@ jobs: python-version: ${{ env.python_version }} - name: Install dependencies run: | + python -m pip install --upgrade pip==23.0 + python -m pip install -r requirements.txt + python -m pip install pytest pytest-instafail pytest-rerunfailures pytest-xdist requests python setup.py build - name: Running 3.7 Tests if: env.python_version == 3.7 diff --git a/.github/workflows/ci_docker_ded_workflow.yml b/.github/workflows/ci_docker_ded_workflow.yml index 1e117bf6a..9291e64bf 100644 --- a/.github/workflows/ci_docker_ded_workflow.yml +++ b/.github/workflows/ci_docker_ded_workflow.yml @@ -29,6 +29,9 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | + python -m pip install --upgrade pip==23.0 + python -m pip install -r requirements.txt + python -m pip install pytest pytest-instafail pytest-rerunfailures pytest-xdist requests python setup.py build - name: Running 3.7 Tests if: matrix.python-version == 3.7 diff --git a/tests/endtoend/test_worker_process_count_functions.py b/tests/endtoend/test_worker_process_count_functions.py index 519d8982e..689da3109 100644 --- a/tests/endtoend/test_worker_process_count_functions.py +++ b/tests/endtoend/test_worker_process_count_functions.py @@ -18,16 +18,15 @@ def setUpClass(cls): cls.env_variables['PYTHON_THREADPOOL_THREAD_COUNT'] = '1' cls.env_variables['FUNCTIONS_WORKER_PROCESS_COUNT'] = '2' - os_environ = os.environ.copy() - os_environ.update(cls.env_variables) - - cls._patch_environ = patch.dict('os.environ', os_environ) - cls._patch_environ.start() + os.environ.update(cls.env_variables) super().setUpClass() - def tearDown(self): - super().tearDown() - self._patch_environ.stop() + @classmethod + def tearDownClass(cls): + # Remove the PYTHON_SCRIPT_FILE_NAME environment variable + os.environ.pop('PYTHON_THREADPOOL_THREAD_COUNT') + os.environ.pop('FUNCTIONS_WORKER_PROCESS_COUNT') + super().tearDownClass() @classmethod def get_script_dir(cls):