Skip to content

suppress pytest rewrite assertion warning #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Optimised mainstream seq-consuming functions by coercing their inputs into `seq` upfront (#1234)
* Renamed `awith` and `afor` to `with-async` and `for-async` for improved clarity (#1248)
* `basilisp.main.init` will only initialize the runtime environment on the first invocation (#1242)
* Suppress pytest assertion rewrite warning for basilisp when running `basilisp test` (#1252)

### Fixed
* Fix a bug where protocols with methods with leading hyphens in the could not be defined (#1230)
Expand Down
9 changes: 9 additions & 0 deletions src/basilisp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,15 @@ def test(
"Cannot run tests without dependency PyTest. Please install PyTest and try again.",
)
else:
# `basilisp` declares the testrunner as a pytest plugin, so
# pytest tries to import it for assertion rewriting. Since
# it's already imported, pytest emits a warning. As rewriting
# isn't needed, we ignore it.
extra = [
"-W",
"ignore:Module already imported so cannot be rewritten:pytest.PytestAssertRewriteWarning",
] + extra

sys.exit(pytest.main(args=list(extra)))


Expand Down
Loading