greschd / aiida_pytest Goto Github PK
View Code? Open in Web Editor NEWHelper module to run pytest on AiiDA plugins.
License: Apache License 2.0
Helper module to run pytest on AiiDA plugins.
License: Apache License 2.0
The functionality to create a temporary DB / profile / etc is now included in AiiDA, in a much nicer way. The corresponding fixtures should be deprecated / removed.
It seems the part of the code that backs up the configuration fails, if any configuration already exists. This is probably not intended, since it results in backing up only inexistent configurations.
@contextmanager
def reset_after_run():
...
assert not os.path.isfile(os.path.join(config_folder, 'config.json'))
The following error is generated from the contributed aiida-vasp tests:
_________________________________________________________________________________________________________________________ ERROR at setup of test_vasp __________________________________________________________________________________________________________________________
pytestconfig = <_pytest.config.Config object at 0x10a7a2250>
config_dict = {'codes': [{'default_plugin': 'vasp.vasp', 'description': 'VASP', 'label': 'vasp', 'prepend_text': 'source /users/gres...: '/home/greschd/software/VASP-5.4.1/potpaw_PBE.54', 'group_description': 'VASP 5.4 potpaw_PBE', 'group_name': 'pbe'}]}
@pytest.fixture(scope='session')
def configure(pytestconfig, config_dict):
config = copy.deepcopy(config_dict)
with temporary.temp_dir() as td, PGTest(max_connections=100) as pgt:
> with reset_after_run():
../../aiida_pytest/aiida_pytest/configure.py:52:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py:17: in __enter__
return self.gen.next()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
@contextmanager
def reset_after_run():
config_folder = os.path.expanduser(aiida.common.setup.AIIDA_CONFIG_FOLDER)
config_save_folder = os.path.join(
os.path.dirname(config_folder), '.aiida~'
)
reset_config(config_folder, config_save_folder)
> assert not os.path.isfile(os.path.join(config_folder, 'config.json'))
E AssertionError
../../aiida_pytest/aiida_pytest/configure.py:101: AssertionError
The sample
fixture generates paths relative to the working directory from which pytest
was called. This makes it inconvenient to use when one has tests in different locations as well.
from aiida_pytest import *
imports unwanted objects and even reimports builtins.
There should probably be a top level __all__
.
oops, just seen that that is a documented problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.