From 479c6512b5b2eb0f7f9b9b041d2e3fe3a4239ae0 Mon Sep 17 00:00:00 2001 From: Lembrun Date: Wed, 3 Mar 2021 15:59:25 +0100 Subject: Replaced os.path by pathlib equivalent in tests/conftest.py --- tests/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index ea7381a2f..1f064649e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -22,6 +22,7 @@ """The qutebrowser test suite conftest file.""" import os +import pathlib import sys import warnings import pathlib @@ -190,8 +191,8 @@ def pytest_collection_modifyitems(config, items): def pytest_ignore_collect(path): """Ignore BDD tests if we're unable to run them.""" skip_bdd = hasattr(sys, 'frozen') - rel_path = path.relto(os.path.dirname(__file__)) - return rel_path == os.path.join('end2end', 'features') and skip_bdd + rel_path = path.relto(pathlib.Path(__file__).parent) + return rel_path == pathlib.Path('end2end').joinpath('end2end') and skip_bdd @pytest.fixture(scope='session') -- cgit v1.2.3-54-g00ecf From 6eb12de2746f99ec4f48f0505b9dda35c7554589 Mon Sep 17 00:00:00 2001 From: Lembrun Date: Wed, 10 Mar 2021 13:56:19 +0100 Subject: Removed unused import --- tests/conftest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1f064649e..c400a0756 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,6 @@ import os import pathlib import sys import warnings -import pathlib import pytest import hypothesis -- cgit v1.2.3-54-g00ecf From 4188598952c3d8c11d27e3d70df3b3ebb2a65aa9 Mon Sep 17 00:00:00 2001 From: Lembrun Date: Thu, 11 Mar 2021 08:47:04 +0100 Subject: Changed joinpath to / --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 48bef908a..0ed749e04 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -185,7 +185,7 @@ def pytest_ignore_collect(path): """Ignore BDD tests if we're unable to run them.""" skip_bdd = hasattr(sys, 'frozen') rel_path = path.relto(pathlib.Path(__file__).parent) - return rel_path == pathlib.Path('end2end').joinpath('end2end') and skip_bdd + return rel_path == pathlib.Path('end2end') / 'end2end' and skip_bdd @pytest.fixture(scope='session') -- cgit v1.2.3-54-g00ecf From 5faf293856fdbe606b945830e00a594a308603f4 Mon Sep 17 00:00:00 2001 From: Lembrun Date: Tue, 16 Mar 2021 16:37:28 +0100 Subject: added str --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0ed749e04..0047f7c3d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -184,7 +184,7 @@ def pytest_collection_modifyitems(config, items): def pytest_ignore_collect(path): """Ignore BDD tests if we're unable to run them.""" skip_bdd = hasattr(sys, 'frozen') - rel_path = path.relto(pathlib.Path(__file__).parent) + rel_path = path.relto(str(pathlib.Path(__file__).parent)) return rel_path == pathlib.Path('end2end') / 'end2end' and skip_bdd -- cgit v1.2.3-54-g00ecf From f0c13a7abef0f712dd135c9217df39d09f2803d8 Mon Sep 17 00:00:00 2001 From: Lembrun Date: Fri, 19 Mar 2021 13:53:53 +0100 Subject: Added fspath = pathlib.Path(path) --- tests/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 0047f7c3d..084acddc5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -183,9 +183,10 @@ def pytest_collection_modifyitems(config, items): def pytest_ignore_collect(path): """Ignore BDD tests if we're unable to run them.""" + fspath = pathlib.Path(path) skip_bdd = hasattr(sys, 'frozen') - rel_path = path.relto(str(pathlib.Path(__file__).parent)) - return rel_path == pathlib.Path('end2end') / 'end2end' and skip_bdd + rel_path = fspath.is_relative_to(pathlib.Path(__file__).parent) + return rel_path == pathlib.Path('end2end') / 'features' and skip_bdd @pytest.fixture(scope='session') -- cgit v1.2.3-54-g00ecf From 169062f646a33947ea245c1fbfa540306ea4842c Mon Sep 17 00:00:00 2001 From: Lembrun Date: Fri, 19 Mar 2021 14:06:43 +0100 Subject: relative_to instead of is_relative --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 8e35e1c24..6275cdd02 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -185,7 +185,7 @@ def pytest_ignore_collect(path): """Ignore BDD tests if we're unable to run them.""" fspath = pathlib.Path(path) skip_bdd = hasattr(sys, 'frozen') - rel_path = fspath.is_relative_to(pathlib.Path(__file__).parent) + rel_path = fspath.relative_to(pathlib.Path(__file__).parent) return rel_path == pathlib.Path('end2end') / 'features' and skip_bdd -- cgit v1.2.3-54-g00ecf