mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
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:
parent
9ce621a02d
commit
f579b5f304
1 changed files with 6 additions and 0 deletions
|
|
@ -18,6 +18,12 @@ import UM.Settings.ContainerStack #Setting the container registry here properly.
|
||||||
def container_registry():
|
def container_registry():
|
||||||
return CuraContainerRegistry()
|
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.
|
## Tests whether loading gives objects of the correct type.
|
||||||
@pytest.mark.parametrize("filename, output_class", [
|
@pytest.mark.parametrize("filename, output_class", [
|
||||||
("ExtruderLegacy.stack.cfg", ExtruderStack),
|
("ExtruderLegacy.stack.cfg", ExtruderStack),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue