Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added no_numa bz marker. #7

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- "2.7"
- "3.4"
install:
- pip install tox tox-travis
Expand Down
9 changes: 8 additions & 1 deletion pytest_marker_bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ def _should_skip_due_to_storage(self, item, storages):
def _should_skip_due_to_ppc(self, item, is_ppc):
return is_ppc is None or is_ppc is True

def _should_skip_due_to_no_numa_support(self, item, no_numa):
return no_numa is None or no_numa is True

def _should_skip(self, item, bz_mark):

is_ppc_affected = self._should_skip_due_to_ppc(
Expand All @@ -190,7 +193,11 @@ def _should_skip(self, item, bz_mark):
item, bz_mark.get('storage')
)

if is_api_affected and is_storage_affected and is_ppc_affected:
is_numa_affected = self._should_skip_due_to_no_numa_support(
item, bz_mark.get('no_numa')
)

if is_api_affected and is_storage_affected and is_ppc_affected and is_numa_affected:
return True

return False
Expand Down
14 changes: 14 additions & 0 deletions tests/test_bugzilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,17 @@ def test_new_bug_but_ppc(self):
""")
result = testdir.runpytest(*BUGZILLA_ARGS)
result.assert_outcomes(0, 1, 0)


def test_skip_because_of_no_numa(testdir):
testdir.makeconftest(CONFTEST)
testdir.makepyfile("""
import os
import pytest

@pytest.mark.bugzilla({'1': {'no_numa': True}})
def test_new_bug_but_no_numa(self):
assert True
""")
result = testdir.runpytest(*BUGZILLA_ARGS)
result.assert_outcomes(0, 1, 0)
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[tox]
envlist = py{27,37}-pytest{361,431}
envlist = py{37}-pytest{391,431}

[tox:travis]
2.7 = py27-pytest361, py27-pytest431, pep8
3.7 = py37-pytest361, py37-pytest431, pep8
3.7 = py37-pytest391, py37-pytest431, pep8

[testenv]
deps =
pytest361: pytest==3.6.1
pytest391: pytest==3.9.1
pytest431: pytest==4.3.1
pytest-xdist
pytest-cov
Expand Down