Skip to content

Commit

Permalink
Rearranging the tests and paths for conda
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniekmateusz committed Apr 5, 2023
1 parent 13674c0 commit 3698703
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion ties/testing/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest
from ties.topology_superimposer import Atom


@pytest.fixture
def lr_atoms_branches():
"""
Expand Down
22 changes: 15 additions & 7 deletions ties/testing/run.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
#!/usr/bin/env python

import pytest, tempfile, os, sys, site, shutil

from pathlib import Path
def main():
with tempfile.TemporaryDirectory() as tmpdirname:
print('created temporary directory', tmpdirname)
test_dir = os.path.join(site.getsitepackages()[0], 'ties', 'testing')
tmp_test_dir = os.path.join(tmpdirname, 'ties', 'unit_testing', 'testing')
shutil.copytree(test_dir, tmp_test_dir)
sys.exit(pytest.main([os.path.join(tmp_test_dir)]))
try:
with tempfile.TemporaryDirectory() as tmpdirname:
cwd = Path.cwd()
os.chdir(tmpdirname)
test_dir = os.path.join(site.getsitepackages()[0], 'ties', 'testing')
examples = os.path.join(site.getsitepackages()[0], 'ties', 'examples')
shutil.copytree(test_dir, 'testing')
shutil.copytree(examples, 'examples')

# enter the testing directory
os.chdir(Path(tmpdirname) / 'testing')
sys.exit(pytest.main([Path(tmpdirname) / 'testing']))
finally:
os.chdir(cwd)

if __name__ == '__main__':
main()

0 comments on commit 3698703

Please sign in to comment.