Skip to content

Add tests for previously uncovered utility, dataset, and metadatable …#7961

Open
jenshnielsen wants to merge 2 commits intomicrosoft:mainfrom
jenshnielsen:better_coverage
Open

Add tests for previously uncovered utility, dataset, and metadatable …#7961
jenshnielsen wants to merge 2 commits intomicrosoft:mainfrom
jenshnielsen:better_coverage

Conversation

@jenshnielsen
Copy link
Collaborator

@jenshnielsen jenshnielsen commented Mar 23, 2026

…modules

Add 128 new tests across 12 new test files targeting modules that previously had 0% or very low test coverage (excluding instrument_drivers).

New test files:

  • tests/utils/test_types.py: numpy type tuple definitions and composition
  • tests/utils/test_abstractmethod.py: qcodes_abstractmethod decorator
  • tests/utils/test_deprecate.py: QCoDeSDeprecationWarning class
  • tests/utils/test_deep_update_utils.py: recursive dict merging
  • tests/utils/test_path_helpers.py: QCoDeS path resolution utilities
  • tests/utils/test_numpy_utils.py: ragged array conversion
  • tests/dataset/test_snapshot_utils.py: dataset snapshot diffing
  • tests/dataset/test_json_exporter.py: JSON linear/heatmap export
  • tests/dataset/test_export_config.py: export config get/set functions
  • tests/dataset/test_rundescribertypes.py: TypedDict versioned schemas
  • tests/dataset/test_sqlite_settings_extended.py: SQLite settings/limits
  • tests/test_metadatable_base.py: Metadatable and MetadatableWithName

Coverage: from 69.97% to 70.12% +0.15%

@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.12%. Comparing base (3090bab) to head (6f67291).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7961      +/-   ##
==========================================
+ Coverage   69.97%   70.12%   +0.15%     
==========================================
  Files         333      333              
  Lines       32245    32245              
==========================================
+ Hits        22562    22613      +51     
+ Misses       9683     9632      -51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new pytest coverage for several low-/uncovered QCoDeS utility, dataset, and metadatable modules, primarily validating type aliases, small helpers, and export/snapshot utilities.

Changes:

  • Introduces new unit tests for qcodes.utils helpers (types, numpy/path utilities, deep update, abstractmethod, deprecate).
  • Adds dataset-focused tests (snapshot diffing, JSON exporter, export config, RunDescriber TypedDict schemas, SQLite settings).
  • Adds metadatable base tests to cover previously unexercised branches.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/utils/test_types.py Tests NumPy type tuple definitions/composition in qcodes.utils.types.
tests/utils/test_abstractmethod.py Tests qcodes_abstractmethod decorator behavior.
tests/utils/test_deprecate.py Tests QCoDeSDeprecationWarning behavior and visibility.
tests/utils/test_deep_update_utils.py Tests recursive dict merge semantics of deep_update.
tests/utils/test_path_helpers.py Tests QCoDeS path helper utilities and env var behavior.
tests/utils/test_numpy_utils.py Tests ragged/uniform array conversion helper.
tests/dataset/test_snapshot_utils.py Tests dataset snapshot diffing (diff_param_snapshots).
tests/dataset/test_json_exporter.py Tests JSON linear/heatmap export utilities and templates.
tests/dataset/test_export_config.py Tests export config get/set helpers and enum mapping.
tests/dataset/test_rundescribertypes.py Tests TypedDict schemas/unions for RunDescriber versioning.
tests/dataset/test_sqlite_settings_extended.py Adds broader coverage for SQLite settings/limits helpers.
tests/test_metadatable_base.py Adds coverage for Metadatable/MetadatableWithName behavior.

@jenshnielsen jenshnielsen force-pushed the better_coverage branch 2 times, most recently from 1dcebb6 to 9239009 Compare March 23, 2026 19:45
jenshnielsen and others added 2 commits March 25, 2026 09:20
…modules

Add 128 new tests across 12 new test files targeting modules that
previously had 0% or very low test coverage (excluding instrument_drivers).

New test files:
- tests/utils/test_types.py: numpy type tuple definitions and composition
- tests/utils/test_abstractmethod.py: qcodes_abstractmethod decorator
- tests/utils/test_deprecate.py: QCoDeSDeprecationWarning class
- tests/utils/test_deep_update_utils.py: recursive dict merging
- tests/utils/test_path_helpers.py: QCoDeS path resolution utilities
- tests/utils/test_numpy_utils.py: ragged array conversion
- tests/dataset/test_snapshot_utils.py: dataset snapshot diffing
- tests/dataset/test_json_exporter.py: JSON linear/heatmap export
- tests/dataset/test_export_config.py: export config get/set functions
- tests/dataset/test_rundescribertypes.py: TypedDict versioned schemas
- tests/dataset/test_sqlite_settings_extended.py: SQLite settings/limits
- tests/test_metadatable_base.py: Metadatable and MetadatableWithName

Non-driver test coverage: 64.7% -> 65.4%

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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