Skip to content

Commit 29d4ba4

Browse files
fix issue with _test filename suffix in pytest testrunner (#745)
Hi, could you please review patch to fix a break with the recent upgrade to pytest 7 in #738 in the circle CI coverage test. Fixes #740. The `_test` suffix was not preperly identified as a basilisp test suffix, and was failing the coverage tests for `stacktrace_test.lpy`, which was not following the same pattern as of the other test files. I've both fixed the testrunner to properly identifying these as before the upgrade, but also renamed the above to `test_stacktrace.lpy` for conformity with the current pattern. Thanks Co-authored-by: ikappaki <[email protected]> Co-authored-by: Chris Rink <[email protected]>
1 parent 65e4b1c commit 29d4ba4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/basilisp/contrib/pytest/testrunner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def pytest_configure(config):
2929
def pytest_collect_file(file_path: Path, path, parent):
3030
"""Primary PyTest hook to identify Basilisp test files."""
3131
if file_path.suffix == ".lpy":
32-
if file_path.name.startswith("test_") or file_path.name.endswith("_test"):
32+
if file_path.name.startswith("test_") or file_path.stem.endswith("_test"):
3333
return BasilispFile.from_parent(parent, fspath=path, path=file_path)
3434
return None
3535

tests/basilisp/stacktrace_test.lpy renamed to tests/basilisp/test_stacktrace.lpy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(ns tests.basilisp.stacktrace-test
1+
(ns tests.basilisp.test-stacktrace
22
(:require [basilisp.stacktrace :as s]
33
[basilisp.string :as str]
44
[basilisp.test :refer [deftest are is testing]]))

0 commit comments

Comments
 (0)