You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now there are several places (and one more on the way) where we repeat this block of code:
# This auto-used fixture changes the working directory to the temporary directory# and then changes back to the original directory after the test is done.@pytest.fixture(autouse=True)defchange_to_tmp_dir(self, tmp_path):
original_dir=os.getcwd()
os.chdir(tmp_path)
# Yielding here is important. It means that when the test is done, the remainder# of the function will be executed. This is important because the test is run in# a temporary directory and we want to change back to the original directory# when the test is done.yieldos.chdir(original_dir)
We should move this to conftest.py (but will need to take out the autouse=True maybe). In places we are currently using it with autouse=True we will to keep a small fixture in place to specify the autouse=True part.
If we take out the autouse thing in conftest then using the fixture would look like this (I think this is untested):
Right now there are several places (and one more on the way) where we repeat this block of code:
We should move this to
conftest.py
(but will need to take out theautouse=True
maybe). In places we are currently using it withautouse=True
we will to keep a small fixture in place to specify theautouse=True
part.If we take out the
autouse
thing in conftest then using the fixture would look like this (I think this is untested):The text was updated successfully, but these errors were encountered: