nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: tox-dev/tox
Pull request #472 (2017-03-08 22:22:45)

Made custom config file path parameter more flexible (#460)
Made custom config file path parameter (`-c`) more flexible. It now allows both a path to the `tox.ini` file and a path to the directory where `tox.ini` is located.
Tests added.
I also tried to add some info to docs but couldn't really find a good place for it - any suggestions welcome

Resolves issue #460


Patch:
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index fffdcaca..d13d06eb 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -40,3 +40,4 @@ Andrii Soldatenko
 Igor Duarte Cardoso
 Allan Feldman
 Josh Smeaton
+Paweł Adamczak
diff --git a/tox/config.py b/tox/config.py
index af44b1ad..a02c34ea 100755
--- a/tox/config.py
+++ b/tox/config.py
@@ -219,8 +219,11 @@ def parseconfig(args=None, plugins=()):
 
     # parse ini file
     basename = config.option.configfile
-    if os.path.isabs(basename):
+    if os.path.isfile(basename):
         inipath = py.path.local(basename)
+    elif os.path.isdir(basename):
+        # Assume 'tox.ini' filename if directory was passed
+        inipath = py.path.local(os.path.join(basename, 'tox.ini'))
     else:
         for path in py.path.local().parts(reverse=True):
             inipath = path.join(basename)
@@ -321,7 +324,7 @@ def tox_addoption(parser):
                         dest="listenvs", help="show list of test environments")
     parser.add_argument("-c", action="store", default="tox.ini",
                         dest="configfile",
-                        help="use the specified config file name.")
+                        help="config file name or directory with 'tox.ini' file.")
     parser.add_argument("-e", action="append", dest="env",
                         metavar="envlist",
                         help="work against specified environments (ALL selects all).")


Test patch:
diff --git a/tests/test_config.py b/tests/test_config.py
index f12dbd44..a7563751 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -205,6 +205,21 @@ class TestParseconfig:
             old.chdir()
         assert config.toxinipath == toxinipath
 
+    def test_explicit_config_path(self, tmpdir):
+        """
+        Test explicitly setting config path, both with and without the filename
+        """
+        path = tmpdir.mkdir('tox_tmp_directory')
+        config_file_path = path.ensure('tox.ini')
+
+        config = parseconfig(['-c', str(config_file_path)])
+        assert config.toxinipath == config_file_path
+
+        # Passing directory of the config file should also be possible
+        # ('tox.ini' filename is assumed)
+        config = parseconfig(['-c', str(path)])
+        assert config.toxinipath == config_file_path
+
 
 def test_get_homedir(monkeypatch):
     monkeypatch.setattr(py.path.local, "_gethomedir",
Repository: tox-dev/tox
Pull request #1176 (2019-02-27 08:08:14)

Display pattern and `sys.platform` with platform mismatch

blueyed: changelog?
gaborbernat: Yeah do add it.

Patch:
diff --git a/docs/changelog/1176.feature.rst b/docs/changelog/1176.feature.rst
new file mode 100644
index 00000000..6a835494
--- /dev/null
+++ b/docs/changelog/1176.feature.rst
@@ -0,0 +1,1 @@
+Display pattern and ``sys.platform`` with platform mismatch - by :user:`blueyed`.
diff --git a/docs/changelog/examples.rst b/docs/changelog/examples.rst
index dea7af92..1765fc93 100644
--- a/docs/changelog/examples.rst
+++ b/docs/changelog/examples.rst
@@ -8,11 +8,10 @@ file ``544.feature.rst``::
 
     ``tox --version`` now shows information about all registered plugins - by :user:`obestwalter`
 
-
 file ``571.bugfix.rst``::
 
     ``skip_install`` overrides ``usedevelop`` (``usedevelop`` is an option to choose the
     installation type if the package is installed and ``skip_install`` determines if it should be
     installed at all) - by :user:`ferdonline`
 
-.. see tox/pyproject.toml for all available categories
+.. see pyproject.toml for all available categories  (tool.towncrier.type)
diff --git a/src/tox/session/__init__.py b/src/tox/session/__init__.py
index 53241a0c..531e6f78 100644
--- a/src/tox/session/__init__.py
+++ b/src/tox/session/__init__.py
@@ -222,7 +222,9 @@ class Session(object):
                     exit_code = 1
                     report = reporter.error
             elif status == "platform mismatch":
-                msg = " {}: {}".format(venv.envconfig.envname, str(status))
+                msg = " {}: {} ({!r} does not match {!r})".format(
+                    venv.envconfig.envname, str(status), sys.platform, venv.envconfig.platform
+                )
                 report = reporter.skip
             elif status and status == "ignored failed command":
                 msg = "  {}: {}".format(venv.envconfig.envname, str(status))


Test patch:
diff --git a/tests/unit/test_z_cmdline.py b/tests/unit/test_z_cmdline.py
index e61a2d61..c3227cbb 100644
--- a/tests/unit/test_z_cmdline.py
+++ b/tests/unit/test_z_cmdline.py
@@ -190,7 +190,9 @@ def test_skip_platform_mismatch(cmd, initproj):
     result = cmd()
     assert not result.ret
     assert any(
-        "SKIPPED:  python: platform mismatch" == l for l in result.outlines
+        "SKIPPED:  python: platform mismatch ({!r} does not match 'x123')".format(sys.platform)
+        == l
+        for l in result.outlines
     ), result.outlines