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
When using log.subpath, https://slash.readthedocs.io/en/master/configuration.html#conf-log-subpath, formatting isn't working as I would expect, specifically when trying to trim strings. For example, in .slashrc, set the following to create a session id folder, and within it, folders named after the test class for each test:
I would expect that the test class name would be trimmed to just 3 characters, and be used as the parent folder name of debug.log
Instead, we get this error: "Session error caught -- <Error: TypeError: unsupported format string passed to _NormalizedObject.format>"
If we omit the ":.3" part, everything works fine.
I believe this is because we're relying on object's default format method:
It would be ideal to be able to trim these, since in Windows, long path names can play a role in whether we are or are not successful at creating these paths. Especially since the test class name or even the test method name can be any arbitrary length. Limiting the number of characters helps me to identify the appropriate test for which this log belongs, while also respecting a finite number of characters in the folder structure.
The text was updated successfully, but these errors were encountered:
When using log.subpath, https://slash.readthedocs.io/en/master/configuration.html#conf-log-subpath, formatting isn't working as I would expect, specifically when trying to trim strings. For example, in .slashrc, set the following to create a session id folder, and within it, folders named after the test class for each test:
slash.config.root.log.subpath = "/".join([
"{context.session.id}",
"{context.test_classname:.3}",
"debug.log"
])
I would expect that the test class name would be trimmed to just 3 characters, and be used as the parent folder name of debug.log
Instead, we get this error: "Session error caught -- <Error: TypeError: unsupported format string passed to _NormalizedObject.format>"
If we omit the ":.3" part, everything works fine.
I believe this is because we're relying on object's default format method:
slash/slash/log.py
Line 33 in b505dc0
It would be ideal to be able to trim these, since in Windows, long path names can play a role in whether we are or are not successful at creating these paths. Especially since the test class name or even the test method name can be any arbitrary length. Limiting the number of characters helps me to identify the appropriate test for which this log belongs, while also respecting a finite number of characters in the folder structure.
The text was updated successfully, but these errors were encountered: