Skip to content

Commit 31a4291

Browse files
committed
Show new test failure
1 parent e582ba0 commit 31a4291

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
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(normalized_conftestpath)
639+
# normalized_conftestpath = os.path.normcase(conftestpath)
640+
existing = self.get_plugin(str(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=normalized_name)
750+
# normalized_name = name if name is None else os.path.normcase(name)
751+
self.register(conftestmodule, name=name)
752752

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

testing/acceptance_test.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,27 +1416,29 @@ def test_issue_9765(pytester: Pytester) -> None:
14161416

14171417
my_plugin_content = textwrap.dedent(
14181418
"""
1419-
def pytest_configure(config):
1419+
import pytest
1420+
1421+
def pytest_configure(config):
14201422
1421-
class SimplePlugin:
1422-
@pytest.fixture(params=[1, 2, 3])
1423-
def my_fixture(self, request):
1424-
yield request.param
1423+
class SimplePlugin:
1424+
@pytest.fixture(params=[1, 2, 3])
1425+
def my_fixture(self, request):
1426+
yield request.param
14251427
1426-
config.pluginmanager.register(SimplePlugin())
1428+
config.pluginmanager.register(SimplePlugin())
14271429
"""
14281430
)
14291431
pytester.makepyfile(
14301432
**{
14311433
"setup.py": setup_py_content,
1432-
"pyproject.toml": pyproject_toml_content,
14331434
"my_package/__init__.py": "",
14341435
"my_package/conftest.py": "",
14351436
"my_package/test_foo.py": "def test(): pass",
14361437
"my_package/plugin/__init__.py": "",
1437-
"mypackage/plugin/my_plugin.py": my_plugin_content,
1438+
"my_package/plugin/my_plugin.py": my_plugin_content,
14381439
}
14391440
)
1441+
pytester.makefile(**{"pyproject": pyproject_toml_content}, ext=".toml")
14401442

14411443
pytester.chdir()
14421444
subprocess.check_output([sys.executable, "setup.py", "develop"])

testing/test_conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ 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())
215+
# key = os.path.normcase(subconftest.resolve())
216+
key = str(subconftest.resolve())
216217
if name not in ("whatever", ".dotdir"):
217218
assert pm.has_plugin(key)
218219
assert len(set(pm.get_plugins()) - {pm}) == 1

0 commit comments

Comments
 (0)