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

Select testing framework #8

Closed
Sinclert opened this issue Feb 20, 2020 · 2 comments
Closed

Select testing framework #8

Sinclert opened this issue Feb 20, 2020 · 2 comments

Comments

@Sinclert
Copy link
Contributor

I am looking into this repository, as it was mentioned in this HEP-Data issue, and I see that there are 2 testing frameworks defined: unittest and pytest.

  • unittest is present on the tests definitions. Example:

        class SubmissionFileValidationTest(unittest.TestCase):
            ...
  • pytests is present on the project dependencies and... setup.py? 🤷🏻‍♂️

Right now, both execution works:

pytests testsuite
python -m unittest testsuite/validation_test.py

However, I find it confusing, and I think that the original idea was to use pytest, but at some point in time some initial "setUp" steps were needed before some tests. That may be when the unittest syntax was introduced.

Could you decide on a given framework?

I would suggest choosing pytest, and replace unittest syntax by pytest fixtures. I can create a proposed PR if agreed.

@GraemeWatt
Copy link
Member

Looking at the history of this repository, the first commit uses only unittest and pytest was introduced later in the second commit (0ed211c). A comment by the original developer indicates that both unittest and pytest were used in the early stages of the project. The hepdata repository for the main web app uses only pytest (including fixtures). The .travis.yml file for this hepdata-validator repository runs pytest testsuite. I agree that it would be good to move to pytest everywhere as a Python testing framework and a PR would be very helpful if you're prepared to do the work. Note that the hepdata-validator code should be compatible with both Python 2 and Python 3 (both are tested in the .travis.yml file).

@Sinclert
Copy link
Contributor Author

PR addressing the migration: #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants