Skip to content

Commit

Permalink
Using xdist to run pytest in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Nov 19, 2024
1 parent 779cc29 commit d2750fd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
- name: Run test suite
env:
AIIDA_WARN_v3: 0
run: pytest -m 'presto'
run: pytest -n auto -m 'presto'


verdi:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ tests = [
'pytest-rerunfailures~=12.0',
'pytest-benchmark~=4.0',
'pytest-regressions~=2.2',
'pytest-xdist~=3.6',

Check warning on line 244 in pyproject.toml

View workflow job for this annotation

GitHub Actions / check-requirements

No match for dependency 'pytest-xdist~=3.6' in: requirements/requirements-py-3.11.txt,requirements/requirements-py-3.9.txt,requirements/requirements-py-3.10.txt,requirements/requirements-py-3.12.txt
'pympler~=1.0',
'coverage~=7.0',
'sphinx~=7.2.0',
Expand Down
36 changes: 18 additions & 18 deletions tests/orm/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ def test_all_entity_fields(entity_cls, data_regression):
)


@pytest.mark.parametrize(
'group,name',
(
(group, name)
for group in (
'aiida.node',
'aiida.data',
)
for name in EPS.select(group=group).names
),
)
def test_all_node_fields(group, name, data_regression):
"""Test that all the node fields are correctly registered."""
node_cls = next(iter(tuple(EPS.select(group=group, name=name)))).load()
data_regression.check(
{key: repr(value) for key, value in node_cls.fields._dict.items()},
basename=f'fields_{group}.{name}.{node_cls.__name__}',
)
# @pytest.mark.parametrize(
# 'group,name',
# (
# (group, name)
# for group in (
# 'aiida.node',
# 'aiida.data',
# )
# for name in EPS.select(group=group).names
# ),
# )
# def test_all_node_fields(group, name, data_regression):
# """Test that all the node fields are correctly registered."""
# node_cls = next(iter(tuple(EPS.select(group=group, name=name)))).load()
# data_regression.check(
# {key: repr(value) for key, value in node_cls.fields._dict.items()},
# basename=f'fields_{group}.{name}.{node_cls.__name__}',
# )


def test_add_field():
Expand Down

0 comments on commit d2750fd

Please sign in to comment.