Skip to content

Commit 310d1d1

Browse files
committed
FIX try to make test sentinel more unique
1 parent 07b0db8 commit 310d1d1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

openml/testing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import unittest
66
import openml
77

8+
import numpy as np
9+
810

911
class TestBase(unittest.TestCase):
1012
"""Base class for tests
@@ -47,6 +49,8 @@ def setUp(self):
4749
md5 = hashlib.md5()
4850
md5.update(apikey.encode('utf-8'))
4951
md5.update(str(pid).encode('utf-8'))
52+
random_number = np.random.randint(1000000000)
53+
md5.update(str(random_number).encode('utf-8'))
5054
sentinel = md5.hexdigest()
5155
# For testing the hash code mustn't be bulletproof
5256
self.sentinel = '%sTESTSENTINEL999' % sentinel[:8]

0 commit comments

Comments
 (0)