diff --git a/tests/test_project.py b/tests/test_project.py index 385e7836d..f0694030d 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -2598,7 +2598,9 @@ def operation_info(self, request): ids=None if skip_git else ("git-dirty", "git-clean"), ) def git_repo(self, project, request): - if request.param is None: + # params=None is equivalent to not passing a parameter which results in + # result.param being unset. + if not hasattr(request, "param"): return repo = git.Repo.init(project.path) with open(project.fn("test.txt"), "w"): @@ -2644,7 +2646,15 @@ def check_metadata( repo, ): assert metadata["stage"] == expected_stage - assert job.project.path == metadata["project"]["path"] + # When running on MacOS CI a private/ is prepended to job.project.path + # when querying the path on a fork. Since for local tests to work we + # cannot modify anything, the best we can do is either check for the + # private prefix and remove or check for the stored path being a subset + # of the current path. + test_path = metadata["project"]["path"] + if "private" in test_path: + test_path = os.path.join(test_path.split(os.path.sep)[1:]) + assert job.project.path == test_path assert metadata["project"]["schema_version"] == job.project.config.get( "schema_version" )