-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rearranging the tests and paths for conda
- Loading branch information
1 parent
13674c0
commit 3698703
Showing
2 changed files
with
15 additions
and
8 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,7 +1,6 @@ | ||
import pytest | ||
from ties.topology_superimposer import Atom | ||
|
||
|
||
@pytest.fixture | ||
def lr_atoms_branches(): | ||
""" | ||
|
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,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() |