From 5b7ebee35055f3c79297c9a622dbace77b638e8b Mon Sep 17 00:00:00 2001 From: Sadra Barikbin Date: Wed, 2 Aug 2023 11:58:33 +0330 Subject: [PATCH] Apply comments --- src/_pytest/fixtures.py | 4 ++-- testing/python/fixtures.py | 38 -------------------------------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index 7f3d479e7..00c2a8ef4 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -259,7 +259,7 @@ def get_parametrized_fixture_keys( pass else: cs: CallSpec2 = callspec - # cs.indices.items() is random order of argnames. Need to + # cs.indices is random order of argnames. Need to # sort this so that different calls to # get_parametrized_fixture_keys will be deterministic. for argname in sorted(cs.indices): @@ -270,7 +270,7 @@ def get_parametrized_fixture_keys( if scope is Scope.Session: scoped_item_path = None elif scope is Scope.Package: - scoped_item_path = item.path.parent + scoped_item_path = item.path elif scope is Scope.Module: scoped_item_path = item.path elif scope is Scope.Class: diff --git a/testing/python/fixtures.py b/testing/python/fixtures.py index 5f855e6b4..191689d1c 100644 --- a/testing/python/fixtures.py +++ b/testing/python/fixtures.py @@ -4536,41 +4536,3 @@ def test_yield_fixture_with_no_value(pytester: Pytester) -> None: result.assert_outcomes(errors=1) result.stdout.fnmatch_lines([expected]) assert result.ret == ExitCode.TESTS_FAILED - - -@pytest.mark.xfail( - reason="It isn't differentiated between direct `fixture` param and fixture `fixture`. Will be" - "solved by adding `baseid` to `FixtureArgKey`." -) -def test_reorder_with_high_scoped_direct_and_fixture_parametrization( - pytester: Pytester, -): - pytester.makepyfile( - """ - import pytest - - @pytest.fixture(params=[0, 1], scope='module') - def fixture(request): - pass - - def test_1(fixture): - pass - - def test_2(): - pass - - @pytest.mark.parametrize("fixture", [1, 2], scope='module') - def test_3(fixture): - pass - """ - ) - result = pytester.runpytest("--collect-only") - result.stdout.re_match_lines( - [ - r" ", - r" ", - r" ", - r" ", - r" ", - ] - )