pyps4-2ndscreen icon indicating copy to clipboard operation
pyps4-2ndscreen copied to clipboard

Removing state pollution in 'data'

Open sturmianseq opened this issue 3 years ago • 0 comments

This PR aims to improve test reliability of test test_result_item_missing_data by removing state pollution of data by making a deepcopy.

The test can fail in this way by running pip3 install pytest-repeat; python3 -m pytest --count=2 tests/test_media_art.py::test_result_item_missing_data:

    async def test_result_item_missing_data():
        """Test Parsing with missing keys returns None."""
        data = MOCK_DATA
>       data.pop("gameContentTypesList")
E       KeyError: 'gameContentTypesList'

tests/test_media_art.py:335: KeyError

It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state pollution.

sturmianseq avatar Dec 15 '21 17:12 sturmianseq