3 new commits in tox: https://bitbucket.org/hpk42/tox/commits/b45da7c8d626/ Changeset: b45da7c8d626 User: olliewalsh Date: 2015-07-03 15:53:51+00:00 Summary: Reorder the processing of testenv options. Fixes issue #246 Affected #: 2 files
diff -r 87a9def32696f7ada3b536621f723018ce9667ad -r b45da7c8d626f2df98ac882529d222f5aefa2f1c tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -926,6 +926,18 @@ assert argv[7][0] == config.homedir.join(".tox", "distshare") assert argv[8][0] == conf.envlogdir + def test_substitution_notfound_issue246(tmpdir, newconfig): + config = newconfig(""" + [testenv:py27] + setenv = + FOO={envbindir} + BAR={envsitepackagesdir} + """) + conf = config.envconfigs['py27'] + env = conf.setenv + assert 'FOO' in env + assert 'BAR' in env + def test_substitution_positional(self, newconfig): inisource = """ [testenv:py27] diff -r 87a9def32696f7ada3b536621f723018ce9667ad -r b45da7c8d626f2df98ac882529d222f5aefa2f1c tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -320,6 +320,18 @@ help="additional arguments available to command positional substitution") # add various core venv interpreter attributes + def basepython_default(testenv_config, value): + if value is None: + for f in testenv_config.factors: + if f in default_factors: + return default_factors[f] + return sys.executable + return str(value) + + parser.add_testenv_attribute( + name="basepython", type="string", default=None, postprocess=basepython_default, + help="executable name or path of interpreter used to create a " + "virtual test environment.") parser.add_testenv_attribute( name="envdir", type="path", default="{toxworkdir}/{envname}", @@ -453,19 +465,6 @@ name="usedevelop", type="bool", postprocess=develop, default=False, help="install package in develop/editable mode") - def basepython_default(testenv_config, value): - if value is None: - for f in testenv_config.factors: - if f in default_factors: - return default_factors[f] - return sys.executable - return str(value) - - parser.add_testenv_attribute( - name="basepython", type="string", default=None, postprocess=basepython_default, - help="executable name or path of interpreter used to create a " - "virtual test environment.") - parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute_obj(DepOption()) @@ -709,7 +708,7 @@ if atype == "path": reader.addsubstitutions(**{env_attr.name: res}) - if env_attr.name == "install_command": + if env_attr.name == "envdir": reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython, envsitepackagesdir=vc.envsitepackagesdir) return vc https://bitbucket.org/hpk42/tox/commits/1619d99ed2a7/ Changeset: 1619d99ed2a7 User: olliewalsh Date: 2015-07-03 16:02:27+00:00 Summary: Cleanup flakes Affected #: 1 file diff -r b45da7c8d626f2df98ac882529d222f5aefa2f1c -r 1619d99ed2a7c9b287150dce11ef788571b0a733 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -926,11 +926,11 @@ assert argv[7][0] == config.homedir.join(".tox", "distshare") assert argv[8][0] == conf.envlogdir - def test_substitution_notfound_issue246(tmpdir, newconfig): + def test_substitution_notfound_issue246(tmpdir, newconfig): config = newconfig(""" [testenv:py27] - setenv = - FOO={envbindir} + setenv = + FOO={envbindir} BAR={envsitepackagesdir} """) conf = config.envconfigs['py27'] https://bitbucket.org/hpk42/tox/commits/2d13f9d381b1/ Changeset: 2d13f9d381b1 User: hpk42 Date: 2015-10-29 16:24:21+00:00 Summary: Merged in olliewalsh/tox (pull request #167) Reorder the processing of testenv options. Affected #: 2 files diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tests/test_config.py --- a/tests/test_config.py +++ b/tests/test_config.py @@ -927,6 +927,18 @@ assert argv[7][0] == config.homedir.join(".tox", "distshare") assert argv[8][0] == conf.envlogdir + def test_substitution_notfound_issue246(tmpdir, newconfig): + config = newconfig(""" + [testenv:py27] + setenv = + FOO={envbindir} + BAR={envsitepackagesdir} + """) + conf = config.envconfigs['py27'] + env = conf.setenv + assert 'FOO' in env + assert 'BAR' in env + def test_substitution_positional(self, newconfig): inisource = """ [testenv:py27] diff -r ea4b7f06272b7cd8b0861532a566fe9872517e8f -r 2d13f9d381b1f9b13f1bb9b76d5b37b29e69b2e5 tox/config.py --- a/tox/config.py +++ b/tox/config.py @@ -320,6 +320,18 @@ help="additional arguments available to command positional substitution") # add various core venv interpreter attributes + def basepython_default(testenv_config, value): + if value is None: + for f in testenv_config.factors: + if f in default_factors: + return default_factors[f] + return sys.executable + return str(value) + + parser.add_testenv_attribute( + name="basepython", type="string", default=None, postprocess=basepython_default, + help="executable name or path of interpreter used to create a " + "virtual test environment.") parser.add_testenv_attribute( name="envdir", type="path", default="{toxworkdir}/{envname}", @@ -453,19 +465,6 @@ name="usedevelop", type="bool", postprocess=develop, default=False, help="install package in develop/editable mode") - def basepython_default(testenv_config, value): - if value is None: - for f in testenv_config.factors: - if f in default_factors: - return default_factors[f] - return sys.executable - return str(value) - - parser.add_testenv_attribute( - name="basepython", type="string", default=None, postprocess=basepython_default, - help="executable name or path of interpreter used to create a " - "virtual test environment.") - parser.add_testenv_attribute_obj(InstallcmdOption()) parser.add_testenv_attribute_obj(DepOption()) @@ -709,7 +708,7 @@ if atype == "path": reader.addsubstitutions(**{env_attr.name: res}) - if env_attr.name == "install_command": + if env_attr.name == "envdir": reader.addsubstitutions(envbindir=vc.envbindir, envpython=vc.envpython, envsitepackagesdir=vc.envsitepackagesdir) return vc Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit