From 763f0f9efe914b3bf9b0343ce99128736335c509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=81zeps=20Benjamins=20Ba=C5=A1ko?= Date: Sat, 20 Jan 2024 11:19:47 +0200 Subject: [PATCH] Fix error when cacheprovider plugin disabled or missing (#56) * Fixes #54 --- README.rst | 6 ++++++ random_order/cache.py | 3 +++ setup.py | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f145049..e4b175d 100644 --- a/README.rst +++ b/README.rst @@ -231,6 +231,12 @@ from being registered so its hooks won't be registered and its command line opti Changelog -------------- +v1.1.1 (2024-01-20) ++++++++++++++++++++ + + * Fixes #54 - ``AttributeError`` when cacheprovider plugin disabled. Thanks @jhanm12 + + v1.1.0 (2022-12-03) +++++++++++++++++++ diff --git a/random_order/cache.py b/random_order/cache.py index c55d30e..44e1ee5 100644 --- a/random_order/cache.py +++ b/random_order/cache.py @@ -9,6 +9,9 @@ def process_failed_first_last_failed(session, config, items): + if not hasattr(config, 'cache'): + return + if not config.getoption('failedfirst'): return diff --git a/setup.py b/setup.py index 3f9b715..8dc41fa 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ def read(fname): setup( name='pytest-random-order', - version='1.1.0', + version='1.1.1', author='Jazeps Basko', author_email='jazeps.basko@gmail.com', maintainer='Jazeps Basko',