sixty-north / segpy

A Python package for reading and writing SEG Y files.
Other
102 stars 54 forks source link

Added some tests for exceptions thrown by `create_reader()`. #60

Closed abingham closed 6 years ago

abingham commented 6 years ago

This adds a few tests along with some improvements to the create_reader docstring.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-5.8%) to 63.651% when pulling 7d2bea6df9a10556a3918ca8a6c47eb8db223be3 on abingham:reader-tests into 8583756227a2d728663ce9a21002fe6c404d848c on sixty-north:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-5.8%) to 63.651% when pulling fea6ea798b9f02c0fdde265b98e9cd57a7aea3fa on abingham:reader-tests into 8583756227a2d728663ce9a21002fe6c404d848c on sixty-north:master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-5.8%) to 63.651% when pulling fea6ea798b9f02c0fdde265b98e9cd57a7aea3fa on abingham:reader-tests into 8583756227a2d728663ce9a21002fe6c404d848c on sixty-north:master.

abingham commented 6 years ago

I am no entirely sure why coverage decreased. I added tests and documentation, so it seems like it could only increase, or at worst stay the same.

I think what happened is that reader.py was not even imported previously, so its lines weren't included in the coverage statistics. So the new tests a) bring in a lot of new lines (reader.py) and b) only cover some of them. So the aggregate coverage statistic has gone down.

Looking at the coverage results, we can see that coverage stayed the same or got better in every file.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-5.8%) to 63.705% when pulling 1d5e8afcf6264b339693ef5afb3b63c7c8474559 on abingham:reader-tests into 8583756227a2d728663ce9a21002fe6c404d848c on sixty-north:master.

rob-smallshire commented 6 years ago

Yes, for some reason only files which are covered at all count towards coverage. I'll admit I don't understand the motivation for that.

abingham commented 6 years ago

I think I understand the motivation now. Basically, coverage.py only looks at code that's imported into the runtime. It doesn't try to guess which modules "should" be imported. So new tests which cause new modules to be imported cause the line count to go up. At least, that's my guess as to what's happening.