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

Replace deprecated code #69

Merged
merged 3 commits into from
Apr 27, 2023
Merged

Replace deprecated code #69

merged 3 commits into from
Apr 27, 2023

Conversation

eerovaher
Copy link
Member

The first commit replaces a method call that is deprecated since Python 3.10 and fixes #68. The second commit configures pytest to convert uncaught warnings to errors, which would have revealed the deprecation earlier.

`threading.Thread.setDaemon()` method is deprecated since Python 3.10.
The recommended solution is setting the `threading.Thread.daemon`
attribute directly, and that works for all versions of Python supported
by this plugin.
@eerovaher eerovaher added this to the v0.4.0 milestone Apr 27, 2023
@pllim
Copy link
Member

pllim commented Apr 27, 2023

There is ResourceWarning: unclosed <socket.socket in a few jobsbut I don't see them inmain` (e.g., https://github.com/astropy/pytest-remotedata/actions/runs/4776300946/jobs/8491233375). Do you have to now close the socket manually or something?

Now that `pytest` is configured to treat uncaught warnings as exceptions
not closing a server used in a test caused the test suite to fail with a
`ResourceWarning`.
@eerovaher
Copy link
Member Author

I needed to add a third commit with cleanup code to make all the tests pass.

Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks!

@pllim pllim merged commit e9e138f into astropy:main Apr 27, 2023
@eerovaher eerovaher deleted the server-daemon branch April 27, 2023 20:31
@eerovaher eerovaher removed this from the v0.4.0 milestone Apr 27, 2023
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.

DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead server.setDaemon(True)
2 participants