Skip to content

Commit 3f6dc87

Browse files
authored
Merge pull request #570 from drothlis/drop-glob2
2 parents 33fbca4 + 8123f7a commit 3f6dc87

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

poetry.lock

Lines changed: 2 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ classifiers = [
3535

3636
[tool.poetry.dependencies]
3737
python = "^3.7"
38-
glob2 = "*"
3938
Mako = "*"
4039
parse = "*"
4140
parse-type = "*"
@@ -83,5 +82,5 @@ warn_unused_configs = true
8382
files = "src/pytest_bdd/**/*.py"
8483

8584
[[tool.mypy.overrides]]
86-
module = ["parse", "parse_type", "glob2"]
85+
module = ["parse", "parse_type"]
8786
ignore_missing_imports = true

src/pytest_bdd/feature.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,9 @@
2525
"""
2626
from __future__ import annotations
2727

28+
import glob
2829
import os.path
2930

30-
import glob2
31-
3231
from .parser import Feature, parse_feature
3332

3433
# Global features dictionary
@@ -70,7 +69,9 @@ def get_features(paths: list[str], **kwargs) -> list[Feature]:
7069
if path not in seen_names:
7170
seen_names.add(path)
7271
if os.path.isdir(path):
73-
features.extend(get_features(glob2.iglob(os.path.join(path, "**", "*.feature")), **kwargs))
72+
features.extend(
73+
get_features(glob.iglob(os.path.join(path, "**", "*.feature"), recursive=True), **kwargs)
74+
)
7475
else:
7576
base, name = os.path.split(path)
7677
feature = get_feature(base, name, **kwargs)

src/pytest_bdd/scripts.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
from __future__ import annotations
33

44
import argparse
5+
import glob
56
import os.path
67
import re
78

8-
import glob2
9-
109
from .generation import generate_code, parse_feature_files
1110

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

2120

0 commit comments

Comments
 (0)