From 926a75db6ef043f532a90dfef06b5ebb2a64c320 Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Thu, 23 Oct 2025 18:21:16 -0400 Subject: [PATCH 1/5] fix unintentional and unconditional skips --- testing/_py/test_local.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index e7301c273e0..12c023689b9 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -207,10 +207,7 @@ def test_visit_norecurse(self, path1): assert "sampledir" in lst assert path1.sep.join(["sampledir", "otherfile"]) not in lst - @pytest.mark.parametrize( - "fil", - ["*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")], - ) + @pytest.mark.parametrize("fil", ["*dir"]) def test_visit_filterfunc_is_string(self, path1, fil): lst = [] for i in path1.visit(fil): @@ -463,12 +460,11 @@ def test_fspath_func_match_strpath(self, path1): assert fspath(path1) == path1.strpath - @pytest.mark.skip("sys.version_info < (3,6)") def test_fspath_open(self, path1): - f = path1.join("opentestfile") - open(f) + f = path1.join("samplefile") + stream = open(f) + stream.close() - @pytest.mark.skip("sys.version_info < (3,6)") def test_fspath_fsencode(self, path1): from os import fsencode From 9ff981ae999f0209d1b11c2e9ce1f5890546a98c Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Thu, 23 Oct 2025 18:27:38 -0400 Subject: [PATCH 2/5] add encoding --- testing/_py/test_local.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index 12c023689b9..8114827a6c5 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -462,7 +462,7 @@ def test_fspath_func_match_strpath(self, path1): def test_fspath_open(self, path1): f = path1.join("samplefile") - stream = open(f) + stream = open(f, encoding="utf-8") stream.close() def test_fspath_fsencode(self, path1): From cd121543349f14b6181d23da8e11a83a87811c97 Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Thu, 23 Oct 2025 18:34:43 -0400 Subject: [PATCH 3/5] remove trivial from CONTRIBUTING.rst --- CONTRIBUTING.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e98dd06fb5a..dce17b3aeb1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -203,7 +203,7 @@ Short version #. Write a ``changelog`` entry: ``changelog/2574.bugfix.rst``, use issue id number and one of ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, - ``breaking``, ``vendor`` or ``trivial`` for the issue type. + ``breaking``, or ``vendor`` for the issue type. #. Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please @@ -305,8 +305,8 @@ Here is a simple overview, with pytest-specific bits: #. Create a new changelog entry in ``changelog``. The file should be named ``..rst``, where *issueid* is the number of the issue related to the change and *type* is one of - ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, ``vendor`` - or ``trivial``. You may skip creating the changelog entry if the change doesn't affect the + ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, or ``vendor``. + You may skip creating the changelog entry if the change doesn't affect the documented behaviour of pytest. #. Add yourself to ``AUTHORS`` file if not there yet, in alphabetical order. From a6b31c8160ed8a923160b0bd0abd40c8407b0b8c Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Thu, 23 Oct 2025 18:34:48 -0400 Subject: [PATCH 4/5] add changelog --- changelog/13842.contrib.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/13842.contrib.rst diff --git a/changelog/13842.contrib.rst b/changelog/13842.contrib.rst new file mode 100644 index 00000000000..70fc9f0962b --- /dev/null +++ b/changelog/13842.contrib.rst @@ -0,0 +1 @@ +Improve a few ``py`` tests. From 0e20c5c80463264055dfa82062537b2ef82fc7c9 Mon Sep 17 00:00:00 2001 From: Liam DeVoe Date: Fri, 24 Oct 2025 10:50:23 -0400 Subject: [PATCH 5/5] address review --- CONTRIBUTING.rst | 5 +++-- changelog/13842.contrib.rst | 1 - testing/_py/test_local.py | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 changelog/13842.contrib.rst diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index dce17b3aeb1..f31c14aec49 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -203,7 +203,7 @@ Short version #. Write a ``changelog`` entry: ``changelog/2574.bugfix.rst``, use issue id number and one of ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, - ``breaking``, or ``vendor`` for the issue type. + ``breaking``, ``vendor``, ``packaging``, ``contrib``, or ``misc`` for the issue type. #. Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please @@ -305,7 +305,8 @@ Here is a simple overview, with pytest-specific bits: #. Create a new changelog entry in ``changelog``. The file should be named ``..rst``, where *issueid* is the number of the issue related to the change and *type* is one of - ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, or ``vendor``. + ``feature``, ``improvement``, ``bugfix``, ``doc``, ``deprecation``, ``breaking``, ``vendor``, + ``packaging``, ``contrib``, or ``misc``. You may skip creating the changelog entry if the change doesn't affect the documented behaviour of pytest. diff --git a/changelog/13842.contrib.rst b/changelog/13842.contrib.rst deleted file mode 100644 index 70fc9f0962b..00000000000 --- a/changelog/13842.contrib.rst +++ /dev/null @@ -1 +0,0 @@ -Improve a few ``py`` tests. diff --git a/testing/_py/test_local.py b/testing/_py/test_local.py index 8114827a6c5..592058a54a5 100644 --- a/testing/_py/test_local.py +++ b/testing/_py/test_local.py @@ -207,10 +207,9 @@ def test_visit_norecurse(self, path1): assert "sampledir" in lst assert path1.sep.join(["sampledir", "otherfile"]) not in lst - @pytest.mark.parametrize("fil", ["*dir"]) - def test_visit_filterfunc_is_string(self, path1, fil): + def test_visit_filterfunc_is_string(self, path1): lst = [] - for i in path1.visit(fil): + for i in path1.visit("*dir"): lst.append(i.relto(path1)) assert len(lst), 2 # noqa: PLC1802,RUF040 assert "sampledir" in lst