Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tests pass in Canadian locales #535

Merged
merged 1 commit into from
Sep 15, 2022
Merged

Make tests pass in Canadian locales #535

merged 1 commit into from
Sep 15, 2022

Conversation

syvb
Copy link
Member

@syvb syvb commented Sep 15, 2022

Currently various date-related tests fail on my machine that's in the Canadian English (en_CA) locale. Postgres date parsing is locale-dependent, so this PR makes the dates parsed in tests use a format that is parsed the same in (hopefully) all locales.

It would be better to set the locale of the database to en_US and write all dates US-style, but SETting the locale parameter doesn't seem to have an impact on date parsing for me. Ideally pgx should set the database locale when creating a test database to a consistent value (since some locale-related values can't be changed after database creation (not sure if date parsing is one of them)).

Postgres date parsing is locale-dependent, so make dates parsed in tests
use a format that is parsed the same in (hopefully) all locales.

It would be better to set the locale of the database, but SETting the
LC_DATE parameter doesn't seem to have an impact. Ideally pgx should set
the database locale when creating a test database.
Copy link
Contributor

@epgts epgts left a comment

Choose a reason for hiding this comment

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

Thanks!

@syvb
Copy link
Member Author

syvb commented Sep 15, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 15, 2022

@bors bors bot merged commit 75b6542 into main Sep 15, 2022
@bors bors bot deleted the sv/fix-tests-en_CA branch September 15, 2022 19:18
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.

2 participants