ucphhpc / migrid-sync

MiGrid workspace where master branch is kept strictly in sync with SF upstream svn repo. Any development or experiments should use a branch. You probably want to fork your own clone or work e.g. on the edge branch if you wish to contribute.
GNU General Public License v2.0
3 stars 3 forks source link

Arrange mig test cases to throw if any leaked resources are detected. #47

Closed albu-diku closed 1 month ago

albu-diku commented 1 month ago

Integrate resource warnings with the FakeLogger - this involves registering the fake logger as the stream for captured warnings to be delivered to. Add some matching logic for "ResourceWarning: unclosed file ..." exception messages, pull out the line number and output file, and record this stuff. When the tests exits the teardown method checks whether any such records exists and if so throws loudly including these details in a well formatted message that should allow tracking down the cause.

The overarching goal here is so to ensure that any code executed under test cannot leave an open file and get away with it.

jonasbardino commented 1 month ago

manually merged in svn.

albu-diku commented 1 month ago

@jonasbardino relly glad what's here made sense enough that you were able to merge.

Re documentation, very fair point and I have drafted something to address the deficiency I created here with: https://github.com/ucphhpc/migrid-sync/pull/55

Re autopep8, I am a big fan of arranging things such that formatting is a non-issue. Will see if I can reconfigure my editor to autopep8 on save. Am a little surprised though tat my violating style was not causing something to complain, is that due to the manual merges and the commits being reformatted in the process?

jonasbardino commented 1 month ago

Yeah, a minor issue with those style details and when I manually merge and adjust through my usual editor they get autopep8ed and mangled a bit in the process.