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

Better error message when test is annotated with wrong ID #207

Open
NickVolynkin opened this issue May 23, 2024 · 0 comments
Open

Better error message when test is annotated with wrong ID #207

NickVolynkin opened this issue May 23, 2024 · 0 comments
Labels
enhancement New feature or request pytest

Comments

@NickVolynkin
Copy link
Contributor

NickVolynkin commented May 23, 2024

When a test has qase.id() with an ID that doesn't exist in a repository:

@qase.id(42)
def test_example():
    pass

running the tests produces a confusing error message:

$ pytest

[Qase] TestOps: created test run https://app.qase.io/run/DEMO/dashboard/10
============================= test session starts ==============================
collecting ... collected 1 item

example_test.py::TestExample::test_example 
[Qase] Sending a result to test run 10...
[Qase] ⚠️  Error at sending results for run 10: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Date': 'Thu, 23 May 2024 12:28:22 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, private', 'X-RateLimit-Limit': '1500', 'X-RateLimit-Remaining': '1497', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'})
HTTP response body: {"status":false,"errorMessage":"Test case not found"}

Instead, it should be something like


[Qase] Sending a result to test run 10...
[Qase] ⚠️  Error at sending results for run 10: (404)

Reason: Case with ID 42 not found in DEMO repository (from test example_test.py::TestExample::test_example)

Reason: example_test.py::TestExample::[email protected](42) not found in https://app.qase.io/project/DEMO
@NickVolynkin NickVolynkin added enhancement New feature or request pytest labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pytest
Projects
None yet
Development

No branches or pull requests

1 participant