Skip to content
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

Propagate known pytest failure/skip reasons to pytest summary #865

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def typecheck(session: nox.Session) -> None:
def tests(session: nox.Session) -> None:
"""Run the unit tests."""
session.install("--editable", ".[test]")
session.run("pytest", "tests/unit", *session.posargs)
session.run("pytest", "tests/unit", "-rxXs", *session.posargs)


@nox.session(name="integration-tests")
Expand Down
2 changes: 1 addition & 1 deletion scripts/integration-test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

set -x
pytest tests/integration --cov=earthaccess --cov-report=term-missing "${@}" --capture=no --tb=native --log-cli-level=INFO
pytest tests/integration -rxXs --cov=earthaccess --cov-report=term-missing "${@}" --capture=no --tb=native --log-cli-level=INFO
RET=$?
set +x

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_store_can_create_s3_fsspec_session(self):


@pytest.mark.xfail(
reason="This test reproduces a bug (#610) which has not yet been fixed."
reason="Expected failure: Reproduces a bug (#610) that has not yet been fixed."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how I feel about including the status in the reason string, but don't feel strongly enough to request anything. If it's helping someone, it's helping someone!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this because xfail, xfailed and XFAIL require you to know Pytest well enough to interpret them as "expected failure". As soon as you know that, the x = expected makes sense, but if you don't there's nothing really to help you get there.

I think it's a little more general contributor-friendly this way, but I'm fine leaving this as a "Google it" thing if you don't understand.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good enough reason for me ;)

)
def test_earthaccess_file_getattr():
fs = fsspec.filesystem("memory")
Expand Down
Loading