Skip to content

Commit

Permalink
Merge pull request #570 from drothlis/drop-glob2
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux committed Nov 3, 2022
2 parents 33fbca4 + 8123f7a commit 3f6dc87
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
15 changes: 2 additions & 13 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Expand Up @@ -35,7 +35,6 @@ classifiers = [

[tool.poetry.dependencies]
python = "^3.7"
glob2 = "*"
Mako = "*"
parse = "*"
parse-type = "*"
Expand Down Expand Up @@ -83,5 +82,5 @@ warn_unused_configs = true
files = "src/pytest_bdd/**/*.py"

[[tool.mypy.overrides]]
module = ["parse", "parse_type", "glob2"]
module = ["parse", "parse_type"]
ignore_missing_imports = true
7 changes: 4 additions & 3 deletions src/pytest_bdd/feature.py
Expand Up @@ -25,10 +25,9 @@
"""
from __future__ import annotations

import glob
import os.path

import glob2

from .parser import Feature, parse_feature

# Global features dictionary
Expand Down Expand Up @@ -70,7 +69,9 @@ def get_features(paths: list[str], **kwargs) -> list[Feature]:
if path not in seen_names:
seen_names.add(path)
if os.path.isdir(path):
features.extend(get_features(glob2.iglob(os.path.join(path, "**", "*.feature")), **kwargs))
features.extend(
get_features(glob.iglob(os.path.join(path, "**", "*.feature"), recursive=True), **kwargs)
)
else:
base, name = os.path.split(path)
feature = get_feature(base, name, **kwargs)
Expand Down
5 changes: 2 additions & 3 deletions src/pytest_bdd/scripts.py
Expand Up @@ -2,11 +2,10 @@
from __future__ import annotations

import argparse
import glob
import os.path
import re

import glob2

from .generation import generate_code, parse_feature_files

MIGRATE_REGEX = re.compile(r"\s?(\w+)\s=\sscenario\((.+)\)", flags=re.MULTILINE)
Expand All @@ -15,7 +14,7 @@
def migrate_tests(args: argparse.Namespace) -> None:
"""Migrate outdated tests to the most recent form."""
path = args.path
for file_path in glob2.iglob(os.path.join(os.path.abspath(path), "**", "*.py")):
for file_path in glob.iglob(os.path.join(os.path.abspath(path), "**", "*.py"), recursive=True):
migrate_tests_in_file(file_path)


Expand Down

0 comments on commit 3f6dc87

Please sign in to comment.