diff --git a/pyproject.toml b/pyproject.toml index 2a219a6e..ea0cc143 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -106,3 +106,4 @@ lint.select = [ ] lint.isort.required-imports = ["from __future__ import annotations"] +lint.isort.known-first-party = ["monty"] diff --git a/tests/test_json.py b/tests/test_json.py index 097f1f53..055c8428 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -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 @@ -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") @@ -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 diff --git a/tests/test_serialization.py b/tests/test_serialization.py index d2e0cf9c..6d1e8ab9 100644 --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -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