Skip to content

parametrize fails when values are unhashable #244

Closed

Description

@pytestbot

Originally reported by: Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt)


seems like a recent change in parametrizing disallows hashable items
this broke the hgdistver testsuite


Activity

  1. pytestbot commented on Feb 12, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    Can you create a little example?

  2. pytestbot commented on Feb 12, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


    removed, mistake

  3. pytestbot commented on Feb 12, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Ronny Pfannschmidt (BitBucket: RonnyPfannschmidt, GitHub: RonnyPfannschmidt):


    #!python
    
    archival_mapping = {
        '1.0': {'tag': '1.0'},
        '1.2.2a1': {'tag': 'release-1.2.2a1'},
    }
    import pytest
    @pytest.mark.parametrize('expected data'.split(),
                             archival_mapping.items(),
                             archival_mapping)
    def test_archival_to_version(expected, data):
        pass
    
  4. pytestbot commented on Feb 19, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Mark Tsuchida (BitBucket: marktsuchida, GitHub: marktsuchida):


    This might not add anything, but I've encountered the same problem with pytest 2.3.4 and Python 3.3.0, using the following example.

    #!python
    
    import pytest
    
    @pytest.fixture(params=[[1, 2], [3, 4]])
    def myfixture(request): 
        pass
    
    def test_nothing(myfixture):
        pass
    
    
  5. pytestbot commented on Sep 5, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    working on this

  6. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    @bubenkoff any progress?

  7. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    I mentioned this before, the case worked, so test just passes
    test was merged i think

  8. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    my memory is partially outsourced, didn't you know?

    More seriously, someone showed me a failure at PyconDE that looked much like this issue. This reproduces it:

    #!python
    
    import pytest
    
    def pytest_generate_tests(metafunc):
        metafunc.parametrize("x", [{},{}], indirect=True)
    
    @pytest.fixture
    def x(request):
        return request.param
    
    def test_hello(x):
        assert x
    
    
  9. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    here's the PR i did to reproduce
    https://bitbucket.org/hpk42/pytest/pull-request/68/parametrize-fails-when-values-are/diff

  10. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    https://bitbucket.org/hpk42/pytest/pull-request/68/parametrize-fails-when-values-are/diff
    here's the MR i did to reproduce

  11. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    it's not using the "indirect" parameter which seems to be the failing case currently.

  12. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    but indirect wasn't mentioned in this issue at all

  13. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    sure, to be clear, i am not blaming you for anythying. Just noting that there still is an issue that fits under the title. If you can't/don't want to care i can take a look.

  14. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    no, im not trying to quit, i just wasn't aware that it's an issue only when using indirect
    actually i even wrote a fix (before running test)
    but then i reverted it as test passed anyway :)

  15. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    so in conclusion, then i'll continue on this :)

  16. pytestbot commented on Oct 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    great :)

  17. pytestbot commented on Nov 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    @bubenkoff are you still up for the issue? If not please drop a quick note here.

  18. pytestbot commented on Nov 21, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    sorry, still in todo
    will try to finish this week

  19. pytestbot commented on Nov 25, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    @bubenkoff can you try to resolve this issue or un-assign yourselve until thursday?

  20. pytestbot commented on Dec 3, 2013

    @pytestbot
    ContributorAuthor

    Original comment by Anatoly Bubenkov (BitBucket: bubenkoff, GitHub: bubenkoff):


    https://bitbucket.org/hpk42/pytest/pull-request/88/parametrize-fails-when-values-are/diff closes this

  21. pytestbot commented on Dec 3, 2013

    @pytestbot
    ContributorAuthor

    Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42):


    This was fixed by Anatoly and me on trunk.

  22. added a commit that references this issue on Oct 27, 2018
    07b1b2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions