Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Fix AttributeError in pytest_polarion_collect#10233

Merged
mshriver merged 1 commit intoManageIQ:masterfrom
mshriver:fix-polarion-collect-attributeerror
Jul 8, 2020
Merged

[1LP][RFR] Fix AttributeError in pytest_polarion_collect#10233
mshriver merged 1 commit intoManageIQ:masterfrom
mshriver:fix-polarion-collect-attributeerror

Conversation

@mshriver
Copy link
Member

@mshriver mshriver commented Jul 2, 2020

The method called in the VM fixture to process the polarion docblocks assumes that the session cache attributes have already been set

A call to set_cache will make sure that they actually are created, avoiding an AttributeError during collection

pytest --collect-only --dummy-appliance -m 'requirement.ansible'

<redacted>

INTERNALERROR>   File "/home/setup/repos/integration_tests/cfme/fixtures/vm.py", line 30, in pytest_collection_finish
INTERNALERROR>     process_json_data(session, session.items)
INTERNALERROR>   File "/home/setup/repos/integration_tests/.cfme_venv/lib64/python3.7/site-packages/pytest_polarion_collect/utils.py", line 351, in process_json_data
INTERNALERROR>     if not (all_items or in_test_dir(str(item.fspath), session._test_dirs_cache)):
INTERNALERROR> AttributeError: 'Session' object has no attribute '_test_dirs_cache'

The method called in the VM fixture to process the polarion docblocks assumes that the session cache attributes have already been set

A call to set_cache will make sure that they actually are created, avoiding an AttributeError during collection
@mshriver mshriver requested a review from kedark3 July 2, 2020 16:23
Copy link
Contributor

@jarovo jarovo left a comment

Choose a reason for hiding this comment

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

I did hit this. Thanks for fix.

@jarovo jarovo changed the title [RFR] Fix AttributeError in pytest_polarion_collect [1LP][RFR] Fix AttributeError in pytest_polarion_collect Jul 8, 2020
@mshriver mshriver merged commit e34080b into ManageIQ:master Jul 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants