Repository navigation
Fix the warnings the test suite emits at their source - #938
Open
marlon-costa-dc wants to merge 2 commits into
Open
marlon-costa-dc wants to merge 2 commits into
marlon-costa-dc wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #938 +/- ##
==========================================
- Coverage 95.43% 95.42% -0.02%
==========================================
Files 134 134
Lines 26843 26880 +37
==========================================
+ Hits 25618 25649 +31
- Misses 1225 1231 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Running the suite with `-W error` failed 855 tests and errored 475. Each warning had a real cause: - `Project.__init__` called its own `_init_source_folders`, which is marked deprecated, so every `Project()` warned. Its body is inlined in the only caller and the private method is removed. - `libutils.path_relative_to_project_root` called the deprecated public `relative`. Both now share a private `_relative`. - `AutoImport.close()` closed only the calling thread's connection. Each thread opens its own, so connections from worker threads leaked. Every connection is now registered and closed. Connections are created with `check_same_thread=False` so close() may close them. - The autoimport process pools forked a multi-threaded process (DeprecationWarning: use of fork() may lead to deadlocks). Workers now start from `forkserver`, the POSIX default since Python 3.14, or from `spawn` where it is not available. - `datetime.utcnow()` is replaced by `datetime.now(timezone.utc)`. - `testutils.time_limit` returned a decorator factory instead of a decorator when not running under pytest's main process (e.g. xdist workers). The decorated test was replaced and never ran. - Tests: close the files, sqlite connections and AutoImport objects they open; pass `memory=` explicitly instead of relying on the deprecated default; assert that deprecated JobSet getters warn (`assertWarns`) instead of letting them warn; use raw strings for regex messages; discover a stdlib extension module from the import system for `compiled_lib` (python-build-standalone links `_sqlite3` statically). Result on Python 3.13: 2159 passed, 0 warnings, both serially and with pytest-xdist, and `-W error` passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wrapper now delegates to _relative; the test asserts it warns and returns the same project-relative path as path_relative_to_project_root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcepl
force-pushed
the
pr/test-suite-warnings
branch
from
November 8, 2026 18:42
36f8c69 to
5aa9777
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The test suite emitted warnings on every run (DeprecationWarning, ResourceWarning, SyntaxWarning, and fork-with-threads warnings). Under
-W error, 855 tests failed and 475 errored. This fixes each warning at its source:Projectno longer calls the deprecated_init_source_folderspath.AutoImportcloses every sqlite connection it opens, and its cache workers start withforkserver/spawninstead of forking a threaded process.datetime.utcnow()is replaced bydatetime.now(timezone.utc).assertWarns, and find a compiled stdlib module instead of assuming_sqlite3has a__file__.Evidence
pytest ropetest -n 8 -W error: 2159 passed, 7 skipped, 5 xfailed, 0 warnings (serial runs also pass).🤖 Generated with Claude Code