summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2019-03-15 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2019-03-15 00:00:00 +0000
commitc0beff705c4c67f6ffe33abbe52a8dd9a30903ab (patch)
treec2553e708f2a06cbfb97af466ca813a370f3d383
parentad38913839ba927fbfc8f686397e2750454445eb (diff)
downloadgobject-introspection-c0beff705c4c67f6ffe33abbe52a8dd9a30903ab.tar.gz
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.
-rw-r--r--tests/scanner/test_ccompiler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/scanner/test_ccompiler.py b/tests/scanner/test_ccompiler.py
index dd8700d8..5890aa9b 100644
--- a/tests/scanner/test_ccompiler.py
+++ b/tests/scanner/test_ccompiler.py
@@ -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]