[
https://issues.apache.org/jira/browse/IMPALA-13124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17906288#comment-17906288
]
ASF subversion and git services commented on IMPALA-13124:
----------------------------------------------------------
Commit 5c021901528946af33a51773928af0f9180b083d in impala's branch
refs/heads/master from Joe McDonnell
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=5c0219015 ]
IMPALA-13124: Migrate tests that use 'unittest' package to pytest base class
Some tests were written to use the builtin 'unittest' package.
In testing on Python 3, these tests failed with an error
like "RuntimeError: generator raised StopIteration". Since Impala
tests are standardized on pytests, this converts those locations
to use our regular pytest base classes.
This required restructing the test_redaction.py custom cluster
test to use the pytest setup and teardown methods. It also simplifies
the test cases so that each attempted startup gets its own test
rather than doing multiple startup attempts in a single test.
Testing:
- Ran exhaustive job
Change-Id: I89e854f64e424a75827929a4f6841066024390e9
Reviewed-on: http://gerrit.cloudera.org:8080/21475
Reviewed-by: Michael Smith <[email protected]>
Reviewed-by: Riza Suminto <[email protected]>
Tested-by: Joe McDonnell <[email protected]>
> Migrate tests that use the 'unittest' package to use normal pytest base class
> -----------------------------------------------------------------------------
>
> Key: IMPALA-13124
> URL: https://issues.apache.org/jira/browse/IMPALA-13124
> Project: IMPALA
> Issue Type: Sub-task
> Components: Infrastructure
> Affects Versions: Impala 4.5.0
> Reporter: Joe McDonnell
> Assignee: Joe McDonnell
> Priority: Major
>
> 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:
> {noformat}
> ../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{noformat}
> Converting them to use the regular pytest base classes works fine with python
> 3 (and also python 2).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]