File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -439,13 +439,14 @@ def test(
439439 ctx .invoke (build_cmd )
440440
441441 package = cfg .get ("tool.spin.package" , None )
442+ if package is None :
443+ print (
444+ "Please specify `package = packagename` under `tool.spin` section of `pyproject.toml`"
445+ )
446+ raise SystemExit (1 )
447+
442448 if (not pytest_args ) and (not tests ):
443- pytest_args = (package ,)
444- if pytest_args == (None ,):
445- print (
446- "Please specify `package = packagename` under `tool.spin` section of `pyproject.toml`"
447- )
448- sys .exit (1 )
449+ tests = package
449450
450451 site_path = _set_pythonpath ()
451452 if site_path :
@@ -494,12 +495,9 @@ def test(
494495 else :
495496 cmd = ["pytest" ]
496497
497- cwd = os .getcwd ()
498498 pytest_p = _run (
499- cmd + ([f"--rootdir={ site_path } " ] if site_path else []) + list (pytest_args ),
500- cwd = site_path ,
499+ cmd + list (pytest_args ),
501500 )
502- os .chdir (cwd )
503501
504502 if gcov :
505503 # Verify the tools are present
You can’t perform that action at this time.
0 commit comments