Skip to content

Commit 549f70b

Browse files
committed
Go back to fixed code
1 parent 31a4291 commit 549f70b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/_pytest/config/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ def _importconftest(
636636
) -> types.ModuleType:
637637
# Avoid inconsistent path issues on Windows, see
638638
# https://github.com/pytest-dev/pytest/issues/9765
639-
# normalized_conftestpath = os.path.normcase(conftestpath)
640-
existing = self.get_plugin(str(conftestpath))
639+
normalized_conftestpath = os.path.normcase(conftestpath)
640+
existing = self.get_plugin(normalized_conftestpath)
641641
if existing is not None:
642642
return cast(types.ModuleType, existing)
643643

@@ -747,8 +747,8 @@ def consider_conftest(self, conftestmodule: types.ModuleType) -> None:
747747
name = conftestmodule.__file__
748748
# Avoid inconsistent path issues on Windows, see
749749
# https://github.com/pytest-dev/pytest/issues/9765
750-
# normalized_name = name if name is None else os.path.normcase(name)
751-
self.register(conftestmodule, name=name)
750+
normalized_name = name if name is None else os.path.normcase(name)
751+
self.register(conftestmodule, name=normalized_name)
752752

753753
def consider_env(self) -> None:
754754
""":meta private:"""

testing/test_conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ def test_setinitial_conftest_subdirs(pytester: Pytester, name: str) -> None:
212212
subconftest.touch()
213213
pm = PytestPluginManager()
214214
conftest_setinitial(pm, [sub.parent], confcutdir=pytester.path)
215-
# key = os.path.normcase(subconftest.resolve())
216-
key = str(subconftest.resolve())
215+
key = os.path.normcase(subconftest.resolve())
217216
if name not in ("whatever", ".dotdir"):
218217
assert pm.has_plugin(key)
219218
assert len(set(pm.get_plugins()) - {pm}) == 1

0 commit comments

Comments
 (0)