Path () { IdeaTestExecutionPolicy policy = IdeaTestExecutionPolicy.current(); String testName = policy == null ? null : policy.getPerTestTempDirName(); if (testName == null) { testName = TEMP_DIR_MARKER + TemporaryDirectory.testNameToFileName(getName()); } Path result = TemporaryDirectory.generateTemporaryPath(testName); //noinspection deprecation temporaryDirectory.scheduleDelete(result); FileUtil.resetCanonicalTempPathCache(result.toString()); // no need to use common prefix as for now in any case global temp directory is set for each test temporaryDirectory.init("", result); return result; }