Skip to content

fix: pytest plugin to fail tests when anybodycon is not available#143

Merged
melund merged 6 commits intomasterfrom
copilot/fix-test-issue-no-anybodycon
Mar 15, 2026
Merged

fix: pytest plugin to fail tests when anybodycon is not available#143
melund merged 6 commits intomasterfrom
copilot/fix-test-issue-no-anybodycon

Conversation

Copy link
Contributor

Copilot AI commented Mar 14, 2026

The test_no_anybodycon pixi environment name used underscores, which pixi rejects. After renaming and regenerating the lock file, the CI black lint check failed due to a formatting mismatch.

  • pixi.toml: Rename environment test_no_anybodycontest-no-anybodycon (pixi requires lowercase letters, numbers, and dashes only)
  • pixi.lock: Regenerated via pixi lock with the corrected environment name
  • .github/workflows/test.yml: Update environment references to test-no-anybodycon; run job on windows-latest with shell: bash (needed for ! negation)
  • anypytools/pytest_plugin.py: Fix black formatting — collapse multi-line if to single line:
# before
if not pytest.anytest.ams_path or not os.path.isfile(
    pytest.anytest.ams_path
):

# after
if not pytest.anytest.ams_path or not os.path.isfile(pytest.anytest.ams_path):

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits March 14, 2026 07:47
Add early check in AnyTestItem.runtest() to raise a proper test
failure when the AnyBodyCon executable cannot be found, instead of
silently passing with an unhandled thread exception.

Also add test_no_anybodycon pixi environment and CI job to verify
.any tests correctly fail without anybodycon installed.

Fixes #142

Co-authored-by: melund <1038978+melund@users.noreply.github.com>
Co-authored-by: melund <1038978+melund@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test issue for environment without anybodycon Fix pytest plugin silently passing .any tests when anybodycon is not available Mar 14, 2026
Copilot AI requested a review from melund March 14, 2026 07:50
Switch the runner from ubuntu-latest to windows-latest and add
shell: bash since the ! negation operator requires bash (not
PowerShell, the default on Windows runners).

Co-authored-by: melund <1038978+melund@users.noreply.github.com>
Pixi requires environment names to use only lowercase letters,
numbers and dashes. Renamed test_no_anybodycon to
test-no-anybodycon in pixi.toml and the workflow file, then ran
pixi lock to regenerate the lock file.

Co-authored-by: melund <1038978+melund@users.noreply.github.com>
Copilot AI changed the title Fix pytest plugin silently passing .any tests when anybodycon is not available Run test-no-anybodycon on windows-latest Mar 14, 2026
Collapse multi-line if condition to single line to match
black's expected formatting and pass CI lint check.

Co-authored-by: melund <1038978+melund@users.noreply.github.com>
Copilot AI changed the title Run test-no-anybodycon on windows-latest Fix pixi lock and black formatting for test-no-anybodycon environment Mar 14, 2026
@melund melund marked this pull request as ready for review March 15, 2026 12:11
@melund melund changed the title Fix pixi lock and black formatting for test-no-anybodycon environment fix: missing anybodycon should cause test to fail Mar 15, 2026
@melund melund changed the title fix: missing anybodycon should cause test to fail fix: pytest plugin to fail tests when anybodycon is not available Mar 15, 2026
@melund melund merged commit 05cf868 into master Mar 15, 2026
9 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.

2 participants