Skip to content

Commit

Permalink
Blackify.
Browse files Browse the repository at this point in the history
  • Loading branch information
namcsi committed Dec 12, 2023
1 parent 7e58c5e commit eba8321
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
7 changes: 3 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,16 @@ def typecheck(session):

@nox.session(python=PYTHON_VERSIONS)
def test(session):
install_args = ['.[test]']
install_args = [".[test]"]
if EDITABLE_TESTS:
install_args.insert(0, '-e')
install_args.insert(0, "-e")
session.install(*install_args)
testargs = session.posargs
if "--nocoverage" in session.posargs:
testargs = [arg for arg in testargs if arg != "--nocoverage"]
session.run("python", "-m", "unittest", "discover", "-v", *testargs)
else:
session.run("coverage", "run", "-m", "unittest", "discover", "-v",
*testargs)
session.run("coverage", "run", "-m", "unittest", "discover", "-v", *testargs)
session.run("coverage", "report", "-m", "--fail-under=100")


Expand Down
27 changes: 19 additions & 8 deletions tests/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,12 @@ def test_parse_theory_terms_clingo(self):
rast1.add_reified_files(
[self.files_dir / "inputs" / "clingo-theory-term-reified.lp"]
)
rast1.transform(meta_files=[self.files_dir / "parse-theory-terms.lp",
self.files_dir / "clingo-operator-table.lp"],)
rast1.transform(
meta_files=[
self.files_dir / "parse-theory-terms.lp",
self.files_dir / "clingo-operator-table.lp",
]
)
rast2 = ReifiedAST(reify_location=True)
rast2.add_reified_files(
[self.files_dir / "inputs" / "clingo-theory-term-reified.lp"]
Expand All @@ -223,15 +227,22 @@ def test_parse_theory_terms_clingo(self):
)
pattern = "No definition for operator '\+' of arity '1' found"
with self.assertRaisesRegex(TransformationError, pattern):
rast3.transform(meta_files=[self.files_dir / "parse-theory-terms.lp",
self.files_dir / "clingo-operator-table.lp"])
rast3.transform(
meta_files=[
self.files_dir / "parse-theory-terms.lp",
self.files_dir / "clingo-operator-table.lp",
]
)
pattern = "No definition for operator '!!' of arity '2' found"
with self.assertRaisesRegex(TransformationError, pattern):
rast3.transform(meta_files=[self.files_dir / "parse-theory-terms.lp",
self.files_dir / "clingo-operator-table.lp"])
rast3.transform(
meta_files=[
self.files_dir / "parse-theory-terms.lp",
self.files_dir / "clingo-operator-table.lp",
]
)

def test_tables_from_theory_defs(self):
"""Test that operator and atom tables are extracted correctly
from theory definitions."""
ctl = Control()

Control()

0 comments on commit eba8321

Please sign in to comment.