22import subprocess
33import tomli
44import pytest
5- from packaging import version
65
76
87@pytest .fixture (scope = "module" )
98def toml_data ():
10- file_path = "pyproject.toml"
9+ file_path = "../../ pyproject.toml"
1110 if not os .path .exists (file_path ):
1211 pytest .fail ("pyproject.toml not found in the current directory." )
1312 with open (file_path , "rb" ) as f :
1413 return tomli .load (f )
1514
1615
1716def test_toml_syntax ():
18- file_path = "pyproject.toml"
17+ file_path = "../../ pyproject.toml"
1918 try :
2019 with open (file_path , "rb" ) as f :
2120 tomli .load (f )
@@ -37,28 +36,3 @@ def test_build_system(toml_data):
3736 assert (
3837 "build-backend" in build_system
3938 ), "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