Skip to content

TEST: add tests for quantecon/timings (#889) - #915

Open
bwcummings1 wants to merge 1 commit into
QuantEcon:mainfrom
bwcummings1:tests-timings-889
Open

TEST: add tests for quantecon/timings (#889)#915
bwcummings1 wants to merge 1 commit into
QuantEcon:mainfrom
bwcummings1:tests-timings-889

Conversation

@bwcummings1

Copy link
Copy Markdown

Addresses #889. The quantecon/timings subpackage had no tests; this adds a
quantecon/timings/tests/ package (an __init__.py marker plus
test_timings.py, following the per-subpackage tests/ convention used
elsewhere in the repo) with 9 tests covering the
public API:

  • float_precision() getter (no argument returns the current precision)
  • float_precision(n) setter, observable via both the getter and
    get_default_precision()
  • accepts 0 and larger valid integers
  • raises ValueError for a negative int, a float, and a string
    (parametrized)
  • a failed set leaves the global precision unchanged
  • get_default_precision() reports the live global value

An autouse fixture snapshots and restores the module global so the tests
never leak precision changes into the rest of the suite.

Coverage for quantecon/timings/timings.py goes from 0% to 100%
(measured with coverage run -m pytest quantecon/timings on this branch).
flake8 --select=F401,F405,E231 is clean. No production code is modified.

AI disclosure: these tests were drafted by an AI system — poolside
Laguna S 2.1 in an orchestrated harness (orchestrator: Claude Fable 5) —
from #889's acceptance criteria and the module source. The commit message
carries model/usage detail. I reviewed and validated the tests and the
coverage delta and take responsibility for this contribution.

Covers the previously zero-coverage quantecon/timings public API:
float_precision get/set, ValueError paths (negative int, float, string),
get_default_precision, and global-state restoration via an autouse
fixture. Raises quantecon/timings/timings.py coverage 0% -> 100%.

AI-Model: poolside Laguna S 2.1 (via orchestrated harness; orchestrator
Claude Fable 5 / claude-fable-5)
AI-Usage: Laguna drafted the tests from the QuantEcon#889 acceptance criteria and
the module source under a bounded directive; the orchestrator specified
the coverage targets, reviewed the diff, ran flake8 --select=F401,F405,E231
(clean) and verified the 0->100% coverage delta. Human (repo owner)
reviews, validates, and submits this PR and takes responsibility.
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