Skip to content

Commit 4c4668c

Browse files
committed
suppress pytest rewrite assertion warning
1 parent a35d85f commit 4c4668c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
* Suppress pytest assertion rewrite warning for basilisp when running `basilisp test` (#1252)
10+
911
## [v0.4.0]
1012
### Added
1113
* Added support for referring imported Python names as by `from ... import ...` (#1154)

src/basilisp/cli.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,15 @@ def test(
745745
"Cannot run tests without dependency PyTest. Please install PyTest and try again.",
746746
)
747747
else:
748+
# `basilisp` declares the testrunner as a pytest plugin, so
749+
# pytest tries to import it for assertion rewriting. Since
750+
# it's already imported, pytest emits a warning. As rewriting
751+
# isn't needed, we ignore it.
752+
extra = [
753+
"-W",
754+
"ignore:Module already imported so cannot be rewritten:pytest.PytestAssertRewriteWarning",
755+
] + extra
756+
748757
sys.exit(pytest.main(args=list(extra)))
749758

750759

0 commit comments

Comments
 (0)