pytest icon indicating copy to clipboard operation
pytest copied to clipboard

Config.getini default none value #11282

Open TanyaAgarwal28 opened this issue 2 years ago • 1 comments

PR Description: This PR addresses the issue described in https://github.com/pytest-dev/pytest/issues/11282 (replace with the issue number) where the pytest.config.getini() method returns an empty list instead of None when an INI option is not provided. This change ensures that None is returned as the default value when an INI option is not found or has no default value provided by the developer.

Changes Made:

Modified the getini method in config.py to return None as the default value when an INI option is not found or has no default value. Added tests to cover this behavior, ensuring that None is returned when appropriate. Testing:

Added unit tests to verify the expected behavior of the getini method. Ran the test suite to ensure that existing functionality is not affected by this change. Changelog:

Added a new feature to the config.py module: getini now returns None as the default value when an INI option is not provided or has no default value. Checklist:

The code changes have been tested locally and work as expected. Documentation has been updated to reflect the changes. New tests have been added to cover the updated behavior. Maintain the ability to push and squash commits when merging. This PR addresses issue https://github.com/pytest-dev/pytest/issues/11282.

TanyaAgarwal28 avatar Oct 11 '23 06:10 TanyaAgarwal28

I just reported https://github.com/thisch/pytest-sphinx/issues/60. Is that related?

jab avatar Feb 01 '24 15:02 jab

Closing this because @TanyaAgarwal28 hasn't been seen on GitHub for several months. Happy to reopen if it updates!

Zac-HD avatar Feb 23 '24 07:02 Zac-HD