Commit c0beff70 authored by Tomasz Miąsko's avatar Tomasz Miąsko

tests: Fix compatibility with Python 3.5

Use call_count to verify the number of calls. This replaces
assert_called_once used previously, which is only available
since Python 3.6.

Fixes issue #274.
parent ad389138
Pipeline #68397 passed with stages
in 5 minutes and 17 seconds
......@@ -85,7 +85,7 @@ class UnixCCompilerTest(unittest.TestCase):
# Don't actually do anything.
cc.compiler.dry_run = True
cc.compile(pkg_config_cflags, cpp_includes, [source], init_sections)
spawn.assert_called_once()
self.assertEqual(1, spawn.call_count)
args, kwargs = spawn.call_args
return args[0]
......@@ -106,7 +106,7 @@ class UnixCCompilerTest(unittest.TestCase):
# Don't actually do anything.
cc.compiler.dry_run = True
cc.preprocess(source, output, cpp_options)
spawn.assert_called_once()
self.assertEqual(1, spawn.call_count)
args, kwargs = spawn.call_args
return args[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment