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

Export JIRA_TEST_IDS as env var #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

grssmnn
Copy link
Contributor

@grssmnn grssmnn commented Jul 18, 2022

Hi,
I needed a simple interface for accessing the provided Jira test IDs in the test methods for logging purposes.
Therefore I added pytest_runtest_setup to the plugin so the test IDs are exported before every test run.

@fundakol
Copy link
Owner

You can achieve same result just from your tests. No need to include this code to the plugin.
I would use a fixture for that instead of keeping ids in an environment variable. It could be implemented like that:

@pytest.fixture
def jira_ids(request):
    markers = request.node.get_closest_marker('xray')
    if isinstance(markers.args[0], list):
        return markers.args[0]
    return [markers.args[0]]

def test_foo(jira_ids):
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants