Skip to content

Introduce foundation for unit tests (pytest + Zuul CI)#2193

Open
berendt wants to merge 1 commit intomainfrom
gh2192
Open

Introduce foundation for unit tests (pytest + Zuul CI)#2193
berendt wants to merge 1 commit intomainfrom
gh2192

Conversation

@berendt
Copy link
Copy Markdown
Member

@berendt berendt commented Apr 24, 2026

Set up the minimal infrastructure so unit tests can be added in follow-up issues. Covers #2192.

  • Add [dev-packages] in Pipfile: pytest, pytest-cov, pytest-mock
  • Create tests/ layout with a smoke test asserting osism is importable and exposes version
  • Configure pytest via [tool:pytest] in setup.cfg
  • Add playbooks/test-unit.yml and a new python-osism-unit-tests Zuul job wired into the check and periodic-daily pipelines; the existing python-osism-test-setup job is kept in parallel (replace decision left to review per the issue)
  • Document local test execution in README.md

Closes #2192

AI-assisted: Claude Code

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tests/unit/test_smoke.py" line_range="10-11" />
<code_context>
+    assert osism is not None
+
+
+def test_package_has_version_attribute():
+    assert hasattr(osism, "__version__")
</code_context>
<issue_to_address>
**suggestion (testing):** Extend the version smoke test to validate the value of `__version__`, not only its presence.

`hasattr(osism, "__version__")` would still pass if `__version__` were `None` or an unexpected type. To make the test more robust, also assert that it is a non-empty string, for example:

```python
assert isinstance(osism.__version__, str)
assert osism.__version__
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread tests/unit/test_smoke.py
Set up the minimal infrastructure so unit tests can be added in
follow-up issues. Covers #2192.

- Add [dev-packages] in Pipfile: pytest, pytest-cov, pytest-mock
- Create tests/ layout with a smoke test asserting osism is importable
  and exposes __version__
- Configure pytest via [tool:pytest] in setup.cfg
- Add playbooks/test-unit.yml and a new python-osism-unit-tests Zuul
  job wired into the check and periodic-daily pipelines; the existing
  python-osism-test-setup job is kept in parallel (replace decision
  left to review per the issue)
- Document local test execution in README.md

Closes #2192

AI-assisted: Claude Code

Signed-off-by: Christian Berendt <berendt@osism.tech>
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.

Introduce foundation for unit tests (pytest + Zuul CI integration)

1 participant