Skip to content

Commit

Permalink
Fixed relative pathing issues for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peekxc committed Dec 4, 2023
1 parent 6aee229 commit f19232e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_lanczos.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
## Add the test directory to the sys path
import sys
import primate
ind = [i for i, c in enumerate(primate.__file__) if c == '/'][-3]
sys.path.insert(0, primate.__file__[:ind] + '/tests')
rel_dir = primate.__file__[:(primate.__file__.find('primate') + 7)]
sys.path.insert(0, rel_dir + '/tests')

def test_basic():
from primate.diagonalize import lanczos
Expand Down
4 changes: 2 additions & 2 deletions tests/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
## Add the test directory to the sys path
import sys
import primate
ind = [i for i, c in enumerate(primate.__file__) if c == '/'][-3]
sys.path.insert(0, primate.__file__[:ind] + '/tests')
rel_dir = primate.__file__[:(primate.__file__.find('primate') + 7)]
sys.path.insert(0, rel_dir + '/tests')

def test_seeding():
s1 = random.rademacher(250, seed = -1)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_slq.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
## Add the test directory to the sys path
import sys
import primate
ind = [i for i, c in enumerate(primate.__file__) if c == '/'][-3]
sys.path.insert(0, primate.__file__[:ind] + '/tests')
rel_dir = primate.__file__[:(primate.__file__.find('primate') + 7)]
sys.path.insert(0, rel_dir + '/tests')

def test_stochastic_quadrature():
from primate.diagonalize import _lanczos
Expand Down
4 changes: 2 additions & 2 deletions tests/test_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
## Add the test directory to the sys path
import sys
import primate
ind = [i for i, c in enumerate(primate.__file__) if c == '/'][-3]
sys.path.insert(0, primate.__file__[:ind] + '/tests')
rel_dir = primate.__file__[:(primate.__file__.find('primate') + 7)]
sys.path.insert(0, rel_dir + '/tests')

def test_incremental_est():
np.random.seed(1234)
Expand Down

0 comments on commit f19232e

Please sign in to comment.