from pych.extern import Chapel
import os

currentloc = os.getcwd();

# Note: depends on test living in a specific location relative to
# mymodule.chpl.  Not ideal, but also not a huge issue.
@Chapel(sfile=currentloc + "/../../../module/ext/src/mymodule.chpl")
def hello_mymodule():
    return None

@Chapel()
def hello_inline():
    """
    writeln("Hello from inline.");
    """
    return None

def test_unusual_sfile_loc(capfd):
    hello_mymodule()
    out, err = capfd.readouterr()
    assert out == 'Hello from mymodule\n'

def test_inline_output(capfd):
    hello_inline()
    out, err = capfd.readouterr()
    assert out == 'Hello from inline.\n'

@@ -33,16 +33,21 @@
 mport os
+.path
 %0A%0Acurren
@@ -60,17 +60,48 @@
  os.
-getcwd();
+path.dirname(os.path.realpath(__file__))
 %0A%0A# 

Update path relationship for test_unusual_sfile_loc.py