[Pytest-commit] commit/tox: evers: substitute substition for substitution

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Oct 9 22:32:01 CEST 2013


1 new commit in tox:

https://bitbucket.org/hpk42/tox/commits/cfa57eaab6db/
Changeset:   cfa57eaab6db
User:        evers
Date:        2013-10-09 21:37:33
Summary:     substitute substition for substitution
Affected #:  4 files

diff -r 8f520393086916e5939f13c25b9474f7548249d0 -r cfa57eaab6db525c3035d473ab308b729b73e24c doc/announce/release-1.4.txt
--- a/doc/announce/release-1.4.txt
+++ b/doc/announce/release-1.4.txt
@@ -4,7 +4,7 @@
 I am happy to announce tox 1.4 which brings:
 
 - improvements with configuration file syntax, now allowing re-using
-  selected settings across config file sections. see http://testrun.org/tox/latest/config.html#substition-for-values-from-other-sections
+  selected settings across config file sections. see http://testrun.org/tox/latest/config.html#substitution-for-values-from-other-sections
 
 - terminal reporting was simplified and streamlined.  Now with
   verbosity==0 (the default), less information will be shown

diff -r 8f520393086916e5939f13c25b9474f7548249d0 -r cfa57eaab6db525c3035d473ab308b729b73e24c doc/config.txt
--- a/doc/config.txt
+++ b/doc/config.txt
@@ -1,7 +1,7 @@
 .. be in -*- rst -*- mode!
 
 tox configuration specification
-================================
+===============================
 
 .. _ConfigParser: http://docs.python.org/library/configparser.html
 
@@ -10,7 +10,7 @@
 :doc:`examples` first and use this page as a reference.
 
 Tox global settings
-----------------------
+-------------------
 
 List of optional global options::
 
@@ -34,7 +34,7 @@
 
 
 envlist setting
-+++++++++++++++++++++++++
++++++++++++++++
 
 Determining the environment list that ``tox`` is to operate on
 happens in this order:
@@ -45,7 +45,7 @@
 
 
 Virtualenv test environment settings
--------------------------------------------
+------------------------------------
 
 Test environments are defined by a::
 
@@ -236,13 +236,13 @@
 
 
 Substitutions
----------------------
+-------------
 
 Any ``key=value`` setting in an ini-file can make use
 of value substitution through the ``{...}`` string-substitution pattern.
 
 Globally available substitutions
-+++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++
 
 ``{toxinidir}``
     the directory where tox.ini is located
@@ -262,7 +262,7 @@
     they may be accessed by other processes or tox runs.
 
 substitutions for virtualenv-related sections
-++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++
 
 ``{envname}``
     the name of the virtual environment
@@ -282,7 +282,7 @@
 
 
 environment variable substitutions
-+++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++
 
 If you specify a substitution string like this::
 
@@ -296,7 +296,7 @@
 .. _`positional substitution`:
 
 substitutions for positional arguments in commands
-++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++
 
 .. versionadded:: 1.0
 
@@ -330,7 +330,7 @@
 Use ``{posargs:DEFAULTS}`` to specify those.
 
 
-Substition for values from other sections
+Substitution for values from other sections
 +++++++++++++++++++++++++++++++++++++++++++
 
 .. versionadded:: 1.4
@@ -361,7 +361,7 @@
 
 
 Other Rules and notes
-=========================
+=====================
 
 * ``path`` specifications: if a specified ``path`` is a relative path
   it will be considered as relative to the ``toxinidir``, the directory

diff -r 8f520393086916e5939f13c25b9474f7548249d0 -r cfa57eaab6db525c3035d473ab308b729b73e24c tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -156,7 +156,7 @@
             key={value}
         """)
         reader = IniReader(config._cfg, fallbacksections=['mydefault'])
-        reader.addsubstitions(value="newvalue", value2="newvalue2")
+        reader.addsubstitutions(value="newvalue", value2="newvalue2")
         x = reader.getdefault("section", "key2")
         assert x == "newvalue2"
         x = reader.getdefault("section", "key3")
@@ -172,7 +172,7 @@
                 {item2}
         """)
         reader = IniReader(config._cfg)
