fix static analysis test skips with latest pytest

Latest pytest ensures pytest.skip is being called with a str parameter.
However, test_static_analysis passed over the skip parameter which
contains a tuple returned from skip_python_version leading to test
regression.
Unify the version skip reasons for both, static analysis and integration
tests by using a shared BaseTestCase parent to avoid code duplication.
Furthermore handle test_static_analysis skip_reason extraction
orthogonal to test_completion.
This commit is contained in:
Levente Polyak
2019-09-20 18:34:39 +02:00
committed by Dave Halter
parent a0f95fc89f
commit 527ef6fcdd
3 changed files with 61 additions and 53 deletions

View File

@@ -45,8 +45,9 @@ def test_completion(case, monkeypatch, environment, has_typing):
def test_static_analysis(static_analysis_case, environment):
if static_analysis_case.skip is not None:
pytest.skip(static_analysis_case.skip)
skip_reason = static_analysis_case.get_skip_reason(environment)
if skip_reason is not None:
pytest.skip(skip_reason)
else:
static_analysis_case.run(assert_static_analysis, environment)