From 8f70f2dc69870c20e8ade50170e6663f25d16b48 Mon Sep 17 00:00:00 2001 From: junkmd Date: Sat, 17 Feb 2024 22:22:56 +0900 Subject: [PATCH] Bring back Excel early-bind test --- comtypes/test/test_excel.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/comtypes/test/test_excel.py b/comtypes/test/test_excel.py index 42e6c12a8..b57bfdda1 100644 --- a/comtypes/test/test_excel.py +++ b/comtypes/test/test_excel.py @@ -2,6 +2,7 @@ from __future__ import print_function import datetime +import sys import unittest from comtypes.client import CreateObject, GetModule @@ -112,10 +113,16 @@ def test(self): sh.Range[sh.Cells.Item[4, 1], sh.Cells.Item[6, 3]].Select() +PY_VER = "Python {0}.{1}.{2}".format(*sys.version_info[:3]) + + @unittest.skipIf(IMPORT_FAILED, "This depends on Excel.") -@unittest.skip( - "There is difference of `Range.Value` behavior " - "between Python >= 3.8.x and Python <= 3.7.x." +@unittest.skipIf( + sys.version_info[:2] == (3, 8) + or sys.version_info[:2] == (3, 9) + or (sys.version_info[:2] == (3, 10) and sys.version_info < (3, 10, 10)) + or (sys.version_info[:2] == (3, 11) and sys.version_info < (3, 11, 2)), + f"This fails in {PY_VER}. See https://github.com/enthought/comtypes/issues/212", ) class Test_EarlyBind(BaseBindTest, unittest.TestCase): dynamic = False