OpenNTI / nti.contentrendering

Other
0 stars 0 forks source link

bandaid over the fact that the cwd gets changed as part of running tests #46

Closed cutz closed 6 years ago

cutz commented 6 years ago

This PR attempts to work around issue #45 by trapping the current working directory during test setup and then setting it back after each test is torn down.

I'm storing the current working directory on the layer class which doesn't seem quite right to me. It seems like there could be issues doing that. Should I instead be using the optional arg test and find_test to store that information on the test being setup and torn down?

jamadden commented 6 years ago

The layer’s (test) setup and tearDown methods seem reasonable to me. Like I mentioned in #45, I’ve seen stdlib test code doing essentially that. The use of dunders isolates any issues, just like storing on a test ivar would. The only unexpected consequence I can see is a few extra strings in memory after the layer is torn down, and a __del__ could handle that if necessary.

Asssuming this solves the problem, LGTM as a bandaid.