<div dir="ltr">On 28 September 2015 at 12:47, Lucian Musat <span dir="ltr"><<a href="mailto:george.l.musat@intel.com" target="_blank">george.l.musat@intel.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">@@ -172,6 +176,7 @@ def exportTests(d,tc):<br>+ from re import search as re_search<br></blockquote><div><br></div><div class="gmail_extra">Just import re and then do re.search - it's the same number of characters when calling and it's obvious what you're calling then.</div><div class="gmail_extra"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> for t in tc.testslist:<br>
+ if re_search("\w+\.\w+\.test_\S+", t):<br>
+ t = t.split('.')[0]+'.'+t.split('.')[1]+'.'+t.split('.')[2]</blockquote><div><br></div><div>Not sure I understand what this is meant to be doing. If t matches [alphanumerics].[alphanumerics].test_[not whitespace] repeatedly split t on dots and re-join it back together with dots. For the example of filename.class.test_method doesn't this reconstruct the input? If you're attempting to truncate to the first three elements, then something like '.'.join(t.split('.')[:3]) is much more efficient and Pythonic.</div><div><br></div><div>Ross</div></div></div></div>