Skip to content

Parse port_search_count as an int#1114

Merged
fizyk merged 4 commits intodbfixtures:mainfrom
maxhully:max/port-search-count-int
May 10, 2025
Merged

Parse port_search_count as an int#1114
fizyk merged 4 commits intodbfixtures:mainfrom
maxhully:max/port-search-count-int

Conversation

@maxhully
Copy link
Copy Markdown
Contributor

@maxhully maxhully commented Mar 20, 2025

Chore that needs to be done:

  • Add newsfragment pipenv run towncrier create [issue_number].[type].rst

Types are defined in the pyproject.toml, issue_number either from issue tracker or the Pull request number

Comment thread pytest_postgresql/config.py Outdated
port=get_postgresql_option("port"),
port_search_count=get_postgresql_option("port_search_count"),
# Parse as int, because if it's defined in an INI file then it'll always be a string
port_search_count=int(get_postgresql_option("port_search_count", default=5)),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd defer to keeping all defaults in single place either defaults for ini or here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! I'll keep them in INI. This should also fix the bug where my return request.config.getoption(name) or request.config.getini(name) or default code was returning None for any falsey config setting

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I could change it to be more careful about only coalescing when request.config.getoption(name) is None)

@maxhully maxhully requested a review from fizyk April 1, 2025 20:05
@maxhully
Copy link
Copy Markdown
Contributor Author

maxhully commented May 3, 2025

Hi again! Sorry for the delay. I got my local dev setup working and fixed the silly bug that was causing my CLI config test to fail.

@fizyk fizyk merged commit 2b7191c into dbfixtures:main May 10, 2025
44 checks passed
@fizyk
Copy link
Copy Markdown
Member

fizyk commented May 10, 2025

@maxhully thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

port_search_count config option gets parsed as a string if you pass it via command-line flag or as an INI option

2 participants