diff options
Diffstat (limited to 'numpy/random/randomgen/tests/test_direct.py')
| -rw-r--r-- | numpy/random/randomgen/tests/test_direct.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/random/randomgen/tests/test_direct.py b/numpy/random/randomgen/tests/test_direct.py index 6e856de41..22fdcd865 100644 --- a/numpy/random/randomgen/tests/test_direct.py +++ b/numpy/random/randomgen/tests/test_direct.py @@ -233,14 +233,14 @@ class Base(object): def test_repr(self): rs = RandomGenerator(self.brng(*self.data1['seed'])) - assert 'RandomGenerator' in rs.__repr__() - assert str(hex(id(rs)))[2:].upper() in rs.__repr__() + assert 'RandomGenerator' in repr(rs) + assert '{:#x}'.format(id(rs)).upper().replace('X', 'x') in repr(rs) def test_str(self): rs = RandomGenerator(self.brng(*self.data1['seed'])) assert 'RandomGenerator' in str(rs) assert str(self.brng.__name__) in str(rs) - assert str(hex(id(rs)))[2:].upper() not in str(rs) + assert '{:#x}'.format(id(rs)).upper().replace('X', 'x') not in str(rs) def test_generator(self): brng = self.brng(*self.data1['seed']) |
