forked from XLSForm/pyxform
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: fix ResourceWarning during tests, broken test, string formatting
- xls2json_backends.py: both XLS and XLSX open and read the respective files, do processing, then close the file. But if an error occurs during processing then the file is left open. A ResourceWarning is raised when python cleans up the file handle. The ResourceWarning is visible during tests because test libraries remove the normal suppression of warnings during test runs. So normally a user probably wouldn't see it. The fix is to make sure the workbook object and file are cleaned up and closed with a contextmanager + try-except block. - test_bugs.py: fixed test that had been broken for a while. It was not being executed by nose test runner for some reason. After converting tests to unittest, it ran and failed. After doing some git archaeology it seems that the 3rd warning that was expected was one about Google Sheets not supporting certain file names, but while that warning was later removed, the test was not updated. The 2nd is commented on. - fixed strange string concatentation on the same line e.g. "a" "b".
- Loading branch information
1 parent
f491ea8
commit 4c5ee0a
Showing
4 changed files
with
100 additions
and
69 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
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