2
2
import subprocess
3
3
import tomli
4
4
import pytest
5
- from packaging import version
6
5
7
6
8
7
@pytest .fixture (scope = "module" )
9
8
def toml_data ():
10
- file_path = "pyproject.toml"
9
+ file_path = "../../ pyproject.toml"
11
10
if not os .path .exists (file_path ):
12
11
pytest .fail ("pyproject.toml not found in the current directory." )
13
12
with open (file_path , "rb" ) as f :
14
13
return tomli .load (f )
15
14
16
15
17
16
def test_toml_syntax ():
18
- file_path = "pyproject.toml"
17
+ file_path = "../../ pyproject.toml"
19
18
try :
20
19
with open (file_path , "rb" ) as f :
21
20
tomli .load (f )
@@ -37,28 +36,3 @@ def test_build_system(toml_data):
37
36
assert (
38
37
"build-backend" in build_system
39
38
), "Build system 'build-backend' is missing."
40
-
41
-
42
- def test_package_build ():
43
- try :
44
- subprocess .run (["python" , "-m" , "build" ], check = True )
45
- except subprocess .CalledProcessError :
46
- pytest .fail ("Failed to build package." )
47
-
48
-
49
- def test_package_installation ():
50
- try :
51
- subprocess .run (["pip" , "install" , "." ], check = True )
52
- except subprocess .CalledProcessError :
53
- pytest .fail ("Failed to install package." )
54
-
55
-
56
- def test_run_tests ():
57
- try :
58
- subprocess .run (["pytest" ], check = True )
59
- except subprocess .CalledProcessError :
60
- pytest .fail ("Some tests failed." )
61
- except FileNotFoundError :
62
- pytest .skip (
63
- "pytest not found. Make sure it's installed and in your PATH."
64
- )
0 commit comments