Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: fix test_functional tests failing because of use of pytest.approx #464

Closed
NickleDave opened this issue Mar 13, 2022 · 1 comment
Closed
Assignees
Labels
BUG Something isn't working TST: testing testing
Projects

Comments

@NickleDave
Copy link
Collaborator

https://github.com/NickleDave/vak/runs/5525156504?check_suite_focus=true

=================================== FAILURES ===================================
_________________________________ test_onehot __________________________________

    def test_onehot():
        num_classes = 4
        labels = torch.zeros(2, 2, 1, dtype=torch.int64)
        labels[0, 0, 0] = 0
        labels[0, 1, 0] = 1
        labels[1, 0, 0] = 2
        labels[1, 1, 0] = 3
    
        # convert labels to one hot tensor
        one_hot = F.one_hot(labels, num_classes)
    
>       assert pytest.approx(one_hot[0, labels[0, 0, 0], 0, 0].item(), 1.0)
E       AssertionError: approx() is not supported in a boolean context.
E       Did you mean: `assert a == approx(b)`?

tests/test_nn/test_functional.py:20: AssertionError
@NickleDave NickleDave added BUG Something isn't working TST: testing testing labels Mar 13, 2022
@NickleDave NickleDave self-assigned this Mar 13, 2022
@NickleDave NickleDave added this to To Do in BUG/MAINT Mar 14, 2022
@NickleDave NickleDave moved this from To Do to In Progress in BUG/MAINT Mar 14, 2022
@NickleDave
Copy link
Collaborator Author

Apparently because of this change:
pytest-dev/pytest#9061

This is what I get for not pinning my dev/test requirements

NickleDave added a commit that referenced this issue Mar 14, 2022
@NickleDave NickleDave moved this from In Progress to Done in BUG/MAINT Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working TST: testing testing
Projects
Development

No branches or pull requests

1 participant