diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2013-12-26 09:10:36 -0800 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2013-12-26 09:10:36 -0800 |
commit | 98d9ceede87e1d13705e50d918391d2583868f6d (patch) | |
tree | 25f03b58d404a550931e1180cfc050ca8923549e /test_six.py | |
parent | e6079eeb0711b9947431113835ca8e4cd6ebe6c0 (diff) | |
download | six-98d9ceede87e1d13705e50d918391d2583868f6d.tar.gz |
test_six.py: test_MAXSIZE allow ValueError or OverflowError
because the previous code was expecting ValueError on Python 2.4,
but I was getting OverflowError on Python 2.4.4 on OS X but ValueError on
Python 2.4.6 on Ubuntu.
So perhaps knowing which exception will be raised is not that straightforward,
so I made it check for either one.
Diffstat (limited to 'test_six.py')
-rw-r--r-- | test_six.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test_six.py b/test_six.py index 34613ad..db9b624 100644 --- a/test_six.py +++ b/test_six.py @@ -59,11 +59,9 @@ def test_MAXSIZE(): except AttributeError: # Before Python 2.6. pass - if sys.version_info[:2] == (2, 4): - exc = ValueError - else: - exc = OverflowError - py.test.raises(exc, operator.mul, [None], six.MAXSIZE + 1) + py.test.raises( + (ValueError, OverflowError), + operator.mul, [None], six.MAXSIZE + 1) def test_lazy(): |