Skip to content

Commit

Permalink
Use pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert committed Apr 17, 2021
1 parent eca6976 commit 66ef8ab
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
from sys import version_info

import pytest

import pylhe

python37plus_only = pytest.mark.skipif(
version_info < (3, 7), reason="requires Python3.7+"
)


@python37plus_only
def test_top_level_api():
if version_info >= (3, 7):
assert dir(pylhe) == [
"LHEEvent",
"LHEEventInfo",
"LHEFile",
"LHEInit",
"LHEParticle",
"LHEProcInfo",
"loads",
"readLHE",
"readLHEInit",
"readLHEWithAttributes",
"readNumEvents",
"visualize",
]
else:
print(dir(pylhe))
assert dir(pylhe)
assert dir(pylhe) == [
"LHEEvent",
"LHEEventInfo",
"LHEFile",
"LHEInit",
"LHEParticle",
"LHEProcInfo",
"loads",
"readLHE",
"readLHEInit",
"readLHEWithAttributes",
"readNumEvents",
"visualize",
]

0 comments on commit 66ef8ab

Please sign in to comment.