Skip to content

Add full tests + Ruff autofixes#5

Merged
Kalmat merged 17 commits into
masterfrom
Add-full-tests-+-Ruff-autofixes
Jun 24, 2026
Merged

Add full tests + Ruff autofixes#5
Kalmat merged 17 commits into
masterfrom
Add-full-tests-+-Ruff-autofixes

Conversation

@Avasam

@Avasam Avasam commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Added full test suite + Autofixable code modernizations from Ruff
No manual code change.


Also fixed the MacNSBox test harness only printing a vague "AssertionError" on PyObjC failure and hangs indefinitely. Now prints a more useful traceback.

Before (print only, no failure, or hang):

2026-06-24 20:10:50.119 Python[5489:24200] <class 'AssertionError'>:

After (better traceback + actual test failure)

Traceback (most recent call last):
  File "/Users/runner/work/PyWinBox/PyWinBox/tests/test_MacNSBox.py", line 37, in applicationDidFinishLaunching_
    self._runChecks()
  File "/Users/runner/work/PyWinBox/PyWinBox/tests/test_MacNSBox.py", line 75, in _runChecks
    assert myPyBox.bottom == 800
           ^^^^^^^^^^^^^^^^^^^^^
AssertionError

Applied the same test window polling fix as Kalmat/PyWinCtl#100

@Avasam Avasam requested a review from Kalmat June 24, 2026 18:53
@Avasam Avasam mentioned this pull request Jun 24, 2026
@Kalmat Kalmat merged commit 91ebd66 into master Jun 24, 2026
40 checks passed
@Kalmat

Kalmat commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Wow! How did you fix it for macos??? I remember I had some similar issues when running test_pywinctl.py in small screens on macos, so I had to slightly adapt the values when resizing and moving the window (see comments for v0.4 in PyWinCtl's CHANGES.txt file if you are curious).

@Avasam

Avasam commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator Author

I simply dynamically targetted in the test rather than hardcoding a value that's likely too big ^_^ (you can read the in-code comment !)

@Avasam Avasam deleted the Add-full-tests-+-Ruff-autofixes branch June 24, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants