Skip to content

Commit

Permalink
Make tests compatible with Python 3.11
Browse files Browse the repository at this point in the history
Avoid implicit float to int conversion which has been deprecated for
builtin functions.
  • Loading branch information
larsevj committed Jan 24, 2024
1 parent 6a113a4 commit 024c745
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/tests/rd_tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions python/tests/rd_tests/test_rd_sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit 024c745

Please sign in to comment.