Skip to content

Commit a4ec210

Browse files
author
Luca De Feo
committed
More robust handling of paths for testing
1 parent c8a2fad commit a4ec210

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/rundoctest.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
import cypari2
66
import doctest
77

8-
path = os.path.dirname(__file__)
9-
if path:
10-
os.chdir(path)
11-
os.chdir('..')
12-
sys.path.append(os.getcwd())
13-
8+
# Autogen tests must be run in the root dir, and with the proper module path
9+
path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
10+
os.chdir(path)
11+
sys.path.append(path)
1412
import autogen
1513

1614
failed = 0

0 commit comments

Comments
 (0)