Skip to content

Commit

Permalink
[#2] Suppress abusive pytest warnings
Browse files Browse the repository at this point in the history
Change-Id: I13eb08420bf9d7f57e0d37fc18cfcc9d7a749b49
  • Loading branch information
Julien Blondeau committed Feb 5, 2018
1 parent ff9e898 commit 85ea88f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/qibuild/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions python/qidoc/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 6 additions & 0 deletions python/qisrc/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions python/qisys/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 9 additions & 0 deletions python/qitest/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 85ea88f

Please sign in to comment.