Skip to content

Commit 712372a

Browse files
committed
exclude init python venv for tests
1 parent f383a0c commit 712372a

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

src/initialize.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -179,25 +179,25 @@ def copyTemplateFiles():
179179
mainScript()
180180
copyTemplateFiles()
181181

182-
pythonExecutable = self.getPythonExecutable()
183-
subprocess.run([pythonExecutable, "-m", "venv", "venv"], cwd=self.projectID, check=True)
184-
185-
if sys.platform == "win32":
186-
venvPython = f".\\{self.projectID}\\venv\\Scripts\\python"
187-
subprocess.run(
188-
[venvPython, "-m", "pip", "install", "-r", "requirements.txt"],
189-
cwd=self.projectID,
190-
check=True,
191-
)
192-
else:
193-
venvPython = f"./{self.projectID}/venv/bin/python"
194-
subprocess.run(
195-
[venvPython, "-m", "pip", "install", "-r", "requirements.txt"],
196-
cwd=self.projectID,
197-
check=True,
198-
)
199-
200182
if not self.isTest:
183+
pythonExecutable = self.getPythonExecutable()
184+
subprocess.run([pythonExecutable, "-m", "venv", "venv"], cwd=self.projectID, check=True)
185+
186+
if sys.platform == "win32":
187+
venvPython = f".\\{self.projectID}\\venv\\Scripts\\python"
188+
subprocess.run(
189+
[venvPython, "-m", "pip", "install", "-r", "requirements.txt"],
190+
cwd=self.projectID,
191+
check=True,
192+
)
193+
else:
194+
venvPython = f"./{self.projectID}/venv/bin/python"
195+
subprocess.run(
196+
[venvPython, "-m", "pip", "install", "-r", "requirements.txt"],
197+
cwd=self.projectID,
198+
check=True,
199+
)
200+
201201
print.success(f"Backend scaffolded in {self.projectID}/src/backend")
202202

203203
def start(

tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import shutil
22
import src.initialize as init
33
import src.print as print
4+
import os
45

56
def startTest():
67
frameworks = [
@@ -46,3 +47,4 @@ def startTest():
4647
print.success("All tests completed successfully.")
4748
except Exception as e:
4849
print.error(e)
50+
os.exit(1)

0 commit comments

Comments
 (0)