Commit Graph

7 Commits

Author SHA1 Message Date
Bruno Oliveira 57c4489916 Use a simple ``+-`` ASCII string in the string representation of pytest.approx In Python 2
Fix #2111
2016-12-02 20:01:53 -02:00
Bruno Oliveira 33c0b06fdf Fix error in approx's repr with complex numbers
Fix #2082
2016-11-24 15:33:12 -02:00
Kale Kundert 916c0a8b36 Fix Decimal() and __ne__() errors. 2016-03-11 16:29:18 -08:00
Kale Kundert 42a7e0488d Properly handle inf, nan, and built-in numeric types.
This commit also:

- Dramatically increases the number of unit tests , mostly by borrowing
  from the standard  library's unit tests for math.isclose().

- Refactors approx() into two classes, one of which handles comparing
  individual numbers (ApproxNonIterable) and another which uses the
  first to compare individual numbers or sequences of numbers.
2016-03-11 08:49:26 -08:00
Kale Kundert bf97d5b817 Use the plus/minus unicode symbol in the repr string.
This was a challenge because it had to work in python2 and python3,
which have almost opposite unicode models, and I couldn't use the six
library.  I'm also not sure the solution I found would work in python3
before python3.3, because I use the u'' string prefix which I think was
initially not part of python3.
2016-03-07 16:40:41 -08:00
Kale Kundert dd28e28b34 Make a few stylistic improvements. 2016-03-07 10:10:54 -08:00
Kale Kundert 6f5e1e386a Add a convenient and correct way to compare floats. 2016-03-07 10:10:54 -08:00