Clean up temporary files after test

If the test fails to remove the temporary file, this cleans up after it.

Contributes to issue CURA-3497.
This commit is contained in:
Ghostkeeper 2017-03-23 17:22:10 +01:00
parent 9ce621a02d
commit f579b5f304
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -18,6 +18,12 @@ import UM.Settings.ContainerStack #Setting the container registry here properly.
def container_registry():
return CuraContainerRegistry()
def teardown():
#If the temporary file for the legacy file rename test still exists, remove it.
temporary_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "stacks", "temporary.stack.cfg")
if os.path.isfile(temporary_file):
os.remove(temporary_file)
## Tests whether loading gives objects of the correct type.
@pytest.mark.parametrize("filename, output_class", [
("ExtruderLegacy.stack.cfg", ExtruderStack),