title: Unit testing with multiple data
body: <p>I am looking for an elegant way to run unit tests on multiple data, in this case a directory containing text files .</p>
  
  <p>Consider a folder <strong>text</strong> containing several <strong>txt</strong> files, I want run this example unittest on each file ( for example by feeding a list of files from glob to my unittest )</p>
  
  <p>Here is how I test a single hardcoded file .</p>
  
  <pre><code>import unittest
  import parser
  
  class TestParser(unittest.TestCase):
      text_path = 'text/journal.txt'
  
      def test_get_chapters(self):
          x = parser.get_chapters(self.text_path)
          self.assertGreater(len(x),1))
  
  if __name__ = "__main__":
      unittest.main()
  
  </code></pre>
  
  <p>Thanks !!</p>