diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d2f2d20e6..ee476e983d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,9 @@ jobs: run: python -c "import sys; print(sys.version)" - name: Install dependencies run: pip install -r requirements-dev.txt + - name: Install Python 3.6 compatible urllib3 + if: ${{ matrix.python-version == 3.6 }} + run: python3 -m pip install urllib3==1.26.16 - name: Installing Avocado in develop mode run: python3 setup.py develop --user - name: Avocado version @@ -94,11 +97,11 @@ jobs: smokecheck-osx: name: OS X with Python ${{ matrix.python-version }} - runs-on: macos-10.15 + runs-on: macos-12 strategy: matrix: - python-version: [3.9, 3.10.0] + python-version: [3.11.1] steps: - run: echo "Job triggered by a ${{ github.event_name }} event on branch is ${{ github.ref }} in repository is ${{ github.repository }}, runner on ${{ runner.os }}" diff --git a/avocado/core/loader.py b/avocado/core/loader.py index a149cc157b..c811b5b456 100644 --- a/avocado/core/loader.py +++ b/avocado/core/loader.py @@ -17,7 +17,7 @@ Test loader module. """ -import imp +import importlib import inspect import os import re @@ -281,11 +281,13 @@ def load_test(test_factory): if isinstance(test_class, str): module_name = os.path.basename(test_path).split('.')[0] test_module_dir = os.path.abspath(os.path.dirname(test_path)) - # Tests with local dir imports need this try: + spec = importlib.util.spec_from_file_location(module_name, test_path) + test_module = importlib.util.module_from_spec(spec) + sys.modules[module_name] = test_module + # Tests with local dir imports need this sys.path.insert(0, test_module_dir) - f, p, d = imp.find_module(module_name, [test_module_dir]) - test_module = imp.load_module(module_name, f, p, d) + spec.loader.exec_module(test_module) except: # pylint: disable=W0702 # On load_module exception we fake the test class and pass # the exc_info as parameter to be logged. diff --git a/optional_plugins/robot/setup.py b/optional_plugins/robot/setup.py index a68978a699..403cb0721a 100644 --- a/optional_plugins/robot/setup.py +++ b/optional_plugins/robot/setup.py @@ -26,7 +26,7 @@ packages=find_packages(), include_package_data=True, install_requires=['avocado-framework==%s' % VERSION, - 'robotframework>=4.1'], + 'robotframework>=4.1,<6.0'], test_suite='tests', entry_points={ 'console_scripts': [