Use pre-Python 3.13 Generator type syntax in conftest.py
PATCH 1/1 Use pre-Python 3.13 Generator type syntax in conftest.py
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.)
--- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/conftest.py +1 -1
@@ -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
Signature · 1 line
2.52.0
Quoted 9 lines · 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 <[email protected]>
It just occurred to me that I didn't mention what this patch is for anywhere in this mail.
This is a patch for patatt :)
Best regards
Artur
Quoted 6 lines · Artur Weber
Quoted 1 line
Signed-off-by Artur Weber <[email protected]>It just occurred to me that I didn't mention what this patch is for anywhere in this mail.
This is a patch for patatt :)
Thank you for the clarification! I would have eventually figured it out, but it does help. :)
(FTR, if you use b4 to send patatt patches, it does stick patatt into the prefix line.)
-K
Konstantin Ryabitsev
AppliedQuoted 9 lines · 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.)
[...]
Applied, thanks!
[1/1] Use pre-Python 3.13 Generator type syntax in conftest.py
commit: 3b9f6ecec8e17225b66483ffd0aecb8ba1c328f5
Best regards,
Signature · 1 line
Konstantin Ryabitsev <[email protected]>