From 50bf0b933eaff99f7c52ef2db24831d20d5a3c6a Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Tue, 5 Nov 2024 16:38:38 -0900 Subject: [PATCH] Propagate known pytest failure/skip reasons to pytest summary (#865) Co-authored-by: Matt Fisher <3608264+mfisher87@users.noreply.github.com> --- noxfile.py | 7 ++++++- scripts/integration-test.sh | 2 +- tests/unit/test_store.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/noxfile.py b/noxfile.py index f9d42ba1..badf6bec 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,7 +24,12 @@ 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", # Show provided reason in summary for (x)fail, (X)pass, and (s)kipped statuses + *session.posargs, + ) @nox.session(name="integration-tests") diff --git a/scripts/integration-test.sh b/scripts/integration-test.sh index 1a8ad4f6..457e8469 100755 --- a/scripts/integration-test.sh +++ b/scripts/integration-test.sh @@ -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 diff --git a/tests/unit/test_store.py b/tests/unit/test_store.py index 83ec05d6..f2be362b 100644 --- a/tests/unit/test_store.py +++ b/tests/unit/test_store.py @@ -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." ) def test_earthaccess_file_getattr(): fs = fsspec.filesystem("memory")