Skip to content

Commit

Permalink
More path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Mar 18, 2024
1 parent 590e0d8 commit dd8219d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions daliuge-engine/test/test_dask_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import json
import os
import pytest
from time import sleep
import shutil
import unittest

import numpy as np
Expand Down Expand Up @@ -108,6 +108,12 @@ def sum_with_user_defined_default(a, b=MyType(10)):
return a + b.x


@pytest.fixture(scope="function", autouse=True)
def change_test_dir(request, monkeypatch):
print(f">>>>> path: {request.fspath.dirname}")
monkeypatch.chdir(request.fspath.dirname)


class _TestDelayed(object):
"""Test definitions run under non-delayed, dlg_delayed and possibly dask_delayed contexts"""

Expand Down Expand Up @@ -257,12 +263,17 @@ def compute(self, val):
class TestDlgDelayed(_TestDelayed, unittest.TestCase):
"""dlg-base tests, they start/stop the node manager and use dlg_delayed"""

# @pytest.fixture(autouse=True)
# def change_test_dir(self, request, monkeypatch):
# print(f">>>>> path: {request.fspath.dirname}")
# monkeypatch.chdir(request.fspath.dirname)

def delayed(self, f, *args, **kwargs):
return dlg_delayed(f, *args, **kwargs)

def setUp(self):
env = os.environ.copy()
env["PYTHONPATH"] = f"{env.get('PYTHONPATH', '')}:{os.getcwd()}"
env["PYTHONPATH"] = f"{env.get('PYTHONPATH', '')}:{os.path.abspath('.')}/.."
print(f">>>> env: {env['PYTHONPATH']}")
unittest.TestCase.setUp(self)
self.dmProcess = tool.start_process("nm", ["-vvv"], env=env)
Expand Down

0 comments on commit dd8219d

Please sign in to comment.