Skip to content

Commit c4e5f9d

Browse files
committed
suppress pytest rewrite assertion warning
1 parent f643d88 commit c4e5f9d

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
@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Removed
1515
* Removed support for Python 3.9 (#1283)
1616

17+
* Suppress pytest assertion rewrite warning for basilisp when running `basilisp test` (#1252)
18+
1719
## [v0.4.0]
1820
### Added
1921
* 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)