-
Notifications
You must be signed in to change notification settings - Fork 867
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
Test monty
fix for reverse_readline
#4068
Draft
DanielYang59
wants to merge
13
commits into
materialsproject:master
Choose a base branch
from
DanielYang59:test-monty-reverse-read
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Test monty
fix for reverse_readline
#4068
DanielYang59
wants to merge
13
commits into
materialsproject:master
from
DanielYang59:test-monty-reverse-read
+33
−18
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
DanielYang59
force-pushed
the
test-monty-reverse-read
branch
from
September 15, 2024 05:35
c234535
to
7d2ed7b
Compare
DanielYang59
changed the title
Test
Test Oct 10, 2024
monty
fix for reverse readlinemonty
fix for reverse_readline
DanielYang59
commented
Nov 8, 2024
@@ -831,9 +833,20 @@ def test_parse_potcar_cwd_relative(self): | |||
assert vrun.potcar_spec[ipot]["summary_stats"] == potcar[ipot]._summary_stats | |||
|
|||
|
|||
class TestOutcar(PymatgenTest): |
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 to avoid inheriting from PymatgenTest
as TestCase
(and its subclasses) currently don't support parametrize, I believe this wouldn't affect this test as no PymatgenTest/TestCase
specific method is used here.
A quick recreate:
from unittest import TestCase
import pytest
class TestDemo(TestCase): # `class TestDemo` works just fine
@pytest.mark.parametrize("string", ["hello", "world"])
def test_hello(self, string):
print(string)
pytest.fail("should fail, test")
Would give:
====================================================== test session starts =======================================================
platform darwin -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/yang/developer/test
plugins: anyio-4.6.2.post1
collected 1 item
test_pytest.py F [100%]
============================================================ FAILURES ============================================================
______________________________________________________ TestDemo.test_hello _______________________________________________________
self = <unittest.case._Outcome object at 0x103480950>, test_case = <test_pytest.TestDemo testMethod=test_hello>, subTest = False
@contextlib.contextmanager
def testPartExecutor(self, test_case, subTest=False):
old_success = self.success
self.success = True
try:
> yield
/opt/homebrew/Cellar/[email protected]/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py:58:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/homebrew/Cellar/[email protected]/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py:634: in run
self._callTestMethod(testMethod)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test_pytest.TestDemo testMethod=test_hello>
method = <bound method TestDemo.test_hello of <test_pytest.TestDemo testMethod=test_hello>>
def _callTestMethod(self, method):
> if method() is not None:
E TypeError: TestDemo.test_hello() missing 1 required positional argument: 'string'
/opt/homebrew/Cellar/[email protected]/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/unittest/case.py:589: TypeError
==================================================== short test summary info =====================================================
FAILED test_pytest.py::TestDemo::test_hello - TypeError: TestDemo.test_hello() missing 1 required positional argument: 'string'
======================================================= 1 failed in 0.04s ========================================================
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
monty
fix for reverse readline, to close Outcar class returns empty magnetization attribute when parsing OUTCAR file on Windows operating system #4033reverse_readline
with fasterreverse_readfile
monty
importspymatgen/tests/io/vasp/test_outputs.py
Lines 802 to 823 in 60464fd