diff --git a/lexicon/tests/providers/test_auto.py b/lexicon/tests/providers/test_auto.py index 2d3872a54..63d6dff66 100644 --- a/lexicon/tests/providers/test_auto.py +++ b/lexicon/tests/providers/test_auto.py @@ -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', @@ -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') diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 000000000..a184787cc --- /dev/null +++ b/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +markers = + ext_suite_1: advanced test suite to cover records sets handling in providers