Skip to content

Allow for pytest #102

@hagenw

Description

@hagenw

unittest is a great starting point for checking the implementation, but I would prefer to allow pytest for testing as well. It allows an easier way to write heavily parametrized tests. See also the discussion at pytorch/pytorch#11578.

It will perfectly fine work together with unittest, so there is no need to rewrite any tests, but it would allow to add new tests using pytest. What we would have to do is to install it, e.g. add a test/requirement.txt file or use pip, basically replace

$ python -m unittest

with

$ pip install pytest  # or: pip install -r test/requirements.txt
$ pytest

BTW, it is used by pytorch/vision on travis, see https://github.com/pytorch/vision/blob/master/.travis.yml#L53

If you would be fine with the proposal, I could create a pull request integrating it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions