Skip to content

Commit db8a01a

Browse files
committed
Make readable test names play nicely with neotest
Pytest uses :: as a delimiter in tests and apparently the neotest plugin relies on this for _stuff_.
1 parent 29a8002 commit db8a01a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
sys.path.append(f"{Path(__file__).parent.parent}/src")
1717

18+
READABLE_TEST_OUTPUT = not any("neotest" in arg for arg in sys.argv)
19+
1820

1921
def pytest_html_report_title(report):
2022
report.title = "Rubie Gateway Tests"
@@ -49,7 +51,7 @@ def pytest_runtest_makereport(item, call):
4951
report = outcome.get_result()
5052

5153
readable_name = _readable_test_name(item)
52-
if readable_name:
54+
if readable_name and READABLE_TEST_OUTPUT:
5355
report.nodeid = readable_name
5456

5557

0 commit comments

Comments
 (0)