Skip to content

Commit a5ca360

Browse files
committed
Fixed test_core.py
Latest version of pandas changed the behaviour of groupby and does not call it multiple times. I believe it's related to pandas-dev/pandas#24748.
1 parent d6daadc commit a5ca360

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,10 +351,13 @@ def scm_download_file(_):
351351
self.assertEqual(expected, actual)
352352

353353
@mock.patch('codemetrics.internals.run', autospec=True,
354-
side_effect=[file_content_1, file_content_1, file_content_2])
355-
def test_analysis_with_groupby_svn_download(self, _):
354+
side_effect=[file_content_1, file_content_2])
355+
def test_analysis_with_groupby_svn_download(self, run_):
356356
"""Check interface with svn."""
357357
actual = self.get_complexity(cm.svn.download)
358+
expected_calls = [mock.call('svn cat -r r1 f.py'),
359+
mock.call('svn cat -r r2 f.py')]
360+
self.assertEqual(expected_calls, run_.call_args_list)
358361
expected = pd.read_csv(io.StringIO(textwrap.dedent("""\
359362
revision,path,function,cyclomatic_complexity,nloc,token_count,name,long_name,start_line,end_line,top_nesting_level,length,fan_in,fan_out,general_fan_out,file_tokens,file_nloc
360363
r1,f.py,0,2,4,16,test,test( ),1,4,0,4,0,0,0,17,4

0 commit comments

Comments
 (0)