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

Clear identification of test markers in testcase call messages #1

Open
lambiase opened this issue Aug 2, 2022 · 0 comments
Open

Clear identification of test markers in testcase call messages #1

lambiase opened this issue Aug 2, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@lambiase
Copy link
Collaborator

lambiase commented Aug 2, 2022

When running this test with pytest-fluent:

import pytest


@pytest.mark.simple
def test_simple():
    """
    Simple test always passing
    """
    assert True

I would like to be able to identify that simple was used as a marker for test_simple.

pytest-fluent sends a testcase call message containing a markers section.
However, it contains a mix of Python modules, actual markers, test methods in a
dictionary whose values are always 1:

    {
        "testId": "895ef55e-bad3-4a0d-b2f5-a55ce93d239c",
        "sessionId": "ca6c7a99-df62-432d-a187-3ec774adef75",
        "when": "call",
        "stage": "testcase",
        "markers": {
            "pytest-fluent": 1,
            "manual_tests/__init__.py": 1,
            "test_simple.py": 1,
            "pytestmark": 1,
            "simple": 1,
            "test_simple": 1
        },
        "duration": 0.0002015329991991166,
        "outcome": "passed",
        "name": "manual_tests/test_simple.py::test_simple"
    }

I think at the moment markers contains everything that could be matched against when using the pytest keyword parameter (-k) - it probably has this pseudo-dictionary structure for fast read/write operations.
It would probably make sense to have under markers the actual pytest markers (in the example above simple) and remove all the rest. Alternatively, if we believe that the contained information is useful, I would propose to change its structure to a list, and call the property keywords.

@casabre casabre added the enhancement New feature or request label Nov 23, 2022
@lambiase lambiase added this to the Version 0.3.0 milestone Mar 15, 2023
@lambiase lambiase self-assigned this Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants