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

Unit testing of materials package #214

Open
2 tasks
joelvbernier opened this issue Mar 15, 2021 · 2 comments
Open
2 tasks

Unit testing of materials package #214

joelvbernier opened this issue Mar 15, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request high priority move these to the top of the stack

Comments

@joelvbernier
Copy link
Member

Given the critical functionality of the materials package, it is time that we add some basic unit tests to help prevent bad bugs from being merged into master. For starters I suggest the following:

  • for the reference materials, compare the data in the HDF5 to what gets instantiated in moth the unitcell and PlaneData classes, including
  • cross-check of lattice parameters
  • cross check of, say, the first 10 hkls (probably need some additional static data like and npz in material.testing for this)
  • check for consistency when switching the default material to a different space group (for each of the other 6 non-cubic lattice types)
@joelvbernier joelvbernier added enhancement New feature or request high priority move these to the top of the stack labels Mar 15, 2021
@psavery
Copy link
Collaborator

psavery commented Mar 15, 2021

If we add a script to the tests directory, it should be automatically included when github actions performs the testing. I can help you guys set that up if you'd like.

@psavery
Copy link
Collaborator

psavery commented Mar 15, 2021

So, if I'm recalling things correctly, pytest will import the scripts in that directory and automatically look for functions that start with test_. It assumes those are test functions, and it tries to run them.

There are some other things such as pytest fixtures that are used to make things easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority move these to the top of the stack
Projects
None yet
Development

No branches or pull requests

3 participants