-        reader.addsubstitions(item1="not", item2="grr")
+        reader.addsubstitutions(item1="not", item2="grr")
         x = reader.getlist("section", "key2")
         assert x == ['item1', 'grr']
 
@@ -184,7 +184,7 @@
                 key2={item2}
         """)
         reader = IniReader(config._cfg)
-        reader.addsubstitions(item1="not", item2="grr")
+        reader.addsubstitutions(item1="not", item2="grr")
         x = reader.getdict("section", "key2")
         assert 'key1' in x
         assert 'key2' in x
@@ -235,7 +235,7 @@
                 cmd2 {item2}
         """)
         reader = IniReader(config._cfg)
-        reader.addsubstitions(item1="with space", item2="grr")
+        reader.addsubstitutions(item1="with space", item2="grr")
         #py.test.raises(tox.exception.ConfigError,
         #    "reader.getargvlist('section', 'key1')")
         assert reader.getargvlist('section', 'key1') == []
@@ -251,7 +251,7 @@
                      {item2}
         """)
         reader = IniReader(config._cfg)
-        reader.addsubstitions(item1="with space", item2="grr")
+        reader.addsubstitutions(item1="with space", item2="grr")
         #py.test.raises(tox.exception.ConfigError,
         #    "reader.getargvlist('section', 'key1')")
         assert reader.getargvlist('section', 'key1') == []
@@ -281,7 +281,7 @@
         """)
         reader = IniReader(config._cfg)
         posargs = ['hello', 'world']
-        reader.addsubstitions(posargs, item2="value2")
+        reader.addsubstitutions(posargs, item2="value2")
         #py.test.raises(tox.exception.ConfigError,
         #    "reader.getargvlist('section', 'key1')")
         assert reader.getargvlist('section', 'key1') == []
@@ -290,7 +290,7 @@
         assert argvlist[1] == ["cmd2"] + posargs
 
         reader = IniReader(config._cfg)
-        reader.addsubstitions([], item2="value2")
+        reader.addsubstitutions([], item2="value2")
         #py.test.raises(tox.exception.ConfigError,
         #    "reader.getargvlist('section', 'key1')")
         assert reader.getargvlist('section', 'key1') == []
@@ -309,7 +309,7 @@
         """)
         reader = IniReader(config._cfg)
         posargs = ['hello', 'world']
-        reader.addsubstitions(posargs)
+        reader.addsubstitutions(posargs)
 
         argvlist = reader.getargvlist('section', 'key')
         assert argvlist[0] == ['cmd0'] + posargs
@@ -317,7 +317,7 @@
         assert argvlist[2] == ['cmd2', '-m', "something"] + posargs
         assert argvlist[3] == ['cmd3', 'something[]else']
 
-    def test_substition_with_multiple_words(self, newconfig):
+    def test_substitution_with_multiple_words(self, newconfig):
         inisource = """
             [section]
             key = py.test -n5 --junitxml={envlogdir}/junit-{envname}.xml []
@@ -325,7 +325,7 @@
         config = newconfig(inisource)
         reader = IniReader(config._cfg)
         posargs = ['hello', 'world']
-        reader.addsubstitions(posargs, envlogdir='ENV_LOG_DIR', envname='ENV_NAME')
+        reader.addsubstitutions(posargs, envlogdir='ENV_LOG_DIR', envname='ENV_NAME')
 
         expected = ['py.test', '-n5', '--junitxml=ENV_LOG_DIR/junit-ENV_NAME.xml', 'hello', 'world']
         assert reader.getargvlist('section', 'key')[0] == expected
