This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import pytest | |
@pytest.mark.parametrize( | |
'foo, bar', itertools.product(('a', 'b'), (True, False)) | |
) | |
def test_multi(foo, bar): | |
print(foo, bar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
@pytest.mark.parametrize('foo', ('a', 'b')) | |
@pytest.mark.parametrize('bar', (True, False)) | |
def test_multi(foo, bar): | |
print(foo, bar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
======================================================================== | |
Timing Static Methods vs. Inline Functions | |
======================================================================== | |
A simple test to compare the overhead of calling static functions vs. | |
defining and calling inline functions. | |
At least in this experiment, static methods are ~15-20% faster. This | |
is of course not even considering their improvements in testability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test_array = [ | |
[1, 2, 3, 4], | |
[5, 6, 7, 8], | |
[9, 10, 11, 12], | |
] | |
# [2][0] |
OlderNewer