Skip to content

Commit

Permalink
Merge pull request #6290 from Lembrun/pathlib-/tests/conftest.py
Browse files Browse the repository at this point in the history
Pathlib /tests/conftest.py
  • Loading branch information
The-Compiler committed Mar 19, 2021
2 parents 7207c88 + 169062f commit 3e4be9d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"""The qutebrowser test suite conftest file."""

import os
import pathlib
import sys
import warnings
import pathlib

import pytest
import hypothesis
Expand Down Expand Up @@ -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(os.path.dirname(__file__))
return rel_path == os.path.join('end2end', 'features') and skip_bdd
rel_path = fspath.relative_to(pathlib.Path(__file__).parent)
return rel_path == pathlib.Path('end2end') / 'features' and skip_bdd


@pytest.fixture(scope='session')
Expand Down

0 comments on commit 3e4be9d

Please sign in to comment.