-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix calculate check2 #1
Conversation
Config.orca_keywords = ['PBE', 'def2-SVP', 'EnGrad'] | ||
Config.gaussian_keywords = ['B3LYP', '6-31G(d)', 'Force'] |
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.
Config.orca_keywords = ['PBE', 'def2-SVP', 'EnGrad'] | |
Config.gaussian_keywords = ['B3LYP', '6-31G(d)', 'Force'] | |
gauss_kws = Config.gaussian_keywords | |
orca_kws = Config.orca_keywords | |
Config.orca_keywords = ['PBE', 'def2-SVP', 'EnGrad'] | |
Config.gaussian_keywords = ['B3LYP', '6-31G(d)', 'Force'] | |
yield | |
Config.gaussian_keywords = gauss_kws | |
Config.orca_keywords = orca_kws |
https://docs.pytest.org/en/latest/how-to/fixtures.html#teardown-cleanup-aka-fixture-finalization
tests/test_calculate.py
Outdated
|
||
def test_gaussian_keywords_no_config(): | ||
"""Test _gaussian_keywords raises ValueError when Gaussian keywords are not set""" | ||
Config.gaussian_keywords = None |
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.
default is now None so we should not set it here
Config.gaussian_keywords = None |
tests/test_calculate.py
Outdated
|
||
def test_orca_keywords_no_config(): | ||
"""Test _orca_keywords raises ValueError when ORCA keywords are not set""" | ||
Config.orca_keywords = None |
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.
Config.orca_keywords = None |
tests/test_calculate.py
Outdated
run_autode(configuration, method_name='mock_method', n_cores=1) | ||
|
||
captured = capsys.readouterr() | ||
assert 'Failed to calculate the energy' in captured.out |
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.
assert 'Failed to calculate the energy' in captured.out | |
assert 'Failed to calculate the energy' in captured.err |
def test_orca_keywords_success(set_config): | ||
"""Test _orca_keywords retrieves the ORCA keywords from Config""" | ||
keywords = _orca_keywords() | ||
assert keywords == Config.orca_keywords |
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 it still fail if you try this?
assert keywords == Config.orca_keywords | |
assert keywords._list == Config.orca_keywords._list |
_method_and_keywords('invalid_method') | ||
|
||
|
||
def test_orca_keywords_success(set_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.
def test_orca_keywords_success(set_config): | |
@pytest.mark.xfail | |
def test_orca_keywords_success(set_config): |
* Move all test to new folder * Test only mlptrain folder * Add fixtures * Remove molecules.py
…into fix_calculate_check2
PR to view changes between branches, no to merge