[FEATURE] Parameterize testing
See original GitHub issue🚨🚨 Feature Request
- Related to an existing Issue
- A new implementation (Improvement, Extension)
Improve test coverage by evaluating multiple arguments.
For example, this function tests float32
(which should throw an exception) but should test other dtypes (uint16
, unint32
, int16
,…).
def test_image():
with pytest.raises(ValueError):
image = Image((1920, 1080, 3), "float32")
If your feature will improve HUB
Makes Hub more robust by improving test coverage.
Description of the possible solution
pytest can pass multiple arguments to a test function:
test_inputs = [1, 2, 3]
@pytest.mark.parameterized("foo", test_inputs)
def test_stuff(foo):
assert type(foo) == int
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
Parameterize BDD Tests | TestComplete Documentation
In BDD tests, you parameterize test steps, not scenarios or features. That is, you set parameters for the Given , When , and...
Read more >How to parametrize values in cucumber - Webkul
On running this class,the login credentials i.e username and password will get filled from feature file with new values each time till the...
Read more >Data Driven Testing in Cucumber - Tools QA
Parameterizing without Example Keyword · Go to the Feature File and change the statement where passing Username & Password as per below: ·...
Read more >JUnit Parameterized Test with Example using @Parameters
Parameterized test enables developer to execute the same test over and over again using different values. It helps developer to save time in ......
Read more >Parametrizing fixtures and test functions — pytest documentation
@pytest.mark.parametrize allows one to define multiple sets of arguments and fixtures at the test function or class. · pytest_generate_tests allows one to define ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The current problem with this issue is when there is no support for other dtypes, It has been created and checked for errors if any other dtype is passed other than uint8,uint16. The PR is here. Now I have included support for all float and integer variants, We probably need to update the test cases to check the int and float variant tests and raise ValueError if any unsupported dtype is passed.
If you added support for those dtypes, then you should switch testing against raising Error, now you need to test if you can create image with such dtypes (instead of checking if throws an error.)