Remove redundant if, tidy if-body

This commit is contained in:
Tom Dalton 2017-10-23 16:12:07 +01:00
parent de9d116a49
commit ee7e1c94d2
1 changed files with 4 additions and 5 deletions

View File

@ -1145,11 +1145,10 @@ class FixtureManager:
return [] return []
sep = py.path.local.sep sep = py.path.local.sep
parts = nodeid.split(sep) parts = nodeid.split(sep)
if parts: last_part = parts[-1]
last_part = parts[-1] if '::' in last_part:
if '::' in last_part: # Replace single last element 'test_foo.py::Bar::()' with multiple elements 'test_foo.py', 'Bar', '()'
namespace_parts = last_part.split("::") parts[-1:] = last_part.split("::")
parts[-1:] = namespace_parts
return parts return parts
@classmethod @classmethod