Skip to content

Commit

Permalink
try to fix linting error, materialsvirtuallab#702
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Oct 20, 2024
1 parent fe58998 commit 200da7e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ lint.select = [
]

lint.isort.required-imports = ["from __future__ import annotations"]
lint.isort.known-first-party = ["monty"]
25 changes: 12 additions & 13 deletions tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
from typing import Union

import numpy as np
import pytest
from monty.json import (
MontyDecoder,
MontyEncoder,
MSONable,
_load_redirect,
jsanitize,
load,
)

from . import __version__ as TESTS_VERSION

try:
import pandas as pd
Expand All @@ -35,18 +46,6 @@
except ImportError:
ObjectId = None

import pytest
from monty.json import (
MontyDecoder,
MontyEncoder,
MSONable,
_load_redirect,
jsanitize,
load,
)

from . import __version__ as tests_version

TEST_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_files")


Expand Down Expand Up @@ -317,7 +316,7 @@ def test_unsafe_hash(self):
def test_version(self):
obj = self.good_cls("Hello", "World", "Python")
d = obj.as_dict()
assert d["@version"] == tests_version
assert d["@version"] == TESTS_VERSION

def test_nested_to_from_dict(self):
GMC = GoodMSONClass
Expand Down
5 changes: 2 additions & 3 deletions tests/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
import unittest

import pytest
from monty.serialization import dumpfn, loadfn
from monty.tempfile import ScratchDir

try:
import msgpack
except ImportError:
msgpack = None

from monty.serialization import dumpfn, loadfn
from monty.tempfile import ScratchDir


class TestSerial:
@classmethod
Expand Down

0 comments on commit 200da7e

Please sign in to comment.