8000 Clean up temporary archive directory at exit by vlthr · Pull Request #2184 · allenai/allennlp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Clean up temporary archive directory at exit #2184

Merged
merged 2 commits into from
Dec 14, 2018

Conversation

vlthr
Copy link
Contributor
@vlthr vlthr commented Dec 14, 2018

Fixes the issue described in #2180 using the atexit hook proposed by @joelgrus.

Please let me know if there are any changes you'd like to see made and I'd be happy to make them.

@joelgrus
Copy link
Contributor 8000

thanks, this looks good!

if you don't mind, can you also add a test for this behavior and verify that the test fails before your change and works after your change?

I think it's as simple as just adding one line here:

https://github.com/allenai/allennlp/blob/master/allennlp/tests/models/archival_test.py#L94

that checks whether a file exists at that temporary training data path

@vlthr
Copy link
Contributor Author
vlthr commented Dec 14, 2018

There we go! As you guessed a single line did the trick. I also verified that the test does indeed fail on master.

Copy link
Contributor
@joelgrus joelgrus left a comment

Choose a reason for hiding this comment

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

looks great, thanks for the fix

@joelgrus joelgrus merged commit 89cef2f into allenai:master Dec 14, 2018
@joelgrus
Copy link
Contributor

for future reference (in case anyone looks back at this PR) I wish there was also a test that checked that the deletion really happens "atexit" but I have no idea how to check that in a unit test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0