Commits

holger krekel committed fa1bd91

introduce --sitepackages to force sitepackages=True in all
environments. Was wanted by Debian maintainer Barry Warsaw.

Comments (0)

Files changed (3)

 - introduce --no-network to tox's own test suite to skip tests
   requiring networks
 
+- introduce --sitepackages to force sitepackages=True in all
+  environments.   
+
 1.6.1
 -----
 

tests/test_config.py

         # hashseed is random by default, so we can't assert a specific value.
         assert int_hashseed > 0
 
+    def test_sitepackages_switch(self, tmpdir, newconfig):
+        config = newconfig(["--sitepackages"], "")
+        envconfig = config.envconfigs['python']
+        assert envconfig.sitepackages == True
+
     def test_installpkg_tops_develop(self, newconfig):
         config = newconfig(["--installpkg=abc"], """
             [testenv]
         metavar="REQ", default=None,
         help="Forces a certain version of one of the dependencies "
              "when configuring the virtual environment. REQ Examples "
-             "'pytest<2.4' or 'django>=1.6'.")
+             "'pytest<2.7' or 'django>=1.6'.")
+    parser.add_argument("--sitepackages", action="store_true",
+        help="override sitepackages setting to True in all envs")
+
     parser.add_argument("args", nargs="*",
         help="additional arguments available to command positional substitution")
     return parser
             name = self._replace_forced_dep(name, config)
             vc.deps.append(DepConfig(name, ixserver))
         vc.distribute = reader.getbool(section, "distribute", False)
-        vc.sitepackages = reader.getbool(section, "sitepackages", False)
+        vc.sitepackages = self.config.option.sitepackages or \
+                          reader.getbool(section, "sitepackages", False)
+
         vc.downloadcache = None
         downloadcache = reader.getdefault(section, "downloadcache")
         if downloadcache: