Skip to content

Commit

Permalink
Merge pull request #392 from tox-dev/fix348
Browse files Browse the repository at this point in the history
fix #348 - add py2 and py3 as default envs
  • Loading branch information
hpk42 authored Oct 27, 2016
2 parents 172cabb + 10ba4d3 commit 8069f0e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ unreleased
- add support for py36 and py37 and add py36-dev and py37(nightly) to
travis builds. Thanks John Vandenberg.

- fix #348: add py2 and py3 as default environments pointing to
"python2" and "python3" basepython executables. Also fix #347 by
updating the list of default envs in the tox basic example.
Thanks Tobias McNulty.


2.4.1
Expand Down
10 changes: 5 additions & 5 deletions doc/example/basic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ you can run restrict the test run to the python2.6 environment.
Available "default" test environments names are::

py
py24
py25
py2
py26
py27
py30
py31
py32
py3
py33
py34
py35
py36
py37
jython
pypy
pypy3
Expand Down
4 changes: 3 additions & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ def test_py_venv(self, tmpdir, newconfig, monkeypatch):
assert str(env.basepython) == sys.executable

def test_default_environments(self, tmpdir, newconfig, monkeypatch):
envs = "py26,py27,py32,py33,py34,py35,py36,py37,jython,pypy,pypy3"
envs = "py26,py27,py32,py33,py34,py35,py36,py37,jython,pypy,pypy3,py2,py3"
inisource = """
[tox]
envlist = %s
Expand All @@ -1494,6 +1494,8 @@ def test_default_environments(self, tmpdir, newconfig, monkeypatch):
assert env.basepython == "jython"
elif name.startswith("pypy"):
assert env.basepython == name
elif name in ("py2", "py3"):
assert env.basepython == 'python' + name[-1]
else:
assert name.startswith("py")
bp = "python%s.%s" % (name[2], name[3])
Expand Down
2 changes: 1 addition & 1 deletion tox/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
iswin32 = sys.platform == "win32"

default_factors = {'jython': 'jython', 'pypy': 'pypy', 'pypy3': 'pypy3',
'py': sys.executable}
'py': sys.executable, 'py2': 'python2', 'py3': 'python3'}
for version in '26,27,32,33,34,35,36,37'.split(','):
default_factors['py' + version] = 'python%s.%s' % tuple(version)

Expand Down

0 comments on commit 8069f0e

Please sign in to comment.