summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Orling <timothy.t.orling@linux.intel.com>2016-10-06 10:01:12 -0700
committerTim Orling <timothy.t.orling@linux.intel.com>2016-10-06 10:01:12 -0700
commit5fb8a77f7c8dab97c7afd80066e98ed5af36a2aa (patch)
treefc060e7a7660bb3d3159a70bea2e5840efda4e07
parent86643307651879c8ce9e2a74630d1674a7110f22 (diff)
downloadepel6-testing-container-5fb8a77f7c8dab97c7afd80066e98ed5af36a2aa.tar.gz
epel6-testing-container-5fb8a77f7c8dab97c7afd80066e98ed5af36a2aa.tar.xz
epel6-testing-container-5fb8a77f7c8dab97c7afd80066e98ed5af36a2aa.zip
test_python34.py: cleanup and better python3 test
Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
-rw-r--r--tests/test_python34.py30
1 files changed, 6 insertions, 24 deletions
diff --git a/tests/test_python34.py b/tests/test_python34.py
index 4e4b5cf..49095d3 100644
--- a/tests/test_python34.py
+++ b/tests/test_python34.py
@@ -19,15 +19,6 @@ import shlex
import sys
from subprocess import Popen, PIPE
-def python3_cli():
- try:
- output = Popen("python3").communicate()[0]
- return output
- except:
- pytest.mark.xfail("Error: python3 not installed")
- finally:
- return False
-
def python34_module(modulename):
cmd = shlex.split("python3 -m %s" % modulename)
try:
@@ -39,25 +30,16 @@ def python34_module(modulename):
class TestPython3Installed:
@pytest.fixture
- def python3_cli(self):
- try:
- output = Popen("python3").communicate()[0]
- return output
- except:
- pytest.mark.xfail("Error: python3 not installed")
- finally:
- return False
+ def python3_version(self):
+ cmd = shlex.split("python3 --version")
+ output = Popen(cmd, stdout=PIPE).communicate()[0]
+ return output
- def test_python3_installed(self, python3_cli):
- if not python3_cli:
- pytest.fail("Error: python3 not installed")
- else:
- pass
+ def test_python3_installed(self, python3_version):
+ assert python3_version == 'Python 3.4.3\n'
-@pytest.mark.skipif(TestPython3Installed.python3_cli, reason="no python3 installed")
class TestNewPython34Modules:
- skip_python3 = python3_cli()
def test_python34_asyncio(self):
python34_module("asyncio")