-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1af1e24
commit 7136f19
Showing
2 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
import sys, os | ||
import pytest | ||
import numpy as np | ||
import sys | ||
import os | ||
myPath = os.path.dirname(os.path.abspath(__file__)) | ||
sys.path.insert(0, myPath + '/../') | ||
|
||
|
||
mazes_root = "tests/fixtures/mazes/" | ||
|
||
|
||
def load_mazes(folder): | ||
result = {} | ||
for name in os.listdir(folder): | ||
path = os.path.join(folder, name) | ||
if os.path.isfile(path) and name.endswith('.csv'): | ||
maze_num = int(name[:-4]) | ||
result[maze_num] = np.loadtxt(path, delimiter=',') | ||
return result | ||
|
||
|
||
@pytest.fixture(scope='session') | ||
def mazes(): | ||
maze_db = {} | ||
for name in os.listdir(mazes_root): | ||
path = os.path.join(mazes_root, name) | ||
if os.path.isdir(path) and not name.startswith('.'): | ||
maze_db[name] = load_mazes(path) | ||
return maze_db | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters