This repository was archived by the owner on Nov 11, 2025. It is now read-only.

Description
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>) .
When I wrap fp in str() like this
with self.subTest(str(fp)):
The output looks like this
FolderModeFS.test_build_container [/Beverly/Wurst.pickle]