Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation and unit tests for printcore #1334

Merged
merged 7 commits into from
Apr 22, 2023

Conversation

rockstorm101
Copy link
Collaborator

At first this PR tries to add more documentation and some unit tests to printrun/printcore.py. As a collateral, the functionality of printrun/printereventhandler.py is also tested.

This testing highlighted some issues with the current printcore.py code which I've tried to address as well on separate commits.

This PR does not break (as far a I know) the current API. However, a thorough review would be more than welcome. I hope the testing logic is not too obfuscated.

This is also a first step in preparation for a printcore code refactoring. I'll submit that once we are happy with this PR.

As always, any comments/suggestions are appreciated and I'll be happy to address them.

Fixes error "AttributeError: 'RuntimeError' object has no attribute
'errno'"
Close socket connection before removing the reference to it. Otherwise
we get warning "ResourceWarning: unclosed <socket.socket [...]>"
meaning that the underlying system resource (e.g. a file descriptor)
remains allocated.
@rockstorm101
Copy link
Collaborator Author

If no one argues against it I will merge this PR along with #1333 next week :)

@volconst
Copy link
Collaborator

@rockstorm101 which AI generated this?

@rockstorm101
Copy link
Collaborator Author

@rockstorm101 which AI generated this?

Hahahaha, I wish I could say it was done by an AI and it only took 5 minutes but I'm afraid it was me who wrote this and it took me ages :P (hence why this might introduce some regression bugs)

@rockstorm101 rockstorm101 merged commit 8a274e1 into kliment:master Apr 22, 2023
@rockstorm101 rockstorm101 deleted the pr-printcore-doctest branch April 22, 2023 08:46
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