GitHub Actions / Test Report 3.12
failed
Dec 18, 2024 in 0s
34 tests run, 31 passed, 2 skipped, 1 failed.
Annotations
Check failure on line 455 in tests/embedding/test_app.py
github-actions / Test Report 3.12
test_app.test_app_lock_file_open
AssertionError: assert not True
+ where True = exists()
+ where exists = PosixPath('/tmp/tmp892u0uku_Mech_Files/.mech_lock').exists
Raw output
embedded_app = Ansys Mechanical [Ansys Mechanical Enterprise]
Product Version:242
Software build date: 06/03/2024 09:35:09
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_app_lock_file_open0')
@pytest.mark.embedding
def test_app_lock_file_open(embedded_app, tmp_path: pytest.TempPathFactory):
"""Test the lock file is removed on open if remove_lock=True."""
embedded_app.DataModel.Project.Name = "PROJECT 1"
project_file = os.path.join(tmp_path, f"{NamedTemporaryFile().name}.mechdat")
embedded_app.save_as(project_file)
with pytest.raises(Exception):
embedded_app.save_as(project_file)
embedded_app.save_as(project_file, overwrite=True)
lock_file = Path(embedded_app.DataModel.Project.ProjectDirectory) / ".mech_lock"
# Do not remove the lock file before opening the project file
embedded_app.open(project_file)
# Assert the lock file exists after opening it
assert lock_file.exists()
with pytest.warns(UserWarning):
# Remove the lock file before opening the project file
embedded_app.open(project_file, remove_lock=True)
# Assert the lock file has been removed
> assert not lock_file.exists()
E AssertionError: assert not True
E + where True = exists()
E + where exists = PosixPath('/tmp/tmp892u0uku_Mech_Files/.mech_lock').exists
tests/embedding/test_app.py:455: AssertionError
Loading