title: How can I test functions, which use random?
body: <p>It's an attempt to code <code>popitem</code> function for dictionaries with linear seqarch arrays architecture. Can you give me an example, how should I test this funtion with unittests?</p>
  
  <pre><code>def popitem(self):
      number = self.keys_list[random.randint(0, len(self.keys_list))] 
      i = 0
      while i &lt; len(self.values_list):
          if i == number:
              needed_key = self.keys_list[i]
              needed_value = self.values_list[i]
              self.keys_list.remove(needed_key)
              self.values_list.remove(needed_value)
              return (needed_key, needed_value)
  </code></pre>