diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-03-25 10:11:43 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-03-25 10:36:28 +0000 |
commit | b87fca27261f79be20ab06a222ed2330d60d9f2c (patch) | |
tree | 00907ad5fffa7d13f99b1cf60398c624063f807e /numpy/random/tests/test_random.py | |
parent | a2c4d3230d58a5c4569ab2c7f13bdf9499b71dd4 (diff) | |
download | numpy-b87fca27261f79be20ab06a222ed2330d60d9f2c.tar.gz |
MAINT: Remove asbytes where a b prefix would suffice
Since we only need to support python 2, we can remove any case where we just
pass a single string literal and use the b prefix instead.
What we can't do is transform asbytes("tests %d" % num), because %-formatting
fails on bytes in python 3.x < 3.5.
Diffstat (limited to 'numpy/random/tests/test_random.py')
-rw-r--r-- | numpy/random/tests/test_random.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py index e4c58e2bd..753765194 100644 --- a/numpy/random/tests/test_random.py +++ b/numpy/random/tests/test_random.py @@ -7,7 +7,6 @@ from numpy.testing import ( assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings) from numpy import random -from numpy.compat import asbytes import sys import warnings @@ -393,7 +392,7 @@ class TestRandomDist(TestCase): def test_bytes(self): np.random.seed(self.seed) actual = np.random.bytes(10) - desired = asbytes('\x82Ui\x9e\xff\x97+Wf\xa5') + desired = b'\x82Ui\x9e\xff\x97+Wf\xa5' assert_equal(actual, desired) def test_shuffle(self): |