Skip to content

Commit

Permalink
Merge pull request #7 from polinaag/add_bz_marker_for_no_numa_support
Browse files Browse the repository at this point in the history
Added no_numa bz marker.
  • Loading branch information
kobihk authored Apr 11, 2021
2 parents 6939bd9 + 58f6741 commit fdaf2fe
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
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

0 comments on commit fdaf2fe

Please sign in to comment.