Skip to content

Commit

Permalink
Merge 8eada67 into 010eeef
Browse files Browse the repository at this point in the history
  • Loading branch information
adferrand authored May 5, 2020
2 parents 010eeef + 8eada67 commit bec60b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lexicon/tests/providers/test_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
# Then it will prevent errors where there is no network or tested domain do not exists anymore.
@pytest.fixture(autouse=True)
def _nslookup_mock(request):
_ignore_nslookup_mock = request.node.get_closest_marker('ignore_nslookup_mock')

if _ignore_nslookup_mock:
# Do not mock if the test says so.
if request.node.name == 'test_nslookup_resolution':
# Do not mock for the test that specifically test nslookup resolution.
yield
else:
with mock.patch('lexicon.providers.auto._get_ns_records_for_domain',
Expand Down Expand Up @@ -54,7 +52,6 @@ def _test_fallback_fn(self):
# Here we do not mock the function _get_ns_records_domains_for_domain
# to effectively test the nslookup call and processing.\
@pytest.mark.skipif(_there_is_no_network(), reason='No network, no nslookup call possible.')
@pytest.mark.ignore_nslookup_mock('yes')
def test_nslookup_resolution(self): # pylint: disable=no-self-use
"""Ensure that nameservers can be resolved through os nslookup call."""
assert _get_ns_records_domains_for_domain('google.com')
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
ext_suite_1: advanced test suite to cover records sets handling in providers

0 comments on commit bec60b4

Please sign in to comment.