fix: clean up Python 2 remnants and resolve deprecation warnings#8
Merged
jcardozo-eth merged 4 commits intomasterfrom Feb 27, 2026
Merged
fix: clean up Python 2 remnants and resolve deprecation warnings#8jcardozo-eth merged 4 commits intomasterfrom
jcardozo-eth merged 4 commits intomasterfrom
Conversation
…tive datetime.utcnow() has been deprecated since Python 3.12 and will be removed in a future version. Replace with datetime.now(timezone.utc), stripping tzinfo to maintain compatibility with the naive-datetime convention used throughout the codebase (enforced by the assertion in datetime_to_datestamp()).
Remove dead try/except import blocks where the except branch can never execute on Python >= 3.10. Replace with direct imports of the Python 3 standard library modules.
These scripts use Python 2 print statements and hardcoded absolute paths, making them non-functional on Python 3. The fixture XML files they originally generated already exist in the fake1/–fake5/ test directories.
Pytest attempts to collect TestError as a test class because its name starts with 'Test'. Rename to FakeRequestError to follow the existing Fake* naming convention in fakeclient.py and eliminate the warning.
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
datetime.utcnow()withdatetime.now(timezone.utc)inserver.py,stripping
tzinfoto maintain compatibility with the naive-datetime convention enforcedby
datetime_to_datestamp()(Python docs)test_client.pyandfakeclient.pycreatedata.py,createdata_deleted_records.py)TestError→FakeRequestErrorto fixPytestCollectionWarningAll changes remove dead code, fix deprecations, or correct naming
and should not impact functional behavior.
Test plan
uv run pytest— 58 tests passuv run pytest -W error::DeprecationWarning— zero deprecation warnings