From fdfb0e1310d300311ac2061b6f0bdb405f0b31e7 Mon Sep 17 00:00:00 2001 From: Shane Lee Date: Wed, 14 Feb 2024 14:05:59 -0700 Subject: [PATCH] Fix test_log_beacon.py::test_log_match test on Windows --- tests/pytests/unit/modules/test_textfsm_mod.py | 1 - tests/support/mock.py | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/pytests/unit/modules/test_textfsm_mod.py b/tests/pytests/unit/modules/test_textfsm_mod.py index ebf790055c6..e158c55b719 100644 --- a/tests/pytests/unit/modules/test_textfsm_mod.py +++ b/tests/pytests/unit/modules/test_textfsm_mod.py @@ -2,7 +2,6 @@ :codeauthor: Gareth J. Greenaway """ - import pytest import salt.modules.textfsm_mod as textfsm_mod diff --git a/tests/support/mock.py b/tests/support/mock.py index ad3fb6c3359..9a6778684b4 100644 --- a/tests/support/mock.py +++ b/tests/support/mock.py @@ -219,7 +219,11 @@ class MockFH: def __exit__(self, exc_type, exc_val, exc_tb): # pylint: disable=unused-argument pass - def _seek(self, pos=0): + # For some reason this gets called with additional args on Windows when + # running the following test: + # tests/pytests/unit/beacons/test_log_beacon.py::test_log_match + # Let's just absorb them with *args + def _seek(self, pos=0, *args): self.__loc = pos self.read_data_iter = self._iterate_read_data(self.read_data)