[gobject-introspection/gnome-3-32] tests: Fix compatibility with Python 3.5
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection/gnome-3-32] tests: Fix compatibility with Python 3.5
- Date: Fri, 15 Mar 2019 12:36:10 +0000 (UTC)
commit 9d97aee50f2f25636ef268b11909b3d1d9450bf4
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date: Fri Mar 15 00:00:00 2019 +0000
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.
tests/scanner/test_ccompiler.py | 4 ++--
1 file 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]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]