Commits

Ronald Evers committed cfa57ea

substitute substition for substitution

  • Participants
  • Parent commits 8f52039

Comments (0)

Files changed (4)

File doc/announce/release-1.4.txt

 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

File doc/config.txt

 .. be in -*- rst -*- mode!
 
 tox configuration specification
-================================
+===============================
 
 .. _ConfigParser: http://docs.python.org/library/configparser.html
 
 :doc:`examples` first and use this page as a reference.
 
 Tox global settings
-----------------------
+-------------------
 
 List of optional global options::
 
 
 
 envlist setting
-+++++++++++++++++++++++++
++++++++++++++++
 
 Determining the environment list that ``tox`` is to operate on
 happens in this order:
 
 
 Virtualenv test environment settings
--------------------------------------------
+------------------------------------
 
 Test environments are defined by a::
 
 
 
 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
     they may be accessed by other processes or tox runs.
 
 substitutions for virtualenv-related sections
-++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++
 
 ``{envname}``
     the name of the virtual environment
 
 
 environment variable substitutions
-+++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++
 
 If you specify a substitution string like this::
 
 .. _`positional substitution`:
 
 substitutions for positional arguments in commands
-++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++
 
 .. versionadded:: 1.0
 
 Use ``{posargs:DEFAULTS}`` to specify those.
 
 
-Substition for values from other sections
+Substitution for values from other sections
 +++++++++++++++++++++++++++++++++++++++++++
 
 .. versionadded:: 1.4
 
 
 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

File tests/test_config.py

             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")
                 {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']
 
                 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
                 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') == []
                      {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') == []
         """)
         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') == []
         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') == []
         """)
         reader = IniReader(config._cfg)
         posargs = ['hello', 'world']
-        reader.addsubstitions(posargs)
+        reader.addsubstitutions(posargs)
 
         argvlist = reader.getargvlist('section', 'key')
         assert argvlist[0] == ['cmd0'] + posargs
         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 []
         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
             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")
 

File tox/_config.py

              "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):
             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)
             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")
         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)
             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
                     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
         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