From 024c74562ed97a1e57f4dd2b255bff83fd44fddc Mon Sep 17 00:00:00 2001 From: larsevj Date: Thu, 18 Jan 2024 15:49:56 +0100 Subject: [PATCH] Make tests compatible with Python 3.11 Avoid implicit float to int conversion which has been deprecated for builtin functions. --- python/tests/rd_tests/test_grid.py | 2 +- python/tests/rd_tests/test_rd_sum.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/tests/rd_tests/test_grid.py b/python/tests/rd_tests/test_grid.py index 5ebe59635..7b20b9045 100644 --- a/python/tests/rd_tests/test_grid.py +++ b/python/tests/rd_tests/test_grid.py @@ -312,7 +312,7 @@ def test_truncated_file(self): size = os.path.getsize("TEST.EGRID") with open("TEST.EGRID", "r+") as f: - f.truncate(size / 2) + f.truncate(size // 2) with self.assertRaises(IOError): Grid("TEST.EGRID") diff --git a/python/tests/rd_tests/test_rd_sum.py b/python/tests/rd_tests/test_rd_sum.py index 7d701b974..a18e71b2a 100644 --- a/python/tests/rd_tests/test_rd_sum.py +++ b/python/tests/rd_tests/test_rd_sum.py @@ -85,7 +85,7 @@ def test_truncated_smspec(self): file_size = os.path.getsize("ECLIPSE.SMSPEC") with open("ECLIPSE.SMSPEC", "r+") as f: - f.truncate(file_size / 2) + f.truncate(file_size // 2) with self.assertRaises(IOError): Summary("ECLIPSE") @@ -97,7 +97,7 @@ def test_truncated_data(self): file_size = os.path.getsize("ECLIPSE.UNSMRY") with open("ECLIPSE.UNSMRY", "r+") as f: - f.truncate(file_size / 2) + f.truncate(file_size // 2) with self.assertRaises(IOError): Summary("ECLIPSE")