Skip to content

Commit

Permalink
Remove duplicated tests from test_propputref, test_safearray and …
Browse files Browse the repository at this point in the history
…`test_variant`.
  • Loading branch information
junkmd committed Dec 9, 2024
1 parent 68ff423 commit 88959c8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 80 deletions.
40 changes: 0 additions & 40 deletions comtypes/test/test_propputref.py

This file was deleted.

23 changes: 0 additions & 23 deletions comtypes/test/test_safearray.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,29 +221,6 @@ def test_VT_UNKNOWN_multi(self):
del sa
self.assertEqual((a, b), (com_refcnt(plib), com_refcnt(punk)))

@unittest.skip(
"This fails with a 'library not registered' error. Need to figure out how to "
"register TestComServerLib (without admin if possible)."
)
def test_UDT(self):
from comtypes.gen.TestComServerLib import MYCOLOR

t = _midlSAFEARRAY(MYCOLOR)
self.assertTrue(t is _midlSAFEARRAY(MYCOLOR))

sa = t.from_param([MYCOLOR(0, 0, 0), MYCOLOR(1, 2, 3)])

self.assertEqual(
[(x.red, x.green, x.blue) for x in sa[0]],
[(0.0, 0.0, 0.0), (1.0, 2.0, 3.0)],
)

def doit():
t.from_param([MYCOLOR(0, 0, 0), MYCOLOR(1, 2, 3)])

bytes = find_memleak(doit)
self.assertFalse(bytes, "Leaks %d bytes" % bytes)


if __name__ == "__main__":
unittest.main()
17 changes: 0 additions & 17 deletions comtypes/test/test_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,6 @@ def test_empty_BSTR(self):
v.value = ""
self.assertEqual(v.vt, VT_BSTR)

@unittest.skip(
"Fails on creating `TestComServerLib.TestComServer`. Library not registered."
)
def test_UDT(self):
from comtypes.gen.TestComServerLib import MYCOLOR

v = VARIANT(MYCOLOR(red=1.0, green=2.0, blue=3.0))
value = v.value
self.assertEqual((1.0, 2.0, 3.0), (value.red, value.green, value.blue))

def func():
v = VARIANT(MYCOLOR(red=1.0, green=2.0, blue=3.0))
return v.value

bytes = find_memleak(func)
self.assertFalse(bytes, "Leaks %d bytes" % bytes)

def test_ctypes_in_variant(self):
v = VARIANT()
objs = [
Expand Down

0 comments on commit 88959c8

Please sign in to comment.