2
2
3
3
from __future__ import annotations
4
4
5
- import sys
6
5
from pathlib import Path
7
6
from types import GenericAlias
8
7
from typing import TYPE_CHECKING , get_args
9
8
10
- import pytest
11
-
12
9
from pymatgen .core import Composition , DummySpecies , Element , Species
13
10
from pymatgen .entries import Entry
14
11
from pymatgen .util .typing import CompositionLike , EntryLike , PathLike , PbcLike , SpeciesLike
20
17
__date__ = "2022-10-20"
21
18
22
19
23
- skip_below_py310 = pytest .mark .skipif (sys .version_info < (3 , 10 ), reason = "requires python 3.10 or higher" )
24
-
25
20
26
21
def _type_str (some_type : Any ) -> str :
27
22
return str (some_type ).replace ("typing." , "" ).replace ("pymatgen.core.periodic_table." , "" )
@@ -48,15 +43,13 @@ def test_entry_like():
48
43
assert Entry .__name__ in str (EntryLike )
49
44
50
45
51
- @skip_below_py310
52
46
def test_species_like ():
53
47
assert isinstance ("H" , SpeciesLike )
54
48
assert isinstance (Element ("H" ), SpeciesLike )
55
49
assert isinstance (Species ("H+" ), SpeciesLike )
56
50
assert isinstance (DummySpecies ("X" ), SpeciesLike )
57
51
58
52
59
- @skip_below_py310
60
53
def test_composition_like ():
61
54
assert isinstance ("H" , CompositionLike )
62
55
assert isinstance (Element ("H" ), CompositionLike )
@@ -71,7 +64,6 @@ def test_pbc_like():
71
64
assert get_args (PbcLike ) == (bool , bool , bool )
72
65
73
66
74
- @skip_below_py310
75
67
def test_pathlike ():
76
68
assert isinstance ("path/to/file" , PathLike )
77
69
assert isinstance (Path ("path/to/file" ), PathLike )
0 commit comments