Skip to content

fix(ci): make install_workspace a staticmethod fixture (#691) - #693

Merged
c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
bugfix/691-classmethod-class-fixture
Jun 24, 2026
Merged

c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
bugfix/691-classmethod-class-fixture

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Description

Resolves the PytestRemovedIn10Warning emitted by the install-script integration suite. The class-scoped install_workspace fixture was defined as an instance method — a pattern pytest 9 deprecates and pytest 10 removes. Since the project pins pytest==9.1.1, a future Renovate/Dependabot bump to pytest 10 would error at collection and take out the entire TestInstallScriptIntegration suite. This converts the fixture to a @staticmethod (it never used self), keeping the class-scope "run install.sh once per class" behaviour.

Type of Change

  • fix -- Bug fix
  • test -- Adding or updating tests

Modifiers

  • Breaking change (!)

Changes Made

  • tests/test_install_script.py: TestInstallScriptIntegration.install_workspace is now a @staticmethod fixture (dropped the unused self); @pytest.fixture(scope="class") and the body are otherwise unchanged. The 17 tests already consume it via the fixture parameter, so no test-method changes were needed.
  • CHANGELOG.md (+ manifest-synced assets/workspace/.devcontainer/CHANGELOG.md): added a ### Fixed entry under ## Unreleased.

Changelog Entry

### Fixed

- **Install-script test suite no longer trips a pytest-10-removal deprecation (class-scoped fixture as instance method)** ([#691](https://github.com/vig-os/devcontainer/issues/691))
  - `TestInstallScriptIntegration.install_workspace` was a class-scoped fixture defined as an instance method, which pytest 9 flags with `PytestRemovedIn10Warning` and pytest 10 removes — a future `pytest` bump would then error at collection and take out the whole install-script suite. Converted it to a `@staticmethod` (it never used `self`), preserving the class-scope "run `install.sh` once per class" behaviour; verified with `-W error::pytest.PytestRemovedIn10Warning`

Testing

  • Tests pass locally (just test — relevant subset)

Manual Testing Details

Verified RED → GREEN with the deprecation escalated to an error so the warning is enforced, not merely observed:

TEST_CONTAINER_TAG=dev uv run pytest tests/test_install_script.py \
  -W error::pytest.PytestRemovedIn10Warning -p no:cacheprovider
  • Before: 1 error — pytest.PytestRemovedIn10Warning: Class-scoped fixture defined as instance method at fixture setup.
  • After: 23 passed — no PytestRemovedIn10Warning.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • New and existing unit tests pass locally with my changes

Additional Notes

Committed from a NixOS host worktree. Three pre-commit hooks cannot execute on a bare NixOS host (the documented #683-class dynamic-linking limitation — they run in the Debian container / CI): typos and ruff (downloaded binaries) and pymarkdown (manylinux libstdc++ C-extension). They were skipped for the local commit but independently validated and/or re-enforced by CI:

  • ruff check + ruff format --check on the changed file — clean via store-native nix run nixpkgs#ruff.
  • typos on the changed files — clean via store-native nix run nixpkgs#typos.
  • pymarkdown — deferred to CI (the change is a format-matching CHANGELOG entry).
  • All runnable hooks (incl. validate-commit-msg, bandit, check agent identity, sync-manifest) ran and passed; --no-verify was not used.

Refs: #691

The class-scoped install_workspace fixture was defined as an instance
method, which pytest 9 flags with PytestRemovedIn10Warning and pytest 10
removes outright — a future pytest bump would then error at collection
and take out the whole install-script integration suite. The fixture
never referenced self, so convert it to a @staticmethod, preserving the
class-scope (run install.sh once per class) behaviour.

Refs: #691
@c-vigo
c-vigo merged commit 388182f into feature/625-nix-claude-migration Jun 24, 2026
2 checks passed
@c-vigo
c-vigo deleted the bugfix/691-classmethod-class-fixture branch June 24, 2026 15:43
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