Skip to content

bytes as parameter crashes the expansion #134

@JaimeRoelandts

Description

@JaimeRoelandts

Using bytes as input parameter of a unittest will crash due to expansion issues.

e.g.

@parameterized.expand([                                                                                                                                                                                                                                                        
        ("a"*16),                                 #is fine                                                                                                                                                                                                                                 
        ("a" * 8 + "b" * 8),                   #is fine                                                                                                                                                                                                                                   
        (b"abcd" * 4)                          #will crash                                                                                                                                                                                                                                    
        ])                                                                                                                                                                                                                                                                         
    def test_value(self, case): 
        self.assertTrue(True)

Error message:

ERROR: test_value_2 (__main__.TestVal)                                                                                                                                                                                                                                       
----------------------------------------------------------------------                                                                                                                                                                                                             
Traceback (most recent call last):                                                                                                                                                                                                                                                 
  File "~/.local/lib/python3.9/site-packages/parameterized/parameterized.py", line 392, in standalone_func                                                                                                                                                            
    return func(*(a + p.args), **p.kwargs)                                                                                                                                                                                                                                         
TypeError: test_value() takes 2 positional arguments but 17 were given     

Metadata

Metadata

Assignees

No one assigned

    Labels

    pr-wantedIt would be great if someone wrote a PR for this!

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions