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

fix: constrained strings not deterministic with seed because urandom not seedable #319

Merged
merged 3 commits into from
Aug 2, 2023

Conversation

klimantje
Copy link
Contributor

@klimantje klimantje commented Aug 2, 2023

Pull Request Checklist

  • New code has 100% test coverage
  • (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
  • (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
  • Pre-Commit Checks were ran and passed
  • Tests were ran and passed

Description

  • urandom was replaced by using random.getrandbits to make generation of constrained strings deterministic when seed is set

Close Issue(s)

Fixes #316

@klimantje klimantje requested review from a team as code owners August 2, 2023 13:18
@klimantje klimantje changed the title urandom not seedable fix: constrained strings not deterministic with seed because urandom not seedable Aug 2, 2023
Copy link
Contributor

@Goldziher Goldziher left a comment

Choose a reason for hiding this comment

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

@Goldziher Goldziher merged commit 3aeaa0c into litestar-org:main Aug 2, 2023
15 checks passed
@Goldziher
Copy link
Contributor

@all-contributors add @klimantje code

@allcontributors
Copy link
Contributor

@Goldziher

I've put up a pull request to add @klimantje! 🎉

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.

Setting seed does not make mock data generation deterministic in case of pydantic factory
2 participants