Skip to content

Use the plugin acceptance checks provided by PyMoDAQ 5.3 - #43

Open
seb5g wants to merge 6 commits into
5.0.xfrom
feature/plugin_acceptance_tests
Open

seb5g wants to merge 6 commits into
5.0.xfrom
feature/plugin_acceptance_tests

Conversation

@seb5g

@seb5g seb5g commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace the generic tests copied in every plugin (tests/test_plugin_package_structure.py) with a short stub subclassing PluginPackageChecks from pymodaq_utils.plugin_testing (PyMoDAQ #1256 merged in dev, moved to pymodaq_utils in #1259 so that using it does not start the whole pymodaq initialization). The checks are maintained in PyMoDAQ instead of being copied into each plugin, and cover more (entry points, naming, base class + overridden mandatory methods, units/axes consistency, params, static rules on the sources).
  • The module is skipped when pymodaq_utils.plugin_testing does not exist (PyMoDAQ < 5.3.1: the checks are released in a 5.3 patch version, 5.3.0 being tagged without them). Before that there is no plugin testing, the former tests are dropped.
  • Defaults for a plugin made from this template: fail_on = 'error' (TODO comments and placeholders are listed, not failing; set 'todo' before a release) and strict_imports = False (a module that cannot be imported because of a missing dependency or vendor driver, that cannot always be installed in a CI, is skipped; set it to True to make it fail). An unreplaced python_wrapper_file_of_your_instrument import is reported as a todo, not as a failure.
  • Existing plugins can replace their copy of the old test file with this one, unless it holds tests specific to the plugin.

Notes

  • Tried on a fresh clone of this branch, installed as in a CI (non editable): 6 tests pass with PyMoDAQ dev, and the module is skipped when pymodaq_utils.plugin_testing is not available.
  • The GitHub workflows removed from 5.0.x by 7799554 (Test, Testbase, compatibility, python-publish, updater) are restored, unchanged, as they were just before (196 lines, same as the removal). Testbase installs pymodaq from PyPI, so the stub is skipped there until a PyMoDAQ release containing pymodaq_utils.plugin_testing (5.3.1) is out. Revert this commit if the removal was intended.
  • The checks flag two things in the template itself, as warnings only (not failing): _epsilon is deprecated in daq_move_Template.py (use _epsilons), and [features] extensions/models are false while the package holds example code in those folders.
  • PyMoDAQ 5.3.1, with pymodaq_utils.plugin_testing, is on PyPI: the Tests workflow of this PR (flake8 gate + pytest with the stub, installing pymodaq from PyPI) passes.
  • The restored Tests workflow fails the flake8 gate on the template itself (F821 undefined name 'arg1', 'arg2' in daq_move_Template.py): fixed in this PR (PythonWrapperObjectOfYourInstrument() with a TODO for the arguments).

🤖 Generated with Claude Code

seb5g and others added 5 commits October 6, 2026 21:50
Replace the copied generic tests with a stub using pymodaq.utils.plugin_testing.
The module is skipped with pymodaq < 5.3.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…, publication, updater)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… gate of the CI fails on them

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@seb5g
seb5g marked this pull request as ready for review October 6, 2026 22:30
…e installed in the CI

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.

1 participant