Skip to content

Conversation

@AlexWaygood
Copy link
Member

Summary

This PR attempts to make it easier to understand what a failing property test means, by showing you (something closer to) the type that ty internally simplified a type to, rather than just the schema that was used to generate a pair of types for a particular property test.

Demo:

~/dev/ruff (alex/property-test-debug)⚡ [101] % QUICKCHECK_TESTS=1000000 cargo test --release -p ty_python_semantic -- --ignored types::property_tests::flaky::double_negation_is_identity
    Finished `release` profile [optimized] target(s) in 0.09s
     Running unittests src/lib.rs (target/release/deps/ty_python_semantic-8dac72c754bdebcd)

running 1 test
test types::property_tests::flaky::double_negation_is_identity ... FAILED

failures:

---- types::property_tests::flaky::double_negation_is_identity stdout ----

Failing types were:
(~(bound method int.bit_length() -> int) & ~Mock) | (bound method int.bit_length() -> int) | ABCMeta | ((**n4: tuple[*tuple[type[str], ...], Unknown, bool]) -> Literal[SafeUUID.unknown])

Failing types were:
(~(bound method int.bit_length() -> int) & ~Mock) | (bound method int.bit_length() -> int) | ABCMeta

Failing types were:
(~(bound method int.bit_length() -> int) & ~Mock) | (bound method int.bit_length() -> int)

Failing types were:
(~(bound method int.bit_length() -> int) & ~Mock) | (bound method int.bit_length() -> int)

thread 'types::property_tests::flaky::double_negation_is_identity' panicked at /Users/alexw/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quickcheck-1.0.3/src/tester.rs:165:28:
[quickcheck] TEST FAILED. Arguments: (Union([Intersection { pos: [], neg: [BuiltinsBoundMethod { class: "int", method: "bit_length" }, UnittestMockInstance] }, BuiltinsBoundMethod { class: "int", method: "bit_length" }]))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    types::property_tests::flaky::double_negation_is_identity

Test Plan

@AlexWaygood AlexWaygood requested a review from carljm as a code owner October 6, 2025 13:34
@AlexWaygood AlexWaygood added the internal An internal refactor or improvement label Oct 6, 2025
@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label Oct 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2025

mypy_primer results

Changes were detected when running on open source projects
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/build/_wheelfile.py:51:22: error[no-matching-overload] No overload of function `field` matches arguments
- Found 53 diagnostics
+ Found 52 diagnostics
No memory usage changes detected ✅

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@AlexWaygood AlexWaygood merged commit 70f51e9 into main Oct 6, 2025
40 checks passed
@AlexWaygood AlexWaygood deleted the alex/property-test-debug branch October 6, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants