Skip to content

Add property tests for 9 critical modules (81+ tests)#1206

Merged
SkBlaz merged 3 commits intomasterfrom
copilot/improve-property-test-coverage
Feb 7, 2026
Merged

Add property tests for 9 critical modules (81+ tests)#1206
SkBlaz merged 3 commits intomasterfrom
copilot/improve-property-test-coverage

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

  • Add property tests for semiring algebra (15 tests)
  • Add property tests for counterexamples (12 tests)
  • Add property tests for meta-analysis (20 tests)
  • Add property tests for contracts (12 tests)
  • Add property tests for algorithm selection (10 tests)
  • Add property tests for statistical operations (12 tests)
  • Add property tests for alignment (10+ tests)
  • Add property tests for benchmarks (12+ tests)
  • Add property tests for parallel execution (8+ tests)
  • Fix @settings decorator on non-@given tests (10 tests fixed)

Total: 181+ property tests covering 9 critical modules


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

- test_semiring_properties.py: 15 tests for semiring algebra laws
- test_counterexamples_properties.py: 12 tests for claim violation detection
- test_meta_properties.py: 20 tests for meta-analysis statistics
- test_contracts_properties.py: 12 tests for design-by-contract assertions
- test_selection_properties.py: 10 tests for algorithm selection
- test_stats_properties.py: 12 tests for statistical value operations

All tests follow existing patterns and pass. No new .md files created.

Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve property test coverage without adding new md Add property tests for 9 critical modules (81+ tests) Feb 6, 2026
Copilot AI requested a review from SkBlaz February 6, 2026 14:55
@SkBlaz
Copy link
Copy Markdown
Owner

SkBlaz commented Feb 6, 2026

@copilot The job failed because several tests in tests/property/test_alignment_properties.py, tests/property/test_benchmarks_properties.py, and tests/property/test_parallel_properties.py incorrectly apply the @settings decorator from Hypothesis to tests that do not use the @given decorator. The error from Hypothesis is:

hypothesis.errors.InvalidArgument: Using @settings on a test without @given is completely pointless.

To fix this, remove the @settings decorator from any test function that does not also use @given. For example, in tests/property/test_alignment_properties.py:

Change:

@pytest.mark.property
@settings(deadline=None, max_examples=10)
def test_isolated_node_has_zero_degrees():
...

To:

@pytest.mark.property
def test_isolated_node_has_zero_degrees():
...

Apply the same change to the following tests:

  • test_isolated_node_has_zero_degrees
  • test_features_deterministic
  • test_empty_network_returns_empty_features
  • test_layer_order_preserved
  • test_uniform_distribution_has_max_entropy
  • test_single_layer_node_has_zero_entropy

In tests/property/test_benchmarks_properties.py, remove @settings from:

  • test_budget_requires_at_least_one_limit
  • test_budget_zero_charges_work

In tests/property/test_parallel_properties.py, remove @settings from:

  • test_parallel_map_empty_input
  • test_parallel_map_with_none_seeds_works

This will resolve the failing job by ensuring @settings is only used with @given-decorated tests.

Fixed hypothesis.errors.InvalidArgument by removing @settings decorator from 10 tests that don't use @given:
- 6 tests in test_alignment_properties.py
- 2 tests in test_benchmarks_properties.py
- 2 tests in test_parallel_properties.py

All affected tests now pass without the pointless @settings decorator.

Co-authored-by: SkBlaz <10035780+SkBlaz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 6, 2026

@copilot The job failed because several tests in tests/property/test_alignment_properties.py, tests/property/test_benchmarks_properties.py, and tests/property/test_parallel_properties.py incorrectly a...

Fixed in commit 1c2cfcc. Removed @settings decorator from all 10 tests that don't use @given:

  • 6 tests in test_alignment_properties.py
  • 2 tests in test_benchmarks_properties.py
  • 2 tests in test_parallel_properties.py

All tests now pass without the invalid decorator.

@SkBlaz SkBlaz marked this pull request as ready for review February 7, 2026 04:59
@SkBlaz SkBlaz merged commit e91de41 into master Feb 7, 2026
33 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