Skip to content

Commit

Permalink
Fix test failures in pyobjc-core when Quartz bindings are not installed
Browse files Browse the repository at this point in the history
Fixes #559
  • Loading branch information
ronaldoussoren committed Jun 10, 2023
1 parent ecc8eae commit e9ee0a3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ Version 10.0
bundle identifier values. This shouldn't affect user code because the
bundle loader falls back on the framework path when the identifier cannot be found.

* :issue:`559`: Avoid test failures in pyobjc-core when pyobjc-framework-Quartz is
not installed.

Version 9.2
-----------

Expand Down
26 changes: 25 additions & 1 deletion pyobjc-core/PyObjCTest/test_vectorcall.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
try:
import Quartz # noqa: F401
except ImportError:
pass
Quartz = None

from .vectorcall import OC_VectorCall, OC_VectorCallInvoke

Expand Down Expand Up @@ -23319,6 +23319,7 @@ def test_imp_idid_matrixfloat4x4__cls(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_idCGColor_CGColor_id_v2i_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -23379,6 +23380,7 @@ def test_idCGColor_CGColor_id_v2i_(self):
with self.assertRaisesRegex(objc.error, "SimpleException"):
caller("color!", "color!", "hello", objc.simd.vector_int2(0, 1))

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsidCGColor_CGColor_id_v2i_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -23439,6 +23441,7 @@ def test_clsidCGColor_CGColor_id_v2i_(self):
with self.assertRaisesRegex(objc.error, "SimpleException"):
caller("color!", "color!", "hello", objc.simd.vector_int2(0, 1))

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_idCGColor_CGColor_id_v2i__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -23514,6 +23517,7 @@ def test_idCGColor_CGColor_id_v2i__imp(self):
objc.simd.vector_int2(0, 1),
)

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsidCGColor_CGColor_id_v2i__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -23582,6 +23586,7 @@ def test_clsidCGColor_CGColor_id_v2i__imp(self):
):
imp(42, "color!", "color!", "hello", objc.simd.vector_int2(0, 1))

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_idCGColor_CGColor_id_v2i_(self):
value = OC_VectorCallInstance.alloc().init()
value.argvalues = 1
Expand All @@ -23605,6 +23610,7 @@ def test_imp_idCGColor_CGColor_id_v2i_(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_idCGColor_CGColor_id_v2i__cls(self):
value = OC_VectorCallClass
value.argvalues = 1
Expand Down Expand Up @@ -26553,6 +26559,7 @@ def test_imp_idf_id_v2i_i_q_Z__cls(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_idf_id_v2i_i_q_CGColor_CGColor_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -26710,6 +26717,7 @@ def test_idf_id_v2i_i_q_CGColor_CGColor_(self):
"color!",
)

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsidf_id_v2i_i_q_CGColor_CGColor_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -26869,6 +26877,7 @@ def test_clsidf_id_v2i_i_q_CGColor_CGColor_(self):
"color!",
)

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_idf_id_v2i_i_q_CGColor_CGColor__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -27053,6 +27062,7 @@ def test_idf_id_v2i_i_q_CGColor_CGColor__imp(self):
"color!",
)

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsidf_id_v2i_i_q_CGColor_CGColor__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -27229,6 +27239,7 @@ def test_clsidf_id_v2i_i_q_CGColor_CGColor__imp(self):
"color!",
)

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_idf_id_v2i_i_q_CGColor_CGColor_(self):
value = OC_VectorCallInstance.alloc().init()
value.argvalues = 1
Expand All @@ -27255,6 +27266,7 @@ def test_imp_idf_id_v2i_i_q_CGColor_CGColor_(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_idf_id_v2i_i_q_CGColor_CGColor__cls(self):
value = OC_VectorCallClass
value.argvalues = 1
Expand Down Expand Up @@ -32084,6 +32096,7 @@ def test_imp_Zv4i_Z_Z_Z_Z__cls(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_CGColorv3f_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32125,6 +32138,7 @@ def test_CGColorv3f_(self):
with self.assertRaisesRegex(objc.error, "SimpleException"):
caller(objc.simd.vector_float3(0.0, 1.5, 3.0))

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsCGColorv3f_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32166,6 +32180,7 @@ def test_clsCGColorv3f_(self):
with self.assertRaisesRegex(objc.error, "SimpleException"):
caller(objc.simd.vector_float3(0.0, 1.5, 3.0))

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_CGColorv3f__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32216,6 +32231,7 @@ def test_CGColorv3f__imp(self):
with self.assertRaisesRegex(TypeError, "Cannot proxy"):
imp(NoObjCValueObject, objc.simd.vector_float3(0.0, 1.5, 3.0))

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsCGColorv3f__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32265,6 +32281,7 @@ def test_clsCGColorv3f__imp(self):
):
imp(42, objc.simd.vector_float3(0.0, 1.5, 3.0))

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_CGColorv3f_(self):
value = OC_VectorCallInstance.alloc().init()
value.argvalues = 1
Expand All @@ -32280,6 +32297,7 @@ def test_imp_CGColorv3f_(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_CGColorv3f__cls(self):
value = OC_VectorCallClass
value.argvalues = 1
Expand All @@ -32295,6 +32313,7 @@ def test_imp_CGColorv3f__cls(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_CGColorv3f_CGColorSpace_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32343,6 +32362,7 @@ def test_CGColorv3f_CGColorSpace_(self):
with self.assertRaisesRegex(objc.error, "SimpleException"):
caller(objc.simd.vector_float3(0.0, 1.5, 3.0), "colorspace!")

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsCGColorv3f_CGColorSpace_(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32393,6 +32413,7 @@ def test_clsCGColorv3f_CGColorSpace_(self):
with self.assertRaisesRegex(objc.error, "SimpleException"):
caller(objc.simd.vector_float3(0.0, 1.5, 3.0), "colorspace!")

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_CGColorv3f_CGColorSpace__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32452,6 +32473,7 @@ def test_CGColorv3f_CGColorSpace__imp(self):
NoObjCValueObject, objc.simd.vector_float3(0.0, 1.5, 3.0), "colorspace!"
)

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_clsCGColorv3f_CGColorSpace__imp(self):
OC_VectorCall.clearRaise()
# Verify method type
Expand Down Expand Up @@ -32510,6 +32532,7 @@ def test_clsCGColorv3f_CGColorSpace__imp(self):
):
imp(42, objc.simd.vector_float3(0.0, 1.5, 3.0), "colorspace!")

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_CGColorv3f_CGColorSpace_(self):
value = OC_VectorCallInstance.alloc().init()
value.argvalues = 1
Expand All @@ -32531,6 +32554,7 @@ def test_imp_CGColorv3f_CGColorSpace_(self):
finally:
del value.shouldRaise

@skipUnless(Quartz is not None, "Test requires installed Quartz bindings")
def test_imp_CGColorv3f_CGColorSpace__cls(self):
value = OC_VectorCallClass
value.argvalues = 1
Expand Down

0 comments on commit e9ee0a3

Please sign in to comment.