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

pytest warning fixes #2103

Merged
merged 3 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,8 @@ ignore = [

[tool.ruff.per-file-ignores]
"tmt/steps/report/polarion.py" = ["DTZ005"]

[tool.pytest.ini_options]
markers = [
"web: tests which need to access the web"
]
3 changes: 0 additions & 3 deletions tests/unit/pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def create_last_run(config, counter):
def test_workdir_env_var(tmpdir, monkeypatch, root_logger):
""" Test TMT_WORKDIR_ROOT environment variable """
# Cannot use monkeypatch.context() as it is not present for CentOS Stream 8
monkeypatch.setenv('TMT_WORKDIR_ROOT', tmpdir)
monkeypatch.setenv('TMT_WORKDIR_ROOT', str(tmpdir))
common = Common(logger=root_logger)
common._workdir_init()
monkeypatch.delenv('TMT_WORKDIR_ROOT')
Expand Down
8 changes: 7 additions & 1 deletion tmt/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ def _explore_entry_point(entry_point: str, logger: Logger) -> None:
logger = logger.descend()

try:
for found in entry_points()[entry_point]:
eps = entry_points()
if hasattr(eps, "select"):
entry_point_group = eps.select(group=entry_point)
else:
entry_point_group = eps[entry_point]

for found in entry_point_group:
logger.debug(f"Loading plugin '{found.name}' ({found.value}).")
found.load()

Expand Down