Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-8508 Use Python 3 from toolchain for impala-python
  3. IMPALA-13124

Migrate tests that use the 'unittest' package to use normal pytest base class

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Impala 4.5.0
    • None
    • Infrastructure
    • None
    • ghx-label-12

    Description

      Some tests use the 'unittest' package to be the base class of their tests. These can be run by pytest, but when running the tests with python 3, they fail with this message:

      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/runner.py:150: in __init__
          self.result = func()
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/main.py:435: in _memocollect
          return self._memoizedcall('_collected', lambda: list(self.collect()))
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/main.py:315: in _memoizedcall
          res = function()
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/main.py:435: in <lambda>
          return self._memoizedcall('_collected', lambda: list(self.collect()))
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/python.py:605: in collect
          return super(Module, self).collect()
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/python.py:459: in collect
          res = self.makeitem(name, obj)
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/python.py:471: in makeitem
          collector=self, name=name, obj=obj)
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/vendored_packages/pluggy.py:724: in __call__
          return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/vendored_packages/pluggy.py:338: in _hookexec
          return self._inner_hookexec(hook, methods, kwargs)
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/vendored_packages/pluggy.py:333: in <lambda>
          _MultiCall(methods, kwargs, hook.spec_opts).execute()
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/vendored_packages/pluggy.py:595: in execute
          return _wrapped_call(hook_impl.function(*args), self.execute)
      ../infra/python/env-gcc10.4.0-py3/lib/python3.7/site-packages/_pytest/vendored_packages/pluggy.py:249: in _wrapped_call
          wrap_controller.send(call_outcome)
      E   RuntimeError: generator raised StopIteration

      Converting them to use the regular pytest base classes works fine with python 3 (and also python 2).

      Attachments

        Activity

          People

            joemcdonnell Joe McDonnell
            joemcdonnell Joe McDonnell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: