-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ResourceWarnings from tests (#123)
The open().read() calls were causing ResourceWarnings because the file was never explicitly closed, and are now replaced with a context managed open() call. In the case of the popens the reading from the stdout member had the same issue, so I'm replacing the stdout.read() + wait() with communicate() (which internally exhausts stdout and waits) + returncode. All in all, this takes the warning count when running all tests from 45 down to 11, all of which are PytestUnraisableExceptionWarnings. Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
- Loading branch information
Showing
3 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters