Skip to content

Commit

Permalink
Bring back Excel early-bind test (#514)
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd authored Feb 17, 2024
1 parent c6f8004 commit 42cf9d7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions comtypes/test/test_excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import print_function

import datetime
import sys
import unittest

from comtypes.client import CreateObject, GetModule
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42cf9d7

Please sign in to comment.