Skip to content

Increase test coverage for GeometryCollection class#951

Merged
mwtoews merged 4 commits intoshapely:masterfrom
tomplex:increase-geometry-test-coverage
Aug 6, 2020
Merged

Increase test coverage for GeometryCollection class#951
mwtoews merged 4 commits intoshapely:masterfrom
tomplex:increase-geometry-test-coverage

Conversation

@tomplex
Copy link
Copy Markdown
Contributor

@tomplex tomplex commented Jul 31, 2020

We're about to experience a good bit of churn with the push to Shapely 2.0 & merge with PyGEOS, so this seemed like a good time to work on increasing test coverage, especially in the geometry classes where I expect we will be trying to keep the interface and behavior identical while completely changing the internal workings. I also would like to consolidate tests to use Pytest, as it seems like most new tests have been written using that framework, and I think it'd be nice to have more consistency there.

If you're a 👍 on this, I'll keep adding to this or open another PR for more work, whatever is preferred. If not, no worries, but I wanted to check in to see what other folks thought before I did too much.

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 31, 2020

Coverage Status

Coverage increased (+0.1%) to 82.242% when pulling 3533d16 on tomplex:increase-geometry-test-coverage into 24a9bf7 on Toblerity:master.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.1%) to 82.242% when pulling 50b5057 on tomplex:increase-geometry-test-coverage into 24a9bf7 on Toblerity:master.

@sgillies
Copy link
Copy Markdown
Contributor

sgillies commented Aug 2, 2020

@tomplex I'm in favor, but also want to check in with @jorisvandenbossche who is doing much of the 2.0 work.

@jorisvandenbossche
Copy link
Copy Markdown
Member

Yes, also +1 on this, both for better usage of pytest as for trying to get better test coverage.
(asking about modernizing the tests / removing some unittest specificities was on my todo list, as I noticed those issues as well doing my first shapely 2.0 PRs)

@mwtoews
Copy link
Copy Markdown
Member

mwtoews commented Aug 5, 2020

modernizing the tests / removing some unittest specificities was on my todo list

Yes please! The unittest way was fine 10 years ago, but I much prefer to see a modern pytest approach, as done in this PR. I have no idea if it really changes the coverage metrics (+0.1%??), but this is secondary to maintaining to modern conventions.

@tomplex
Copy link
Copy Markdown
Contributor Author

tomplex commented Aug 5, 2020

I have no idea if it really changes the coverage metrics (+0.1%??),

Coverage increased because I added some test cases for things which weren't covered before: the __geo_interface__ property and the geos_geometrycollection_from_py function with a 3-dim input. Small, but enough to get us from 79% to 92% for the file. Now all that's left uncovered here is the doctest test runner.

Either way, since it seems this is popular I'll keep on trucking down this path with added focus on updating tests to use pytest. Would folks prefer to see more numerous, smaller PR's, or for me to keep adding to this one? I think I'd learn towards smaller PR's but I'm generally indifferent.

@jorisvandenbossche
Copy link
Copy Markdown
Member

I am personally in favor of smaller PRs as well (maybe updating a few files combined in a single PR is fine, but I would certainly not do a single overhaul of all test files in one PR).

@jorisvandenbossche
Copy link
Copy Markdown
Member

Apart from the unrelated empty-collection discussion (opened a new issue for that -> #956), this PR is ready to be merged?

@tomplex
Copy link
Copy Markdown
Contributor Author

tomplex commented Aug 6, 2020

Yes, I believe this is ready to go.

Copy link
Copy Markdown
Member

@mwtoews mwtoews left a comment

Choose a reason for hiding this comment

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

Just two is_empty checks to add, otherwise looks good!

@mwtoews mwtoews merged commit 719cf1c into shapely:master Aug 6, 2020
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.

5 participants