Skip to content

Conversation

Copy link

Copilot AI commented Jan 29, 2026

The test file referenced MAX_RESULTS without defining it, causing NameError on test execution.

Changes:

  • Added MAX_RESULTS = 5 module-level constant in tests/test_design_builder.py
"""Tests for PyOpenMagnetics Design Builder API."""

import pytest
import math

# Maximum number of results to request in solve() calls for testing
MAX_RESULTS = 5

The constant is used in test methods like:

def test_solve_flyback(self):
    results = Design.flyback().vin_ac(85, 265).output(12, 5).fsw(100e3).solve(max_results=MAX_RESULTS)
    assert isinstance(results, list)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: tinix84 <16301528+tinix84@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on PyOpenMagnetics FREE version Fix undefined MAX_RESULTS in test_design_builder.py Jan 29, 2026
Copilot AI requested a review from tinix84 January 29, 2026 22:57
@tinix84 tinix84 closed this Jan 30, 2026
@tinix84 tinix84 deleted the copilot/sub-pr-7 branch January 30, 2026 06:34
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