You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because pytest don't support subtests I have to use this addon here. I'm not sure if I do something wrong?
In short: Using a pathlib.Path object as argument in unittest.subTest() the string representation of that object isn't used. I just see (<subtest>) in the output for each subtest.
This is a snippet of an unittest of mine:
expect_folder = pathlib.Path.cwd() / 'Beverly'
expect = [
expect_folder / '_Elke.pickle',
expect_folder / '_Foo.pickle',
expect_folder / 'Bar.pickle',
expect_folder / 'Wurst.pickle',
]
for fp in expect:
with self.subTest(fp):
self.assertTrue(fp.exists())
That is the output for each subtest FolderModeFS.test_build_container (<subtest>) .
self.subTest is meant for use with unittest.TestCase, how does that output look like if you execute something similar (a MWE) using the unittest runner instead o pytest?
Because pytest don't support subtests I have to use this addon here. I'm not sure if I do something wrong?
In short: Using a
pathlib.Path
object as argument inunittest.subTest()
the string representation of that object isn't used. I just see(<subtest>)
in the output for each subtest.This is a snippet of an unittest of mine:
That is the output for each subtest
FolderModeFS.test_build_container (<subtest>)
.When I wrap
fp
instr()
like thisThe output looks like this
The text was updated successfully, but these errors were encountered: