blueloveTH 1 anno fa
parent
commit
14a9120d9b
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 0 3
      src2/main.cpp
  2. 3 0
      tests/30_import.py

+ 0 - 3
src2/main.cpp

@@ -99,9 +99,6 @@ int main(int argc, char** argv){
         std::string src((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>());
         file.close();
 
-        // set parent path as cwd
-        std::filesystem::current_path(filepath.parent_path());
-
         bool ok = pkpy_exec_2(vm, src.c_str(), filepath.filename().string().c_str(), 0, NULL);
         if(!ok) pkpy_clear_error(vm, NULL);
         pkpy_delete_vm(vm);

+ 3 - 0
tests/30_import.py

@@ -3,6 +3,9 @@ try:
 except ImportError:
     exit(0)
 
+# test import
+os.chdir('tests')
+
 import test1
 
 assert test1.add(1, 2) == 13