diff options
author | Tim Orling <timothy.t.orling@linux.intel.com> | 2016-10-05 22:31:15 -0700 |
---|---|---|
committer | Tim Orling <timothy.t.orling@linux.intel.com> | 2016-10-05 22:31:15 -0700 |
commit | 7589c42e2e18720d3acae57f9ea05d4fe30b30ac (patch) | |
tree | dc9f65d38b268f7063eba562915726fa030bb9e2 /tests/test_python34.py | |
parent | e46925aadc96e5ddf77519da3445deede8c47bb7 (diff) | |
download | epel6-testing-container-7589c42e2e18720d3acae57f9ea05d4fe30b30ac.tar.gz epel6-testing-container-7589c42e2e18720d3acae57f9ea05d4fe30b30ac.tar.xz epel6-testing-container-7589c42e2e18720d3acae57f9ea05d4fe30b30ac.zip |
add python3 and python34 tests; add build_and_run.sh
Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Diffstat (limited to 'tests/test_python34.py')
-rw-r--r-- | tests/test_python34.py | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/tests/test_python34.py b/tests/test_python34.py index ce92c7b..2fd3179 100644 --- a/tests/test_python34.py +++ b/tests/test_python34.py @@ -16,33 +16,51 @@ import os import pytest import shlex +import sys from subprocess import Popen, PIPE +def python3_cli(): + try: + Popen("python3").communicate()[0] + return True + except OSError: + pytest.fail("OSError: python3 not installed") + return False + def python34_module(modulename): - cmd = shlex.split("python3 -m {}" % modulename) - output = Popen(cmd, stdout=PIPE).communicate()[0] - return output - + cmd = shlex.split("python3 -m %s" % modulename) + try: + Popen(cmd, stdout=PIPE).communicate()[0] + except: + pytest.fail("Error: python module %s not present" % modulename) class TestNewPython34Modules: + skip_python3 = python3_cli() + @pytest.mark.skipIf("TestNewPython34Modules.skip_python3") def test_python34_asyncio(self): python34_module("asyncio") - def test_python34_ensurepip(self, python34_module("ensurepip")): + @pytest.mark.skipIf("TestNewPython34Modules.skip_python3") + def test_python34_ensurepip(self): python34_module("ensurepip") - def test_python34_enum(self, python34_module("enum")): + @pytest.mark.skipIf("TestPython3Installed.skip_python3") + def test_python34_enum(self): python34_module("enum") - def test_python34_pathlib(self, python34_module("pathlib")): + @pytest.mark.skipIf("TestPython3Installed.skip_python3") + def test_python34_pathlib(self): python34_module("pathlib") - def test_python34_selectors(self, python34_module("selectors")): + @pytest.mark.skipIf("TestPython3Installed.skip_python3") + def test_python34_selectors(self): python34_module("selectors") - def test_python34_statistics(self, python34_module("statistics")): + @pytest.mark.skipIf("TestPython3Installed.skip_python3") + def test_python34_statistics(self): python34_module("statistics") - def test_python34_tracemalloc(self, python34_module("tracemalloc")): + @pytest.mark.skipIf("TestPython3Installed.skip_python3") + def test_python34_tracemalloc(self): python34_module("tracemalloc") |