-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-116303: Skip test module dependent tests if test modules are disabled #116307
Changes from 7 commits
9b3f0f7
0f6f74e
2f750c3
7c4477d
a9c6f62
cdc6df4
d05dcd7
cb7cff4
ad5e3b6
cdb8bf4
e4a30b0
fabb007
c51dafa
c3f9c99
fde9548
ea72ced
628896c
88c6739
c02cd6f
d49532b
2427111
25d0999
bdd8cff
ee9fa51
a47c5ff
d84a5c4
e877ffb
1ec0c66
afa58a9
760c6cb
d7f060a
a1106b7
db45852
ccd8bea
f80f75e
39d135d
13c4829
31e19a7
45e0586
a148fb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,7 @@ def setUp(self): | |
) | ||
finder = self.machinery.FileFinder(None) | ||
self.spec = importlib.util.find_spec(self.name) | ||
self.assertIsNotNone(self.spec) | ||
assert self.spec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why skip this in optimized mode? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jaraco requested to leave the assert's for importlib tests, so I reverted the unittest assert style changes. The code is shared with an external repo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI - I only care about the retention of bare asserts in the tests for importlib.metadata and importlib.resources. Unfortunately, the tests for importlib.metadata are interspersed with other importlib tests, so it's not easy to know which are which without looking at the cpython branch of importlib_metadata. I do have plans to move importlib.metadata tests into their own package so they're clearly separated. |
||
self.loader = self.machinery.ExtensionFileLoader( | ||
self.name, self.spec.origin) | ||
|
||
|
@@ -189,7 +189,7 @@ def setUp(self): | |
) | ||
finder = self.machinery.FileFinder(None) | ||
self.spec = importlib.util.find_spec(self.name) | ||
self.assertIsNotNone(self.spec) | ||
assert self.spec | ||
self.loader = self.machinery.ExtensionFileLoader( | ||
self.name, self.spec.origin) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Added import helper ``isolated_modules`` as ``CleanImport`` does not remove | ||
modules imported during the context. Use it in importlib.resources tests to | ||
avoid leaving ``mod`` around to impede importlib.metadata tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does it return a boolean (which is not callable) or a function (which always true)? How this helper is supposed to be used?