title: Unittest python csv file open test returns empty list
body: <p>I have a function I'm trying to test that processes a csv file. One of the tests I'm trying to create checks that the expected and actual data match. I'm expecting the read_data to be output in the format of a single list with a dictionary. But the output is an empty list. How can I get unittest to return the correct data from the function, or am I using unittest incorrectly?</p>
  <p><strong>Function process_csv</strong></p>
  <pre><code>def process_csv(file):
          '''
          Read csv file and return list of dictionaries
          ''' 
          return_list = []
          issue = 1
          summary = 2
          description = 3
          commit = 4
      
          print('Processing csv...',flush=True)
          with open(file) as csv_file:
              csv_reader = csv.reader(csv_file, delimiter=',')
              line_count = 0
              for row in csv_reader:
                  return_list.append({'issue': row[issue], 
                                      'summary': row[summary],
                                      'description': row[description], 'commit': row[commit]})
      
                  line_count += 1
              print('Processed', line_count,'lines.')
      
          return return_list
  </code></pre>
  <hr />
  <p><strong>Test test_process_csv_expected_output</strong></p>
  <pre><code>@patch('myScript.open', new_callable=mock_open, create=True,read_data='issue, summary, description, commit')     
      def test_process_csv_expected_output(self,mock_file,mock_get_file_hash,mock_get_file_paths):
          '''
          Test process_csv expected output matches actual_output
          '''
          test_csv_path = str(TEST_CSV_PATH)
          test_file_path = str(STATIC_REPO)
          expected_data = {'issue': 'myIssue', 
                           'summary': 'test_page.page',
                           'description': 'Test description' , 'commit': 'ABCD'}
          mock_get_file_paths.return_value = test_file_path
          mock_get_file_hash.return_value = 'ABCD'
  
          myScript.process_csv(test_file_path)
          actual_output = git_build_opwg_branch.process_csv(test_file_path)
          self.assertEqual(expected_data,actual_output)
  </code></pre>
  <p><strong>Error</strong></p>
  <pre><code>FAIL: test_process_csv_expected_output (__main__.TestGitBuildOpwgBranch)
  
  Test process_csv expected output matches actual_output
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File &quot;C:\Users\tzjust\AppData\Local\Programs\Python\Python38-32\lib\unittest\mock.py&quot;, line 1325, in patched
      return func(*newargs, **newkeywargs)
    File &quot;test_git_build_opwg_branch.py&quot;, line 224, in test_process_csv_expected_output
      self.assertEqual(expected_data,actual_output)
  AssertionError: {'issue': 'L9R-4604', 'summary': 'test_pa[153 chars]BCD'} != []
  </code></pre>