[Pytest-commit] [pytest-dev/pytest] 495f73: Simplify how comparisons with numpy arrays work.

Bruno Oliveira nicoddemus at gmail.com
Sat Jul 22 13:21:09 EDT 2017


  Branch: refs/heads/features
  Home:   https://github.com/pytest-dev/pytest
  Commit: 495f731760341130deeeb05bef504921d20b7473
      https://github.com/pytest-dev/pytest/commit/495f731760341130deeeb05bef504921d20b7473
  Author: Kale Kundert <kale at thekunderts.net>
  Date:   2017-07-22 (Sat, 22 Jul 2017)

  Changed paths:
    M _pytest/python_api.py

  Log Message:
  -----------
  Simplify how comparisons with numpy arrays work.

Previously I was subverting the natural order of operations by
subclassing from `ndarray`, but it turns out that you can tell just
numpy to call your operator instead of its by setting the
`__array_priority__` attribute on your class.  This is much simpler, and
it turns out the be a little more robust, too.


  Commit: 4c45bc997149582f05a1c4853838190194a074be
      https://github.com/pytest-dev/pytest/commit/4c45bc997149582f05a1c4853838190194a074be
  Author: Kale Kundert <kale at thekunderts.net>
  Date:   2017-07-22 (Sat, 22 Jul 2017)

  Changed paths:
    M tox.ini

  Log Message:
  -----------
  Add the numpy tests back into tox.ini

I'm not sure why they were removed...


  Commit: ebc7346be4da2d56e3c6f1686f545105f70b9c89
      https://github.com/pytest-dev/pytest/commit/ebc7346be4da2d56e3c6f1686f545105f70b9c89
  Author: Kale Kundert <kale at thekunderts.net>
  Date:   2017-07-22 (Sat, 22 Jul 2017)

  Changed paths:
    M _pytest/python_api.py

  Log Message:
  -----------
  Raise TypeError for types that can't be compared to arrays.


  Commit: 1b732fe3612985421d1ad40f1d84a460005f7967
      https://github.com/pytest-dev/pytest/commit/1b732fe3612985421d1ad40f1d84a460005f7967
  Author: Bruno Oliveira <nicoddemus at gmail.com>
  Date:   2017-07-22 (Sat, 22 Jul 2017)

  Changed paths:
    M _pytest/python_api.py
    M tox.ini

  Log Message:
  -----------
  Merge pull request #2606 from kalekundert/simplify-numpy

Make approx more compatible with numpy


Compare: https://github.com/pytest-dev/pytest/compare/b35554ca2b2f...1b732fe36129


More information about the pytest-commit mailing list