diff options
Diffstat (limited to 'tests/test_python34.py')
-rw-r--r-- | tests/test_python34.py | 30 |
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") |