Update syntax for ObjC constraint API usage to avoid long lines. #2682
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the fix for beeware/rubicon-objc#148 being introduced in Rubicon 0.4.9, we can now remove the unwieldy long lines when creating NSLayoutConstraint objects.
This was fixed in the process of trying to narrow down an intermittent segfault I was seeing in the testing for #2666. The underlying fix for that issue is included here (a window cleanup autouse fixture, with explicit GC passes in the app and window cleanup fixtures). That segfault was caused by garbage collection of NSWindow (and related) objects in the pytest thread; we previously added a GC pass in the Window tests to allow for this class of issue, but we've recently added app tests that also create windows; and the main window is also (sometimes) prone to this issue.
Updating the constraint syntax is mostly incidental to the test stability fix - but I spent a lot of time poking around constraints, so I did some housekeeping while I was in the area.
This also corrects an edge case around testbed startup that I've now seen a couple of times on iOS. If the pytest thread starts quickly, the main window may not have been assigned yet, resulting in an exception being raised in testbed startup.
PR Checklist: