From ab61f3ca30bc1307ea86f69e06ef5d751a427ca7 Mon Sep 17 00:00:00 2001 From: Shiyu Wang <42013343+shi-yu-wang@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:17:05 -0700 Subject: [PATCH] version conflict in test_resample.py --- tests/transform/test_resample.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/transform/test_resample.py b/tests/transform/test_resample.py index 177550cb..9804b03e 100644 --- a/tests/transform/test_resample.py +++ b/tests/transform/test_resample.py @@ -51,28 +51,21 @@ def test_two_month(self): logger.info("Testing end-of-month resampling...") self._test_granularity(granularity="2ME") logger.info("Testing end-of-month resampling...") - try: + if sys.version_info[1] < 8: self._test_granularity(granularity="2M", offset=-pd.Timedelta(days=7, hours=7)) - except: - print("An exception occurred. Might due to version issue") - try: + + if sys.version_info[1] >= 8: self._test_granularity(granularity="2ME", offset=-pd.Timedelta(days=7, hours=7)) - except: - print("An exception occurred. Might due to version issue") def test_yearly(self): logger.info("Testing start-of-year resampling...") self._test_granularity(granularity="12MS", offset=pd.to_timedelta(0)) logger.info("Testing end-of-year resampling...") - try: + if sys.version_info[1] < 8: self._test_granularity(granularity="12M", offset=pd.to_timedelta(0)) - except: - print("An exception occurred. Might due to version issue") - - try: + + if sys.version_info[1] >= 8: self._test_granularity(granularity="12ME", offset=pd.to_timedelta(0)) - except: - print("An exception occurred. Might due to version issue") class TestShingle(unittest.TestCase):