Add Python version check and faulty test to confirm it's working (should fail on 3.6 build only)

This commit is contained in:
Micah Jerome Ellison 2020-07-04 15:09:05 -07:00
parent f86d923843
commit 34207f872f
3 changed files with 19 additions and 0 deletions

View file

@ -371,6 +371,17 @@ def list_journal_directory(context, journal="default"):
for file in f:
print(os.path.join(root, file))
@then("the Python version warning should appear if our version is below {version}")
def check_python_warning_if_version_low_enough(context, version):
import packaging.version
import platform
if packaging.version.parse(platform.python_version()) < packaging.version.parse(version):
out = context.stderr_capture.getvalue()
assert "THIS SHOULD FAIL ON 3.6 REMOVE WHEN CONFIRMING - WARNING: Python versions" in out
else:
assert True
@then("fail")
def debug_fail(context):