def test_clear_nonexistent_file(tmpdir): """ clear should not create a file """ i = Injections("testinjection") new_file = os.path.join(tmpdir.strpath, "dontcreateme") i.clear(new_file) i.commit() assert not os.path.exists(new_file)