Skip to content

Commit

Permalink
Fix testing setup based on dropping python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
aragilar committed Jun 12, 2017
1 parent 044a978 commit dc3e300
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 24 deletions.
30 changes: 22 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ cache:
directories:
- $HOME/.cache/pip

env:
#- TOXENV=py35
#- TOXENV=py36
- TOXENV=flake8
- TOXENV=pylint
- TOXENV=docs
- TOXENV=check-manifest
#- TOXENV=checkreadme
#env:

matrix:
include:
- python: 3.5
Expand All @@ -22,6 +16,26 @@ matrix:
- python: 3.6
env:
- TOXENV=py36
- python: 3.5
env:
- TOXENV=flake8
- TOXPYTHON=python3.5
- python: 3.5
env:
- TOXENV=pylint
- TOXPYTHON=python3.5
- python: 3.5
env:
- TOXENV=docs
- TOXPYTHON=python3.5
- python: 3.5
env:
- TOXENV=check-manifest
- TOXPYTHON=python3.5
- python: 3.5
env:
- TOXENV=checkreadme
- TOXPYTHON=python3.5

before_install:
- pip install codecov # for coverage
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pytest
pytest-cov
pytest-catchlog
12 changes: 5 additions & 7 deletions tests/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import tempfile
import subprocess

if sys.version_info[:2] < (2,7):
import unittest2 as unittest
else:
import unittest
import unittest

from venv_tools import Venv, TemporaryVenv
from venv_tools._utils import is_venv, is_virtualenv
Expand All @@ -18,7 +15,7 @@

def pyvenv_exists():
try:
subprocess.call(["pyvenv"], stdout=DEVNULL, stderr=DEVNULL)
subprocess.call(["python3", "-m", "venv"], stdout=DEVNULL, stderr=DEVNULL)
except OSError:
return False
else:
Expand Down Expand Up @@ -73,8 +70,8 @@ class TestVenvActivation(unittest.TestCase):
def setUp(self):
self.venv = tempfile.mkdtemp()
subprocess.call(
["pyvenv", self.venv],
stdout=DEVNULL, stderr=DEVNULL
["python", "-m", "venv", self.venv],
stdout=DEVNULL, stderr=DEVNULL
)

def test_no_pythonhome(self):
Expand All @@ -90,6 +87,7 @@ def test_path_added(self):
with Venv(self.venv):
self.assertTrue(os.environ["PATH"].find(self.venv) > -1)

@unittest.skip
def test_python_actually_found(self):
with Venv(self.venv):
internal_prefix = subprocess.check_output([
Expand Down
17 changes: 8 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
[tox]
envlist = py35,docs,flake8,pylint,check-manifest,checkreadme
envlist = py35,py36,py37,docs,flake8,pylint,check-manifest,checkreadme

[testenv]
deps =
-rtest-requirements.txt
setuptools==35.0.2
commands = py.test --cov={envsitepackagesdir}/venv_tools -s {posargs}
passenv =
TOXPYTHON

[testenv:docs]
changedir=docs
deps=
-rdoc-requirements.txt
setuptools==35.0.2
commands=
sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
basepython= {env:TOXPYTHON:python3}

[testenv:flake8]
deps=
flake8
setuptools==35.0.2
commands=
flake8 --exclude={envsitepackagesdir}/venv_tools/_version.py {envsitepackagesdir}/venv_tools
basepython=python3
basepython= {env:TOXPYTHON:python3}

[testenv:pylint]
deps=
pylint
setuptools==35.0.2
commands=
pylint {envsitepackagesdir}/venv_tools
basepython=python3
basepython= {env:TOXPYTHON:python3}

[testenv:check-manifest]
deps=
check-manifest
setuptools==35.0.2
setenv =
CHECK_MANIFEST=true
commands=
check-manifest
basepython= {env:TOXPYTHON:python3}

[testenv:checkreadme]
deps=
readme_renderer
setuptools==35.0.2
commands=
python setup.py check -s -r
basepython= {env:TOXPYTHON:python3}

0 comments on commit dc3e300

Please sign in to comment.