Skip to content

Add pytest suite and CI for Python unit tests - #1543

Merged
Saksham-Sirohi merged 10 commits into
fossasia:devfrom
Manik-Khajuria-5:Pytest-Setup
Jul 8, 2026
Merged

Add pytest suite and CI for Python unit tests#1543
Saksham-Sirohi merged 10 commits into
fossasia:devfrom
Manik-Khajuria-5:Pytest-Setup

Conversation

@Manik-Khajuria-5

@Manik-Khajuria-5 Manik-Khajuria-5 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Description

Wires up pytest as a first-class, config-driven test runner for the Python side


Motivation and Context

The repo had no operational Python test setup no pytest config, pytest was not a declared dependency, and no CI ran Python tests (docs even stated "no Python unit tests"). This adds a proper, CI-gated unit-test layer alongside the existing
Cypress E2E/visual tests so backend logic is covered on every PR.


How Has This Been Tested?

Work in Progress
image


Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I adapted the version number under py/visdom/VERSION accord
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @Manik-Khajuria-5, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Manik-Khajuria-5
Manik-Khajuria-5 marked this pull request as ready for review July 1, 2026 13:50

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @Manik-Khajuria-5, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@Manik-Khajuria-5

Copy link
Copy Markdown
Member Author

@rajnisht7 @vedansh-5 @Jayantparashar10 @tonypzy Please review this PR

Comment thread .agents/context/testing.md Outdated

@tonypzy tonypzy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

except that, lgtm

@Manik-Khajuria-5
Manik-Khajuria-5 requested a review from tonypzy July 4, 2026 10:16
@Manik-Khajuria-5

Copy link
Copy Markdown
Member Author

@tonypzy I have changed the version Can u please review this PR again

@Manik-Khajuria-5

Copy link
Copy Markdown
Member Author

@tonypzy PLease review this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a first-class pytest-based Python unit testing layer for Visdom (config + initial smoke test) and wires it into GitHub Actions, alongside updates to contributor/testing documentation.

Changes:

  • Add pytest/pytest-cov to Python test dependencies and introduce a root pyproject.toml pytest configuration scoped to py/tests/.
  • Add an initial Python smoke test to validate test discovery and import visdom.
  • Add a new GitHub Actions workflow to run pytest on PRs/pushes, and update docs to reflect the new Python testing setup.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test-requirements.txt Adds pytest tooling dependencies for the new Python test suite.
pyproject.toml Adds pytest discovery/configuration (scoped testpaths, pythonpath, markers).
py/tests/test_smoke.py Introduces initial smoke tests for pytest discovery and package import.
.github/workflows/python-tests.yml Adds CI job to run pytest on PRs and branch pushes.
AGENTS.md Updates contributor testing and PR checklist guidance to include pytest.
.agents/context/testing.md Updates internal agent/testing guidance to include pytest usage and CI info.
REFACTORING.md Updates verification plan instructions to use the new pytest configuration.

Comment thread py/tests/test_smoke.py
Comment thread .agents/context/testing.md Outdated
Comment thread .agents/context/testing.md Outdated
Comment thread .github/workflows/python-tests.yml
Comment thread .github/workflows/python-tests.yml Outdated
Manik-Khajuria-5 and others added 2 commits July 7, 2026 18:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Saksham-Sirohi
Saksham-Sirohi merged commit c35aef3 into fossasia:dev Jul 8, 2026
11 checks passed
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.

7 participants