Fix python tests relative paths#105
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #105 +/- ##
==========================================
+ Coverage 74.85% 74.87% +0.02%
==========================================
Files 590 590
Lines 59209 59209
==========================================
+ Hits 44319 44334 +15
+ Misses 14890 14875 -15 see 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
This pull request updates the import system throughout the
python/testsdirectory to simplify and standardize how test modules import shared utilities and thecommonmodule. The main change is to ensure that test files can use direct imports instead of relative imports by adding the test folder tosys.pathat runtime. This improves compatibility and avoids import errors when running tests.Key changes:
Import system modernization:
__init__.pyandconftest.pyto insert the test folder intosys.pathif not already present. This allows for direct imports of modules likecommonandutilitiesfrom anywhere in the test suite. [1] [2]Refactoring imports in test modules:
from ..utilities import ...) with direct imports (e.g.,from utilities import ...) in test files intest_yup_core,test_yup_events, andtest_yup_graphicssubdirectories. This includes updates in files such astest_File.py,test_FileFilter.py,test_FileOutputStream.py,test_JSON.py,test_TemporaryFile.py,test_XmlElement.py, andtest_ZipFile.py. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]These changes make the test suite more robust and easier to maintain by eliminating fragile relative imports and ensuring consistent module resolution.