mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
ty: detect unresolved references
This commit is contained in:
@@ -26,6 +26,8 @@ def test_file_gc(args):
|
||||
inst = f.createIfcPerson()
|
||||
elif api in (1, 2):
|
||||
inst = f.createIfcSite()
|
||||
else:
|
||||
assert False, api
|
||||
|
||||
r = weakref.ref(f)
|
||||
|
||||
@@ -68,9 +70,9 @@ def test_file_gc(args):
|
||||
assert r()
|
||||
|
||||
if not file_first:
|
||||
del f
|
||||
del f # ty: ignore[possibly-unresolved-reference]
|
||||
else:
|
||||
del inst
|
||||
del inst # ty: ignore[possibly-unresolved-reference]
|
||||
|
||||
# With both deleted we should have no longer access to the file.
|
||||
assert r() is None
|
||||
|
||||
Reference in New Issue
Block a user