public inbox for tools@linux.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Use pre-Python 3.13 Generator type syntax in conftest.py
@ 2026-01-08 16:52 Artur Weber
  2026-01-08 18:20 ` Artur Weber
  2026-01-09 15:54 ` Konstantin Ryabitsev
  0 siblings, 2 replies; 4+ messages in thread
From: Artur Weber @ 2026-01-08 16:52 UTC (permalink / raw)
  To: tools; +Cc: Konstantin Ryabitsev, Artur Weber

Python 3.13 defaults to None for the other fields of the Generator type,
but the version of Generator in older versions does not support such syntax.
Explicitly add the missing fields to allow the tests to run on older Python
versions.

(An alternative solution would be to use typing-extensions for older
versions, though that would require adding another dependency.)

Signed-off-by: Artur Weber <aweber.kernel@gmail.com>
---
 tests/conftest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/conftest.py b/tests/conftest.py
index c5ced78..a9c9157 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -20,7 +20,7 @@ This is a test email body.
 """
 
 @pytest.fixture
-def temp_data_dir() -> Generator[str]:
+def temp_data_dir() -> Generator[str, None, None]:
     """Create a temporary data directory structure for patatt."""
     with tempfile.TemporaryDirectory() as tmpdirname:
         # Create directory structure similar to patatt's data dir
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-09 15:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 16:52 [PATCH] Use pre-Python 3.13 Generator type syntax in conftest.py Artur Weber
2026-01-08 18:20 ` Artur Weber
2026-01-09 15:51   ` Konstantin Ryabitsev
2026-01-09 15:54 ` Konstantin Ryabitsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox