title: Asserting string matches regex in pytest
body: <p>I'm writing up a test using pytest to ensure a timestamp string that gets passed in matches the appropriate regex format. I have done this the following way.</p>
  
  <pre><code>test_epoch():
      timestamp = "1541811598.802"
      epoch_regex = re.compile(r'^[0-9]+$')
      assert epoch_regex.match(epoch)
  </code></pre>
  
  <p>However, when the test runs, I get the following error:</p>
  
  <pre><code>AssertionError: assert None
  +  where None = &lt;built-in method match of re.Pattern object at 0x11ade6480&gt;('1541840398.802')
  +    where &lt;built-in method match of re.Pattern object at 0x11ade6480&gt; = re.compile('^[0-9]+$').match
  </code></pre>
  
  <p>Does anyone know where I went wrong and how to properly assert a string matches regex?</p>