Skip to content

Commit

Permalink
Move testconfig to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
overfl0 committed Apr 28, 2024
1 parent c40ded0 commit d3853c0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: pytest

- name: Run performance test
run: python testconfig.py
run: python tests/testconfig.py

make_sdist:
needs: test
Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

subprocess.run('python setup_cython.py build_ext --inplace --force', shell=True, check=True)
subprocess.run('pytest -x -s', shell=True, check=True)
subprocess.run('python testconfig.py', shell=True, check=True)
subprocess.run('python tests/testconfig.py', shell=True, check=True)
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 11 additions & 6 deletions testconfig.py → tests/testconfig.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import json
import lzma
import os
import sys
import time
from itertools import zip_longest
from pathlib import Path

current_dir = Path(__file__).parent
sys.path.insert(0, str(current_dir.parent))

import armaclass

CONFIG_CPP = os.path.join('config_data', 'config.cpp')
CONFIG_JSON = os.path.join('config_data', 'config.json')
CONFIG_CPP = current_dir / 'config_data' / 'config.cpp'
CONFIG_JSON = current_dir / 'config_data' / 'config.json'

if not os.path.exists(CONFIG_CPP):
data = lzma.open(CONFIG_CPP + '.xz').read()
if not CONFIG_CPP.exists():
data = lzma.open(str(CONFIG_CPP) + '.xz').read()
with open(CONFIG_CPP, 'wb') as f:
f.write(data)

if not os.path.exists(CONFIG_JSON):
data = lzma.open(CONFIG_JSON + '.xz').read()
if not CONFIG_JSON.exists():
data = lzma.open(str(CONFIG_JSON) + '.xz').read()
with open(CONFIG_JSON, 'wb') as f:
f.write(data)

Expand Down

0 comments on commit d3853c0

Please sign in to comment.