fix: line nr in test name in wrong places

test.Test() overrides name() in order to provide source line number
information. However, overriding name() is the wrong place for that, as
name() is also often used for identifying an object - when listing the
tests of a suite, the line number should not appear in the test name.
For example, the line number sometimes ends up in the test results in
jenkins, making 'foo.py' and 'foo.py:23' two distinct report items.

Instead, add a separate function Origin.src() that defaults to name(),
but specific classes can override src() if they wish to provide more
detailed information with the object name.

Override src() in Test, not name().

Use src() in backtraces.

The suite_test.ok shows that the backtracing in the log remains
unchanged, but the place where the test name is printed is corrected:
   I am 'test_suite' / 'hello_world.py:23'
becomes
   I am 'test_suite' / 'hello_world.py'
(Notice that "[LINENR]" in suite_test.ok is a masking of an actual
number, done within the selftest suite)

Change-Id: I0c4698fa2b3db3de777d8b6dcdcee84e433c62b7
diff --git a/src/osmo_gsm_tester/core/log.py b/src/osmo_gsm_tester/core/log.py
index b8182f5..2b8db62 100644
--- a/src/osmo_gsm_tester/core/log.py
+++ b/src/osmo_gsm_tester/core/log.py
@@ -222,7 +222,7 @@
             if origin is None:
                 name = '-'
             elif isinstance(origin, Origin):
-                name = origin.name()
+                name = origin.src()
                 # only log ancestry when there is more than one
                 if origin._parent is not None:
                     deeper_origins = origin.ancestry_str()
@@ -447,6 +447,12 @@
     def name(self):
         return self._name or self.__class__.__name__
 
+    def src(self):
+        '''subclasses may override this to provide more detailed source
+        information with the name, for a backtrace. For example, a line number
+        in a test script.'''
+        return self.name()
+
     __str__ = name
     __repr__ = name
 
@@ -476,7 +482,7 @@
         return origins
 
     def ancestry_str(self):
-        return '↪'.join([o.name() for o in self.ancestry()])
+        return '↪'.join([o.src() for o in self.ancestry()])
 
     def highest_ancestor(self):
         if self._parent: