Skip to content

Many tests fail with errors: AttributeError: 'Namespace' object has no attribute 'save' #2462

@yurivict

Description

@yurivict

Describe the bug
Hundreds of plot-related tests fail with errors like these:

_______________________________________________________________ ERROR at setup of test_plot_ts[kwargs8] _______________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
__________________________________________________________ ERROR at setup of test_plot_ts_multidim[kwargs0] ___________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
__________________________________________________________ ERROR at setup of test_plot_ts_multidim[kwargs1] ___________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
__________________________________________________________ ERROR at setup of test_plot_ts_multidim[kwargs2] ___________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
_____________________________________________________ ERROR at setup of test_plot_ts_valueerror[val_err_kwargs0] ______________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
_____________________________________________________ ERROR at setup of test_plot_ts_valueerror[val_err_kwargs1] ______________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
___________________________________________________________________ ERROR at setup of test_plot_bf ____________________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
____________________________________________________________ ERROR at setup of test_plot_lm[True-lines-1d] ____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
____________________________________________________________ ERROR at setup of test_plot_lm[True-lines-2d] ____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
_____________________________________________________________ ERROR at setup of test_plot_lm[True-hdi-1d] _____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
_____________________________________________________________ ERROR at setup of test_plot_lm[True-hdi-2d] _____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
___________________________________________________________ ERROR at setup of test_plot_lm[False-lines-1d] ____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
___________________________________________________________ ERROR at setup of test_plot_lm[False-lines-2d] ____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
____________________________________________________________ ERROR at setup of test_plot_lm[False-hdi-1d] _____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError
____________________________________________________________ ERROR at setup of test_plot_lm[False-hdi-2d] _____________________________________________________________

self = <_pytest.config.Config object at 0x3b47e314190>, name = 'save', default = <NOTSET>, skip = False

    def getoption(self, name: str, default=notset, skip: bool = False):
        """Return command line option value.
    
        :param name: Name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :param default: Default value if no option of that name exists.
        :param skip: If True, raise pytest.skip if option does not exists
            or has a None value.
        """
        name = self._opt2dest.get(name, name)
        try:
>           val = getattr(self.option, name)
E           AttributeError: 'Namespace' object has no attribute 'save'

/usr/local/lib/python3.11/site-packages/_pytest/config/__init__.py:1689: AttributeError

The above exception was the direct cause of the following exception:

request = <SubRequest 'save_figs' for <Function test_plot_density_float[kwargs0]>>

    @pytest.fixture(scope="session")
    def save_figs(request):
        """Enable command line switch for saving generation figures upon testing."""
>       fig_dir = request.config.getoption("--save")
E       ValueError: no option named 'save'

arviz/tests/conftest.py:26: ValueError

To Reproduce
pytest

Expected behavior
n/a

Additional context
Version: 0.22.0
matplotlib-3.8.0
Python-3.11
FreeBSD 14.3

$ pkg info | grep pytest
py311-pytest-8.1.1,1           Simple powerful testing with Python
py311-pytest-cov-5.0.0_1       Pytest plugin for measuring coverage
py311-pytest-xdist-3.6.1,1     Pytest xdist plugin for distributed testing and loop-on-failing modes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions