File: utilities.py

package info (click to toggle)
python-mcstasscript 0.0.46%2Bgit20250402111921.bfa5a26-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,440 kB
  • sloc: python: 13,421; makefile: 14
file content (15 lines) | stat: -rw-r--r-- 324 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os


def work_dir_test(func):
    def wrapper():
        THIS_DIR = os.path.dirname(os.path.abspath(__file__))
        current_work_dir = os.getcwd()

        os.chdir(THIS_DIR)  # Set work directory to test folder

        func()

        os.chdir(current_work_dir)  # Return to previous workdir

    return wrapper