[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4242/8267] oeqa/core/utils/test.py: Add functions to get module path
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 4242/8267] oeqa/core/utils/test.py: Add functions to get module path
- Date: Sun, 17 Dec 2017 01:45:43 +0000 (UTC)
commit 8970ed4b1fd5673fd3472934a000d10bcce297c2
Author: Mariano Lopez <mariano lopez linux intel com>
Date: Mon Jan 9 14:42:48 2017 +0000
oeqa/core/utils/test.py: Add functions to get module path
This will add functions to get module file path from a test
case or a complete suite.
[YOCTO #10234]
(From OE-Core rev: 11dd49cb9faaf6588f045083ab5bd6679e2eafc1)
Signed-off-by: Mariano Lopez <mariano lopez linux intel com>
Signed-off-by: Richard Purdie <richard purdie linuxfoundation org>
meta/lib/oeqa/core/utils/test.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/meta/lib/oeqa/core/utils/test.py b/meta/lib/oeqa/core/utils/test.py
index 820b997..88d1765 100644
--- a/meta/lib/oeqa/core/utils/test.py
+++ b/meta/lib/oeqa/core/utils/test.py
@@ -2,6 +2,7 @@
# Released under the MIT license (see COPYING.MIT)
import os
+import inspect
import unittest
def getSuiteCases(suite):
@@ -46,6 +47,12 @@ def getSuiteCasesIDs(suite):
"""
return getSuiteCasesInfo(suite, getCaseID)
+def getSuiteCasesFiles(suite):
+ """
+ Returns test case files paths from suite.
+ """
+ return getSuiteCasesInfo(suite, getCaseFile)
+
def getCaseModule(test_case):
"""
Returns test case module name.
@@ -64,6 +71,12 @@ def getCaseID(test_case):
"""
return test_case.id()
+def getCaseFile(test_case):
+ """
+ Returns test case file path.
+ """
+ return inspect.getsourcefile(test_case.__class__)
+
def getCaseMethod(test_case):
"""
Returns test case method name.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]