-
Notifications
You must be signed in to change notification settings - Fork 27
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
test: initial commit adding hypothesis property testing library #186
test: initial commit adding hypothesis property testing library #186
Conversation
Adding the Hypothesis cache dir to .gitignore Grammar fixes in geometry.py Hypothesis dep in pyproject.toml without version peg Initial strategies in conftest.py. This is the only file name I could use that didn't cause an issue with the name-tests-test pre-commit hook. 'strategies.py' would be better because strictly speaking these aren't fixtures. An example test for encode/decode invariance.
WatermelonAI SummaryAI Summary deactivated by bpshaver GitHub PRs
No results found in Jira Tickets :( No results found in Confluence Docs :( No results found in Slack Threads :( No results found in Notion Pages :( No results found in Linear Tickets :( No results found in Asana Tasks :( pygeoif is an open repo and Watermelon will serve it for free. |
PR Summary
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## 179-add-hypothesis-tests #186 +/- ##
============================================================
- Coverage 100.00% 99.87% -0.13%
============================================================
Files 21 22 +1
Lines 2412 2437 +25
============================================================
+ Hits 2412 2434 +22
- Misses 0 3 +3
☔ View full report in Codecov by Sentry. |
I would prefer another file layout and not putting the strategies in
The SRS could be defined as a
an instance of an srs can optionally be passed into the
and
Hope that helps 👍 nice work |
WatermelonAI SummaryAI Summary deactivated by bpshaver GitHub PRs
No results found in Jira Tickets :( No results found in Confluence Docs :( No results found in Slack Threads :( No results found in Notion Pages :( No results found in Linear Tickets :( No results found in Asana Tasks :( pygeoif is an open repo and Watermelon will serve it for free. |
You can add an 'exclude' to the
|
Are you still working on this? |
Hi, sorry. Will try and get to this tomorrow. But if you want to press on ahead I won't be offended if you remove me from this issue. |
No, no worries, we all got a (private) life apart from coding, but I thought I'd better ask, as abandoning an issue is not uncommon. |
@CodiumAI-Agent /describe |
TitleIntegrate Hypothesis Testing Library and Improve Grammar in Comments TypeTests, Enhancement DescriptionThis PR integrates the Hypothesis property-based testing library into the project and adds new test strategies in the 'conftest.py' file. It also improves the grammar in the comments of the 'geometry.py' file. Additionally, a new test case using Hypothesis has been added in 'test_point.py'. The Hypothesis library has been added as a dependency in 'pyproject.toml'. PR changes walkthrough
|
@CodiumAI-Agent /review |
PR Analysis
PR Feedback
How to useInstructions
|
@CodiumAI-Agent /improve |
if srs == "EPSG:4326": | ||
return draw(st.tuples(latitudes, longitudes)) | ||
raise NotImplementedError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Wrap the validation logic inside a function for better reusability and readability.
if srs == "EPSG:4326": | |
return draw(st.tuples(latitudes, longitudes)) | |
raise NotImplementedError | |
def validate_srs(srs, draw, strategy): | |
if srs == "EPSG:4326": | |
return draw(strategy) | |
raise NotImplementedError | |
validate_srs(srs, draw, st.tuples(latitudes, longitudes)) |
if srs == "EPSG:4326": | ||
return draw(st.tuples(latitudes, longitudes, elevations)) | ||
raise NotImplementedError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The validation logic is repeated in multiple places. Consider creating a helper function to avoid repetition.
if srs == "EPSG:4326": | |
return draw(st.tuples(latitudes, longitudes, elevations)) | |
raise NotImplementedError | |
validate_srs(srs, draw, st.tuples(latitudes, longitudes, elevations)) |
if srs == "EPSG:4326": | ||
return draw(st.one_of(points_2d(), points_3d())) | ||
raise NotImplementedError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The validation logic is repeated. Consider creating a helper function to avoid repetition.
if srs == "EPSG:4326": | |
return draw(st.one_of(points_2d(), points_3d())) | |
raise NotImplementedError | |
validate_srs(srs, draw, st.one_of(points_2d(), points_3d())) |
84ed536
into
cleder:179-add-hypothesis-tests
Adding the Hypothesis cache dir to .gitignore
Grammar fixes in geometry.py
Hypothesis dep in pyproject.toml without version peg Initial strategies in conftest.py. This is the only file name I could use that didn't cause an issue with the name-tests-test pre-commit hook. 'strategies.py' would be better because strictly speaking these aren't fixtures. An example test for encode/decode invariance.