From 9f6d12d5649603e4b64af25f596f7bf855ef588a Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 9 Jun 2023 18:08:00 -0700 Subject: [PATCH] redo hack --- drms/tests/conftest.py | 11 ++++------- drms/tests/test_jsoc_email.py | 3 --- drms/tests/test_jsoc_export.py | 6 ------ setup.cfg | 8 +------- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/drms/tests/conftest.py b/drms/tests/conftest.py index 1ac3fb2..6f89e7f 100644 --- a/drms/tests/conftest.py +++ b/drms/tests/conftest.py @@ -53,19 +53,16 @@ def pytest_runtest_setup(item): if not kis_reachable(): pytest.skip("KIS is not reachable") - # Skip export tests if no email address was specified. - if item.get_closest_marker("export") is not None: - email = item.config.getoption("email", None) - if email is None: - pytest.skip("No email address specified; use the --email option to enable export tests") - @pytest.fixture def email(request): """ Email address from --email command line option. """ - return request.config.getoption("--email", None) + email = request.config.getoption("--email", None, skip=True) + if email is None: + pytest.skip("No email address specified; use the --email option to enable export tests") + return email @pytest.fixture diff --git a/drms/tests/test_jsoc_email.py b/drms/tests/test_jsoc_email.py index cfb7a4f..5b3c2d9 100644 --- a/drms/tests/test_jsoc_email.py +++ b/drms/tests/test_jsoc_email.py @@ -38,7 +38,6 @@ def test_email_invalid_init(email): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_email_cmdopt_check(email): c = drms.Client("jsoc") @@ -46,7 +45,6 @@ def test_email_cmdopt_check(email): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_email_cmdopt_set(email): c = drms.Client("jsoc") @@ -55,7 +53,6 @@ def test_email_cmdopt_set(email): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_email_cmdopt_init(email): c = drms.Client("jsoc", email=email) diff --git a/drms/tests/test_jsoc_export.py b/drms/tests/test_jsoc_export.py index 82c1893..33e7598 100644 --- a/drms/tests/test_jsoc_export.py +++ b/drms/tests/test_jsoc_export.py @@ -4,7 +4,6 @@ @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data @pytest.mark.parametrize("method", ["url_quick", "url"]) def test_export_asis_basic(jsoc_client_export, method): @@ -34,7 +33,6 @@ def test_export_asis_basic(jsoc_client_export, method): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_export_fits_basic(jsoc_client_export): r = jsoc_client_export.export( @@ -63,7 +61,6 @@ def test_export_fits_basic(jsoc_client_export): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_export_im_patch(jsoc_client_export): # TODO: check that this has actually done the export/processing properly? @@ -109,7 +106,6 @@ def test_export_im_patch(jsoc_client_export): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_export_rebin(jsoc_client_export): # TODO: check that this has actually done the export/processing properly? @@ -141,7 +137,6 @@ def test_export_rebin(jsoc_client_export): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_export_invalid_process(jsoc_client_export): with pytest.raises(ValueError, match="foobar is not one of the allowed processing options"): @@ -151,7 +146,6 @@ def test_export_invalid_process(jsoc_client_export): @pytest.mark.jsoc -@pytest.mark.export @pytest.mark.remote_data def test_export_email(jsoc_client): with pytest.raises(ValueError): diff --git a/setup.cfg b/setup.cfg index 6a274fe..4e6dc37 100644 --- a/setup.cfg +++ b/setup.cfg @@ -66,16 +66,12 @@ testpaths = "drms" "docs" norecursedirs = ".tox" "build" "docs[\/]_build" "docs[\/]generated" "*.egg-info" "examples" ".history" "paper" "drms[\/]_dev" doctest_plus = enabled doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS -addopts = --strict-markers --doctest-rst -p no:unraisableexception -p no:threadexception +addopts = --doctest-rst -p no:unraisableexception -p no:threadexception markers = remote_data: marks this test function as needing remote data. jsoc: marks the test function as needing a connection to JSOC. kis: marks the test function as needing a connection to KIS. - export: marks the test function as needing a JSOC registered email address. - xdist_group: sunpy thing - flaky: sunpy thing remote_data_strict = True -junit_family=xunit2 filterwarnings = error # Do not fail on pytest config issues (i.e. missing plugins) but do show them @@ -85,8 +81,6 @@ filterwarnings = # See https://github.com/numpy/numpy/issues/15748#issuecomment-598584838 ignore:numpy.ufunc size changed:RuntimeWarning ignore:numpy.ndarray size changed:RuntimeWarning - # https://github.com/pytest-dev/pytest-cov/issues/557 - ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning [pycodestyle] max_line_length = 110