{"library":"pytest-astropy","title":"pytest-astropy","description":"pytest-astropy is a meta-package that consolidates and provides testing dependencies and various pytest plugins used by the Astropy Project and its affiliated packages. It aims to simplify test setup for projects within the Astropy ecosystem and can also be used by other Python projects. The library is actively maintained, with its current version being 0.11.0, and receives regular updates.","language":"python","status":"active","last_verified":"Sun May 17","install":{"commands":["pip install pytest-astropy"],"cli":null},"imports":["import pytest\n@pytest.mark.slow\ndef test_something_slow(): ...","import pytest\n@pytest.mark.hugemem\ndef test_something_using_lots_of_memory(): ...","import pytest\n@pytest.mark.remote_data\ndef test_requires_internet(): ...","from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS\ndef pytest_configure(config):\n    config.option.astropy_header = True\n    PYTEST_HEADER_MODULES['Astropy'] = 'astropy'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# conftest.py\nimport pytest\nfrom pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS\n\ndef pytest_configure(config):\n    config.option.astropy_header = True\n    PYTEST_HEADER_MODULES['Astropy'] = 'astropy'\n\n# test_example.py\nimport pytest\n\n@pytest.mark.slow\ndef test_a_slow_calculation():\n    \"\"\"This test simulates a slow operation.\"\"\"\n    # Simulate a slow operation\n    sum(range(10**7))\n    assert True\n\n@pytest.mark.remote_data\ndef test_fetch_remote_data():\n    \"\"\"This test requires remote data access.\"\"\"\n    # Example: This test would typically try to fetch data from the internet.\n    # It will be skipped by default unless --remote-data is specified.\n    # import urllib.request\n    # with urllib.request.urlopen(\"https://www.google.com\") as response:\n    #     assert response.getcode() == 200\n    assert True # Placeholder for actual remote data logic\n\n# To run the slow test:\n# pytest --run-slow\n\n# To run remote data tests:\n# pytest --remote-data=any","lang":"python","description":"To quickly get started, create a `conftest.py` file in your project's root or test directory to configure the Astropy test header. Then, define tests using markers like `pytest.mark.slow` for computationally intensive tests or `pytest.mark.remote_data` for tests requiring internet access. These markers are enabled by the plugins within `pytest-astropy`. Slow and remote data tests are skipped by default and require specific command-line flags to be run.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"0.11.0","pypi_latest":"0.11.0","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":6.6,"avg_import_s":0.43,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.43,"mem_mb":12.2,"disk_size":"108.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":7.2,"import_time_s":0.3,"mem_mb":12.2,"disk_size":"105M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.55,"mem_mb":12.9,"disk_size":"118.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":6.3,"import_time_s":0.48,"mem_mb":12.9,"disk_size":"114M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.49,"mem_mb":12.8,"disk_size":"106.4M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.6,"import_time_s":0.49,"mem_mb":12.8,"disk_size":"102M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.44,"mem_mb":11.8,"disk_size":"106.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":5.6,"import_time_s":0.42,"mem_mb":11.8,"disk_size":"102M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.36,"mem_mb":11.2,"disk_size":"116.3M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pytest-astropy","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":8.1,"import_time_s":0.34,"mem_mb":11.2,"disk_size":"115M"}]}}