Skip to content

Reuse obsah_params fixture to read parameters - #719

Merged
arvind4501 merged 1 commit into
theforeman:masterfrom
ekohl:reuse-parameters
Aug 3, 2026
Merged

Reuse obsah_params fixture to read parameters#719
arvind4501 merged 1 commit into
theforeman:masterfrom
ekohl:reuse-parameters

Conversation

@ekohl

@ekohl ekohl commented Aug 3, 2026

Copy link
Copy Markdown
Member

Why are you introducing these changes? (Problem description, related links)

While working on #511 I wanted to move the file to a new location. It broke due to deriving the parameters location from the test filename.

What are the changes introduced in this pull request?

  • Reuse obsah_params fixture that's already defined to avoid duplicating logic

How to test this pull request

Steps to reproduce:

  • Run the test suite
  • Verify it passes

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

@arvind4501

Copy link
Copy Markdown
Contributor

I think then

@pytest.fixture(scope="module")
def obsah_state_path():
return os.environ.get("OBSAH_STATE", "/var/lib/foremanctl")
should also be using shared fixture

@ekohl

ekohl commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

I looked at that, but the test asserts that the file exists. There's a subtle on paths difference. Compare:

OBSAH_STATE = os.environ.get('OBSAH_STATE', '.var/lib/foremanctl')

return os.environ.get("OBSAH_STATE", "/var/lib/foremanctl")

I didn't want to untangle that too and for now only focus on reducing the size of #511.

@arvind4501

Copy link
Copy Markdown
Contributor

Sorry i did not catch that .var/* and /var* earlier, and that make sense, thank you :)

@ekohl

ekohl commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

I must admit I didn't either until you asked me to look at it again. Only then I spotted it.

@arvind4501
arvind4501 merged commit 9ff60b3 into theforeman:master Aug 3, 2026
16 checks passed
@ekohl
ekohl deleted the reuse-parameters branch August 3, 2026 16:00
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