MORSECorp / snappiershot

Apache License 2.0
30 stars 2 forks source link

[BUG] Upgrading to pytest 7.1.2 breaks plugin #106

Open tahoeschrader opened 2 years ago

tahoeschrader commented 2 years ago

name: Upgrading to pytest 7.1.2 breaks plugin about: Create a report to help us improve title: "[BUG] Upgrading to pytest 7.1.2 breaks plugin" labels: bug assignees:

Describe the bug

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/_pytest/main.py", line 264, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 995, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/snappiershot/plugins/pytest.py", line 71, in pytest_configure
INTERNALERROR>     setattr(config.option, PACKAGE_TRACKER_OPTION, SnapshotTracker(*test_paths))
INTERNALERROR>   File "<repo-path>/.venv/lib/python3.10/site-packages/snappiershot/plugins/pytest.py", line 60, in <genexpr>
INTERNALERROR>     test_paths = (Path(path).resolve().relative_to(root_dir) for path in config.args)
INTERNALERROR>   File "<user>/.pyenv/versions/3.10.0/lib/python3.10/pathlib.py", line 816, in relative_to
INTERNALERROR>     raise ValueError("{!r} is not in the subpath of {!r}"
INTERNALERROR> ValueError: '<repo-path>' is not in the subpath of '<repo-path>/testing_framework' OR one path is relative and the other is absolute.

To Reproduce change pytest in pyproject.toml to pytest = "^7.1.2". run any test.

Expected behavior Not error out, which is what happens with pytest 6.2.5

Screenshots N/A

Versions:

Additional context N/A