From 85ea88fab80ee2b6ec526236e54212748383f151 Mon Sep 17 00:00:00 2001 From: Julien Blondeau Date: Fri, 2 Feb 2018 18:17:26 +0100 Subject: [PATCH] [#2] Suppress abusive pytest warnings Change-Id: I13eb08420bf9d7f57e0d37fc18cfcc9d7a749b49 --- python/qibuild/test/conftest.py | 3 +++ python/qidoc/test/conftest.py | 2 ++ python/qisrc/test/conftest.py | 6 ++++++ python/qisys/test/conftest.py | 3 +++ python/qitest/test_queue.py | 9 +++++++++ 5 files changed, 23 insertions(+) diff --git a/python/qibuild/test/conftest.py b/python/qibuild/test/conftest.py index c21728600..85ee905e8 100644 --- a/python/qibuild/test/conftest.py +++ b/python/qibuild/test/conftest.py @@ -15,6 +15,9 @@ class TestBuildWorkTree(qibuild.worktree.BuildWorkTree): can create git projects """ + + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, worktree=None): if not worktree: worktree = TestWorkTree() diff --git a/python/qidoc/test/conftest.py b/python/qidoc/test/conftest.py index 6eb689057..b0881bf00 100644 --- a/python/qidoc/test/conftest.py +++ b/python/qidoc/test/conftest.py @@ -12,6 +12,8 @@ class TestDocWorkTree(qidoc.worktree.DocWorkTree): """ A subclass of DocWorkTree that can create doc projects """ + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, worktree=None): if not worktree: worktree = TestWorkTree() diff --git a/python/qisrc/test/conftest.py b/python/qisrc/test/conftest.py index 9eba9a14d..8d19c7e90 100644 --- a/python/qisrc/test/conftest.py +++ b/python/qisrc/test/conftest.py @@ -13,6 +13,9 @@ class TestGitWorkTree(qisrc.worktree.GitWorkTree): can create git projects """ + + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, worktree=None): if not worktree: worktree = TestWorkTree() @@ -278,6 +281,9 @@ def delete_file(self, project, filename): class TestGit(qisrc.git.Git): """ the Git class with a few other helpful methods """ + + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, repo=None): if repo is None: repo = os.getcwd() diff --git a/python/qisys/test/conftest.py b/python/qisys/test/conftest.py index 8dd67f902..d346f9ff5 100644 --- a/python/qisys/test/conftest.py +++ b/python/qisys/test/conftest.py @@ -32,6 +32,9 @@ class TestWorkTree(qisys.worktree.WorkTree): can create projects """ + + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, root=None): if root is None: # TestWorkTree is often used with cd_to_tmpdir fixture, diff --git a/python/qitest/test_queue.py b/python/qitest/test_queue.py index f30833709..85d0d057c 100644 --- a/python/qitest/test_queue.py +++ b/python/qitest/test_queue.py @@ -22,6 +22,9 @@ class TestQueue(object): """ A class able to run tests in parallel """ + + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, tests): self.tests = tests self.test_logger = TestLogger(tests) @@ -155,6 +158,9 @@ class TestWorker(threading.Thread): the test queue, running the tests and logging the results """ + + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, queue, worker_index): super(TestWorker, self).__init__(name="TestWorker#%i" % worker_index) self.index = worker_index @@ -202,6 +208,9 @@ class TestLogger(object): tests, using a mutex so that outputs are not mixed up """ + + __test__ = False # Tell PyTest to ignore this Test* named class: This is as test to collect + def __init__(self, tests): self.mutex = threading.Lock() self.tests = tests