Skip to content

Commit

Permalink
Get data dir using tests.util.get_data_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad committed Nov 6, 2024
1 parent 8a2a49c commit e05910a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions quantecon/game_theory/tests/test_howson_lcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,26 @@
from quantecon.game_theory.howson_lcp import polym_lcp_solver
from quantecon.game_theory.polymatrix_game import PolymatrixGame

import os
from quantecon.tests.util import get_data_dir


data_dir_name = "gam_files"
data_dir = get_data_dir(data_dir_name)


def test_polym_lcp_solver_where_solution_is_pure_NE():
filename = "gam_files/big_polym.gam"
nfg = qe_nfg_from_gam_file(filename)
filename = "big_polym.gam"
nfg = qe_nfg_from_gam_file(os.path.join(data_dir, filename))
polym = PolymatrixGame.from_nf(nfg)
ne = polym_lcp_solver(polym)
worked = nfg.is_nash(ne)
assert_(worked)


def test_polym_lcp_solver_where_lcp_solver_must_backtrack():
filename = "gam_files/triggers_back_case.gam"
nfg = qe_nfg_from_gam_file(filename)
filename = "triggers_back_case.gam"
nfg = qe_nfg_from_gam_file(os.path.join(data_dir, filename))
polym = PolymatrixGame.from_nf(nfg)
ne = polym_lcp_solver(polym)
worked = nfg.is_nash(ne)
Expand Down

0 comments on commit e05910a

Please sign in to comment.