sixty-north / segpy

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

Proposal: switch to pytest for tests #37

Closed abingham closed 7 years ago

abingham commented 7 years ago

While I'm largely of the opinion at this point that pytest is "just better", that wouldn't be enough reason to switch over. However, I've run into a concrete issue that seems like a good motivation. I would like to be able to run some of the tests using both the Python and (if available) C++ version of of the un/pack routines. The obvious way to do this is with test parameterization.

Unfortunately, test parameterization via subTest() wasn't added to unittest until python 3.4, so our travis test suite is failing on 3.3.

We have a few alternatives, including:

  1. Use a non-parameterized approach, i.e. just brute forcing things a bit
  2. Use the backport packages unittest2
  3. Use pytest

All of these will work, but ultimately I think I'd prefer just switching to pytest.

rob-smallshire commented 7 years ago

I'm fine with using pytest. We already have external dependencies for testing with hypothesis, and pytest is a definite improvement over unittest. The only external I really wanted to avoid for core segpy was numpy, so segpy could be used with PyPy3.

abingham commented 7 years ago

I've created a PR that switches over to pytest.

abingham commented 7 years ago

Fixed in 6945c720516899871c84a365f27d528d91e89a7f