@@ -347,7 +347,7 @@
             path1={HELLO}
         """)
         reader = IniReader(config._cfg)
-        reader.addsubstitions(toxinidir=tmpdir, HELLO="mypath")
+        reader.addsubstitutions(toxinidir=tmpdir, HELLO="mypath")
         x = reader.getpath("section", "path1", tmpdir)
         assert x == tmpdir.join("mypath")
 

diff -r 8f520393086916e5939f13c25b9474f7548249d0 -r cfa57eaab6db525c3035d473ab308b729b73e24c tox/_config.py
--- a/tox/_config.py
+++ b/tox/_config.py
@@ -117,7 +117,7 @@
              "pass-through output from running test commands which is "
              "instead captured into the json result file.")
     parser.add_argument("args", nargs="*",
-        help="additional arguments available to command positional substition")
+        help="additional arguments available to command positional substitution")
     return parser
 
 class Config(object):
@@ -200,8 +200,8 @@
             raise ValueError("invalid context")
 
 
-        reader.addsubstitions(toxinidir=config.toxinidir,
-                              homedir=config.homedir)
+        reader.addsubstitutions(toxinidir=config.toxinidir,
+                                homedir=config.homedir)
         config.toxworkdir = reader.getpath(toxsection, "toxworkdir",
                                            "{toxinidir}/.tox")
         config.minversion = reader.getdefault(toxsection, "minversion", None)
@@ -233,13 +233,13 @@
             for name in config.indexserver:
                 config.indexserver[name] = IndexServerConfig(name, override)
 
-        reader.addsubstitions(toxworkdir=config.toxworkdir)
+        reader.addsubstitutions(toxworkdir=config.toxworkdir)
         config.distdir = reader.getpath(toxsection, "distdir",
                                            "{toxworkdir}/dist")
-        reader.addsubstitions(distdir=config.distdir)
+        reader.addsubstitutions(distdir=config.distdir)
         config.distshare = reader.getpath(toxsection, "distshare",
                                           distshare_default)
-        reader.addsubstitions(distshare=config.distshare)
+        reader.addsubstitutions(distshare=config.distshare)
         config.sdistsrc = reader.getpath(toxsection, "sdistsrc", None)
         config.setupdir = reader.getpath(toxsection, "setupdir", "{toxinidir}")
         config.logdir = config.toxworkdir.join("log")
@@ -270,7 +270,7 @@
         vc = VenvConfig(envname=name)
         vc.config = config
         reader = IniReader(self._cfg, fallbacksections=["testenv"])
-        reader.addsubstitions(**subs)
+        reader.addsubstitutions(**subs)
         vc.develop = reader.getbool(section, "usedevelop", config.option.develop)
         vc.envdir = reader.getpath(section, "envdir", "{toxworkdir}/%s" % name)
         vc.args_are_paths = reader.getbool(section, "args_are_paths", True)
@@ -283,12 +283,12 @@
             bp = sys.executable
         vc.basepython = reader.getdefault(section, "basepython", bp)
         vc._basepython_info = config.interpreters.get_info(vc.basepython)
-        reader.addsubstitions(envdir=vc.envdir, envname=vc.envname,
-                              envbindir=vc.envbindir, envpython=vc.envpython,
-                              envsitepackagesdir=vc.envsitepackagesdir)
+        reader.addsubstitutions(envdir=vc.envdir, envname=vc.envname,
+                                envbindir=vc.envbindir, envpython=vc.envpython,
+                                envsitepackagesdir=vc.envsitepackagesdir)
         vc.envtmpdir = reader.getpath(section, "tmpdir", "{envdir}/tmp")
         vc.envlogdir = reader.getpath(section, "envlogdir", "{envdir}/log")
-        reader.addsubstitions(envlogdir=vc.envlogdir, envtmpdir=vc.envtmpdir)
+        reader.addsubstitutions(envlogdir=vc.envlogdir, envtmpdir=vc.envtmpdir)
         vc.changedir = reader.getpath(section, "changedir", "{toxinidir}")
         if config.option.recreate:
             vc.recreate = True
@@ -303,7 +303,7 @@
                     if origpath.check():
                         arg = vc.changedir.bestrelpath(origpath)
                     args.append(arg)
-            reader.addsubstitions(args)
+            reader.addsubstitutions(args)
         vc.setenv = reader.getdict(section, 'setenv')
         if not vc.setenv:
             vc.setenv = None
@@ -410,7 +410,7 @@
         self._subs = {}
         self._subststack = []
 
-    def addsubstitions(self, _posargs=None, **kw):
+    def addsubstitutions(self, _posargs=None, **kw):
         self._subs.update(kw)
         if _posargs:
             self._subs['_posargs'] = _posargs

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.


More information about the pytest-commit mailing list