-
Notifications
You must be signed in to change notification settings - Fork 2
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
initial testing framework #7
initial testing framework #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments that I think should be addressed, but not in this PR. Feel free to merge.
import pytest | ||
|
||
|
||
def pytest_addoption(parser): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this function have to be called pytest_addoption
for some reason? Without an underscore between add and option it looks like you've misspelled adoption
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunately pytest boilerplate stuff: https://docs.pytest.org/en/7.1.x/example/simple.html
parser.addoption("--runslow", action="store_true", default=False, help="run slow tests") | ||
|
||
|
||
def pytest_configure(config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is all this doing? Isn't there a native option to mark tests as slow that we've already been using?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I'm aware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does look like there's a package we can download if we'd like to instead: https://pypi.org/project/pytest-skip-slow/
I'm surprised this isn't just default pytest
tests/unit/conftest.py
Outdated
|
||
|
||
@pytest.fixture() | ||
def noise_requirements() -> Dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you envisioning this being used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it. It was lingering from a test I decided against after chatting w/ Matt
def test_default_configuration(): | ||
config = get_default_configuration() | ||
assert config | ||
assert isinstance(config, ConfigTree) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should test that this configuration actually matches what we'd expect it to be. We can do this either by comparing it to the values in the yaml file, or by just confirming that the correct call to config_tree.update()
was made in the function. The latter seems preferable to me as a unit test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's kinda what I was getting at earlier when I mentioned a test that loads the default and compares it to a "new" default. Not sure offhand how to test more directly. will add a dummy test
Title: Set up testing framework
Description
Set up framework for unit/integration tests. Most tests are skipped as TODOs
for when the relevant functionality gets added.
Testing
pytests pass