-
Notifications
You must be signed in to change notification settings - Fork 213
Make tests less specific about feature equality #1060
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
Conversation
| assert len(items) == len(records1) | ||
| for val_in, val_out in zip(records1, items): | ||
| assert test_equal(driver, val_in, val_out), "in: {val_in}, out: {val_out}".format(val_in=val_in, | ||
| val_out=val_out) |
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.
|
|
||
| c.writerecords(records1) | ||
|
|
||
| is_good = True |
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.
This complicated the test and made it hard to understand. I've tried to rewrite it without this flag.
| with fiona.open(path, "a", driver=driver) as c: | ||
| c.writerecords(records2) | ||
| except Exception as exc: | ||
| log.exception("Caught exception in trying to append.") |
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.
Reduced the scope of the try/except block.
tests/test_drvsupport.py
Outdated
| assert not is_good | ||
| with fiona.open(path, driver=open_driver) as collection: | ||
| assert collection.driver == driver | ||
| assert len(collection) == len(records1) |
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.
I think this is the heart of it. If no new records were added and there was no other exception, the format does not support appending.
|
PCIDSK is a difficult vector format. It doesn't appear in https://gdal.org/drivers/vector/index.html and got a rewrite at 3.3.0. The driver in versions back to 2.1 seems to support append, at least in my more general rewrite of the tests, so I've adjusted the metadata. |
|
Re PCIDSK, see #1046 (comment) which was put into the master branch. I recall looking at the release notes for that GDAL release, but didn't see much for PCIDSK. |
Also reformat.
Towards resolving #935 #1031