Skip to content

TST: Parametrize some linalg tests over types.#11895

Merged
eric-wieser merged 1 commit into
numpy:masterfrom
QuLogic:linalg-parametrize
Sep 6, 2018
Merged

TST: Parametrize some linalg tests over types.#11895
eric-wieser merged 1 commit into
numpy:masterfrom
QuLogic:linalg-parametrize

Conversation

@QuLogic

@QuLogic QuLogic commented Sep 6, 2018

Copy link
Copy Markdown
Contributor

When code does:

def test():
    def check(dtype):
        # code
    for dtype in [types]:
        check(dtype)

replace it with:

@pytest.mark.parametrize('dtype', [types])
def test(dtype):
    # code

The test count should go up by 24 now ((4 each - 1) * 8).

When code does:
```python
def test():
    def check(dtype):
        # code
    for dtype in [types]:
        check(dtype)
```
replace it with:
```python
@pytest.mark.parametrize('dtype', [types])
def test(dtype):
    # code
```
@eric-wieser eric-wieser merged commit b8f3be9 into numpy:master Sep 6, 2018
@eric-wieser

Copy link
Copy Markdown
Member

Thanks!

@eric-wieser

Copy link
Copy Markdown
Member

For some reason, this caused travis to fail: https://travis-ci.org/numpy/numpy/jobs/425358526

@charris

charris commented Sep 6, 2018

Copy link
Copy Markdown
Member

For some reason, this caused travis to fail

Hmm, strange.

@charris

charris commented Sep 6, 2018

Copy link
Copy Markdown
Member

Maybe use setup_function and teardown_function to disable the warnings? Or we could try adding the warning suppression to numpy/_pytesttests.py, the error suppression looks specific enough.

@charris

charris commented Sep 6, 2018

Copy link
Copy Markdown
Member

It is a pytest version problem, fails for me with 3.8.0, worked with 3.6.1.

@charris

charris commented Sep 6, 2018

Copy link
Copy Markdown
Member

Pytest 3.8.0 was released 6 hours ago.

@charris

charris commented Sep 6, 2018

Copy link
Copy Markdown
Member

Submitted an issue with pytest. We might still want to try putting the suppression in numpy/_pytesttester,py

@QuLogic QuLogic deleted the linalg-parametrize branch September 6, 2018 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants