Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving testing #115

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import udkm1Dsim as ud


@pytest.fixture(scope='module')
def atom_oxygen():
atom_oxygen = ud.Atom('O')
return atom_oxygen


@pytest.fixture(scope='module')
def atom_dysprosium():
atom_dysprosium = ud.Atom('Dy')
return atom_dysprosium
12 changes: 12 additions & 0 deletions test/test_atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
import pytest


@pytest.mark.parametrize('atom, name, id, ionicity',
[
('atom_oxygen', 'Oxygen', 'O', 0),
('atom_dysprosium', 'Dysprosium', 'Dy', 0),
])
def test_atoms(atom, name, id, ionicity, request):
s = request.getfixturevalue(atom)
assert s.name == name
assert s.id == id
assert s.ionicity == ionicity


def test_atom():
Dy = Atom('Dy')
assert Dy.symbol == 'Dy'
Expand Down