Skip to content

Commit

Permalink
[6.12.z] Pytest FixtureCollection external plugin (SatelliteQE#13205)
Browse files Browse the repository at this point in the history
Pytest FixtureCollection external plugin (SatelliteQE#13176)

(cherry picked from commit a9ffccd)

Co-authored-by: Jitendra Yejare <[email protected]>
  • Loading branch information
2 people authored and omkarkhatavkar committed Nov 30, 2023
1 parent 3a668e5 commit 50bcd1f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 42 deletions.
1 change: 0 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
'pytest_plugins.settings_skip',
'pytest_plugins.rerun_rp.rerun_rp',
'pytest_plugins.fspath_plugins',
'pytest_plugins.fixture_collection',
'pytest_plugins.factory_collection',
'pytest_plugins.requirements.update_requirements',
'pytest_plugins.sanity_plugin',
Expand Down
39 changes: 0 additions & 39 deletions pytest_plugins/fixture_collection.py

This file was deleted.

1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pytest-services==2.2.1
pytest-mock==3.12.0
pytest-reportportal==5.3.0
pytest-xdist==3.5.0
pytest-fixturecollection==0.1.1
pytest-ibutsu==2.2.4
PyYAML==6.0.1
requests==2.31.0
Expand Down
10 changes: 8 additions & 2 deletions tests/foreman/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def pytest_collection_modifyitems(session, items, config):
if deselect:
deselected_items.append(item)
reason = deselect.kwargs.get('reason', deselect.args)
collection_logger.debug(f'Deselected test "{item.name}" reason: {reason}')
collection_logger.debug(
f'Deselected test "{item.name}" reason: {reason}')
# Do nothing more with deselected tests
continue

Expand All @@ -57,7 +58,12 @@ def ui_session_record_property(request, record_property):
request: The pytest request object.
record_property: The value to set for the record_property attribute.
"""
test_directories = ['tests/foreman/destructive', 'tests/foreman/ui']
test_directories = [
'tests/foreman/destructive',
'tests/foreman/ui',
'tests/foreman/sanity',
'tests/foreman/virtwho',
]
test_file_path = request.node.fspath.strpath
if any(directory in test_file_path for directory in test_directories):
for fixture in request.node.fixturenames:
Expand Down

0 comments on commit 50bcd1f

Please sign in to comment.