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

Refactor ogr_index_test.py to remove dependency on test order #4421

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

DFEvans
Copy link
Contributor

@DFEvans DFEvans commented Sep 3, 2021

What does this PR do?

Refactor ogr_index_test.py to remove dependency on test order

In particular, incorrect test ordering causes a segfault in some circumstances.

(If interested in diagnosing that further, running pytest ogr/ogr_index_test.py --random-order-seed=8 on commit 364c56b produces it reproducibly for me)

Also split some assertions into separate tests.

What are related issues/pull requests?

#4407

Tasklist

  • Refactor test cases
  • Review
  • Adjust for comments
  • All CI builds and checks have passed

@rouault
Copy link
Member

rouault commented Sep 3, 2021

 autotest/ogr/ogr_index_test.py:32:1: F401 'gdaltest' imported but unused
autotest/ogr/ogr_index_test.py:124:9: F841 local variable 's_ds' is assigned to but never used
autotest/ogr/ogr_index_test.py:205:9: F841 local variable 's_lyr' is assigned to but never used
autotest/ogr/ogr_index_test.py:240:5: F841 local variable 'expect' is assigned to but never used
autotest/ogr/ogr_index_test.py:244:9: F841 local variable 's_lyr' is assigned to but never used
autotest/ogr/ogr_index_test.py:268:5: F841 local variable 'expect' is assigned to but never used
autotest/ogr/ogr_index_test.py:272:9: F841 local variable 's_lyr' is assigned to but never used
autotest/ogr/ogr_index_test.py:293:5: F841 local variable 'expect' is assigned to but never used
autotest/ogr/ogr_index_test.py:297:9: F841 local variable 's_lyr' is assigned to but never used

…ausea a segfault in some circumstances. Split some assertions into separate tests.
@DFEvans DFEvans force-pushed the refactor_ogr_index_test branch from bdc27f6 to 0e8a248 Compare September 3, 2021 13:28
@rouault rouault merged commit 0ac07cd into OSGeo:master Sep 3, 2021
@DFEvans DFEvans deleted the refactor_ogr_index_test branch September 8, 2021 11:08
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