Skip to content

Commit

Permalink
pytest==8.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
manics committed Mar 3, 2024
1 parent 0b77ddf commit 77c6dfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build==1.0.3
jupyter-repo2docker==2023.6.0
pytest==7.4.4
pytest==8.0.2
pre-commit==3.6.2
23 changes: 11 additions & 12 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
CONTAINER_ENGINE = os.getenv("CONTAINER_ENGINE")


def pytest_collect_file(parent, path):
if path.basename == "verify":
return LocalRepo.from_parent(parent, fspath=path)
# elif path.basename.endswith(".repos.yaml"):
# return RemoteRepoList(path, parent)
def pytest_collect_file(parent, file_path):
if file_path.name == "verify":
return LocalRepo.from_parent(parent, path=file_path)
# elif file_path.name.endswith(".repos.yaml"):
# return RemoteRepoList.from_parent(parent, path=file_path)


def make_test_func(args):
Expand Down Expand Up @@ -82,7 +82,7 @@ def __init__(self, name, parent, args):
super().__init__(name, parent, callobj=f)

def reportinfo(self):
return self.parent.fspath, None, ""
return self.parent.path, None, ""

def repr_failure(self, excinfo):
err = excinfo.value
Expand All @@ -108,15 +108,14 @@ def collect(self):
args.append(f"--PodmanEngine.podman_executable={CONTAINER_ENGINE}")
# If there's an extra-args.yaml file in a test dir, assume it contains
# a yaml list with extra arguments to be passed to repo2docker
extra_args_path = os.path.join(self.fspath.dirname, "extra-args.yaml")
if os.path.exists(extra_args_path):
with open(extra_args_path) as f:
extra_args = yaml.safe_load(f)
extra_args_path = self.path.parent / "test-extra-args.yaml"
if extra_args_path.exists():
extra_args = yaml.safe_load(extra_args_path.read_text())
args += extra_args

args.append(self.fspath.dirname)
args.append(str(self.path.parent))

yield Repo2DockerTest.from_parent(self, name="build", args=args)
yield Repo2DockerTest.from_parent(
self, name=self.fspath.basename, args=args + ["./verify"]
self, name=self.path.name, args=args + ["./verify"]
)

0 comments on commit 77c6dfc

Please sign in to comment.