Skip to content

Commit 8d251fc

Browse files
committed
tests: Fix failing tests and tests setup
1 parent 65de972 commit 8d251fc

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

packages/griffecli/tests/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/griffelib/tests/test_finder.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_find_pkg_style_namespace_packages(statement: str) -> None:
7373
assert package.path == [tmp_package1.path.parent, tmp_package2.path.parent]
7474

7575

76+
@pytest.mark.skipif(not Path("packages").exists(), reason="not running from monorepo root")
7677
def test_pth_file_handling(tmp_path: Path) -> None:
7778
"""Assert .pth files are correctly handled.
7879
@@ -88,15 +89,16 @@ def test_pth_file_handling(tmp_path: Path) -> None:
8889
import thing
8990
import\tthing
9091
/doesnotexist
91-
tests
92+
packages/griffelib/tests
9293
""",
9394
),
9495
encoding="utf8",
9596
)
9697
paths = [sp.path for sp in _handle_pth_file(pth_file)]
97-
assert paths == [Path("tests")]
98+
assert paths == [Path("packages/griffelib/tests")]
9899

99100

101+
@pytest.mark.skipif(not Path("packages").exists(), reason="not running from monorepo root")
100102
def test_pth_file_handling_with_semi_colon(tmp_path: Path) -> None:
101103
"""Assert .pth files are correctly handled.
102104
@@ -108,13 +110,13 @@ def test_pth_file_handling_with_semi_colon(tmp_path: Path) -> None:
108110
dedent(
109111
"""
110112
# comment
111-
import thing; import\tthing; /doesnotexist; tests
113+
import thing; import\tthing; /doesnotexist; packages/griffelib/tests
112114
""",
113115
),
114116
encoding="utf8",
115117
)
116118
paths = [sp.path for sp in _handle_pth_file(pth_file)]
117-
assert paths == [Path("tests")]
119+
assert paths == [Path("packages/griffelib/tests")]
118120

119121

120122
@pytest.mark.parametrize("editable_file_name", ["__editables_whatever.py", "_editable_impl_whatever.py"])
@@ -182,7 +184,7 @@ def test_scikit_build_core_file_handling(tmp_path: Path) -> None:
182184
assert paths == [Path("/path/to/whatever")]
183185

184186

185-
@pytest.mark.skipif(not Path("packages", "griffelib").exists(), reason="not running from monorepo root")
187+
@pytest.mark.skipif(not Path("packages").exists(), reason="not running from monorepo root")
186188
def test_meson_python_file_handling(tmp_path: Path) -> None:
187189
"""Assert editable modules by `meson-python` are handled.
188190

0 commit comments

Comments
 (0)