hynek / structlog

Simple, powerful, and fast logging for Python.
https://www.structlog.org/
Other
3.6k stars 225 forks source link

Test false utc formatting #662

Closed python-mutation-testing closed 1 month ago

python-mutation-testing commented 1 month ago

Summary

This is a test case to test the functionality of MaybeTimeStamper in cases where the UTC argument is false and the formatting is affected by that. This closes #661.

Pull Request Check List

hynek commented 1 month ago

I'm sorry if this is not the case, but this looks like AI slop to me. Especially due to the changelog change, but also it doesn't test what it claims to test at all. Finally, the utc flag is in fact tested for the class that is actually formatting:

https://github.com/hynek/structlog/blob/f3e6fdee0658e9c6ab89aaa8823abe0d78e49b3a/tests/processors/test_renderers.py#L396-L405

python-mutation-testing commented 1 month ago

Hi, Sorry if it looked like a bot to you. I'm a researcher who developed a tool that performs mutation testing for Python projects, considering its dynamic features. My work has not yet been published, so my profile is like this; it should be anonymous for the review process. This pull request can help me prove my point in my paper.

About the test:

src/structlog/processors.py line 578

self.stamper = TimeStamper(fmt=fmt, utc=utc, key=key)

The utc argument is passed with a True default value, and it is never False (from the MaybeTimeStamper class). My mutation testing tool deleted the utc argument:

self.stamper = TimeStamper(fmt=fmt, key=key)

And the tests did not fail. I wrote that test to make up for it. Thanks for your time!