ericmandel / pyds9

Python connection to SAOimage DS9 via XPA
76 stars 41 forks source link

handle python 3 bytestring/strings a bit-more gracefully #88

Closed DougBurke closed 4 years ago

DougBurke commented 4 years ago

A number of tests were marked as "skip", and its unclear to me why, so let's run them and see what happens. It wasn't clear what the actual test should be in one case, so I have tweaked it slightly (test_ds9_openlist).

Several tests that were marked as "xfail" have been converted to tests which check that a particular error is raised (with pytest.raises).

pyds9/tests/test_pyds9.py::test_get_arr2np[test.fits]
  /tmp/pyds9-test-dttpo3f7/lib/python3.7/site-packages/pyds9/pyds9.py:763: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
    arr = numpy.fromstring(s, dtype=_bp2np(bp)).reshape((h, w))

pyds9/tests/test_pyds9.py::test_get_arr2np[test_3D.fits]
  /tmp/pyds9-test-dttpo3f7/lib/python3.7/site-packages/pyds9/pyds9.py:761: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
    arr = numpy.fromstring(s, dtype=_bp2np(bp)).reshape((d, h, w))