Conversation
- Skip test entries with classname "pytest" or "_pytest" in JUnit XML parsing to avoid spurious warnings from pytest internal error reports - Use find_spec instead of eager numpy import in pytest plugin - Move protected_modules set to module-level frozenset to avoid recreating it on every _clear_lru_caches call
Cache inspect.getmembers() results per module so repeated loop iterations skip the expensive rescan. Add tests for get_runtime_from_stdout, should_stop, _set_nodeid, _get_total_time, _timed_out, logreport, and setup/teardown hooks.
…rt adder parse_code_and_prune_cst now returns cst.Module instead of str. add_needed_imports_from_module accepts cst.Module | str, skipping re-parse when a Module is passed. This eliminates the string round-trip that caused comments to migrate from statement leading_lines to Module.header, resulting in comments appearing above imports instead of at their original position.
Move duplicate detection and add original-code detection before logging and code printing, avoiding unnecessary work for candidates that would be discarded anyway.
Objects with __slots__ but no __dict__ (e.g. textual.cache.LRUCache) fell through all comparator branches, logging "Unknown comparator input type" and returning False — causing spurious test mismatches.
PR Review SummaryPrek Checks✅ All checks passed — MypyCode ReviewNo critical issues found. Changes reviewed:
Test Coverage
Coverage improved across all changed files:
Note: 8 pre-existing test failures in Last updated: 2026-02-23 |
⚡️ Codeflash found optimizations for this PR📄 440% (4.40x) speedup for
|
perf: optimize comparator with module-level constants and identity check - Hoist _equality_types tuple and conditional library imports to module level - Use isinstance for dict view type checks instead of string comparison - Use isinstance for user-defined __eq__ detection instead of str(type(...)) - Add identity short-circuit (orig is new) at the top of comparator() style: suppress false-positive PD011 on tf.SparseTensor.values
15ed9a9 to
c32abd1
Compare
Summary
__slots__-only objects (e.g.textual.cache.LRUCache) with "Unknown comparator input type" warnings, causing spurious test mismatches_clear_lru_cachesTest plan
TestSlotsObjectstests cover equality, inequality, inheritance, and nesting