1. Dev compatible with windows path

2. add @pytest.mark.skip
This commit is contained in:
mannaandpoem 2024-02-02 14:59:16 +08:00
parent ec97645eb4
commit dcb0623d46
2 changed files with 8 additions and 3 deletions

View file

@ -96,7 +96,8 @@ class DependencyFile:
key = Path(filename).relative_to(root)
except ValueError:
key = filename
return set(self._dependencies.get(str(key), {}))
key = re.sub(r"\\+", "/", str(key))
return set(self._dependencies.get(key, {}))
def delete_file(self):
"""Delete the dependency file."""

View file

@ -45,6 +45,7 @@ PROJECT_NAMES = [
]
@pytest.mark.skip
def test_simple_add_calculator():
result = get_incremental_dev_result(IDEAS[0], PROJECT_NAMES[0])
log_and_check_result(result)
@ -115,8 +116,11 @@ def get_incremental_dev_result(idea, project_name, use_review=True):
if not project_path.exists():
# If the project does not exist, extract the project file
try:
# Use the tar command to extract the .zip file
subprocess.run(["tar", "-xf", f"{project_path}.zip", "-C", str(project_path.parent)], check=True)
if os.name == "nt":
subprocess.run(["tar", "-xf", f"{project_path}.zip", "-C", str(project_path.parent)], check=True)
else:
subprocess.run(["unzip", f"{project_path}.zip", "-d", str(project_path.parent)], check=True)
logger.info(f"Extracted project {project_name} successfully.")
except subprocess.CalledProcessError as e:
# If the extraction fails, throw an exception
raise Exception(f"Failed to extract project {project_name}. Error: {e}")