Skip to content

Commit

Permalink
Invoke tests without exec
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanda Tang committed Oct 1, 2024
1 parent e8f8903 commit 56825c2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
10 changes: 4 additions & 6 deletions tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ def index(expr):
assert index(Reads(a0)) == 2


if __name__ == "__main__":
if len(sys.argv) > 1:
exec(sys.argv[1])
else:
from pytest import main
main([__file__])
if __name__ == '__main__':
test_saxpy_builder()
test_query()
test_build_with_queries()
14 changes: 12 additions & 2 deletions tests/test_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,15 @@ def test_matvec():
}""")


from pytest import main
main([__file__])
if __name__ == '__main__':
test_batch_matmul()
test_conv()
test_copy()
test_dot()
test_fill()
test_generic()
test_indexed_generic()
test_reduce()
test_view()
test_matmul()
test_matvec()
6 changes: 4 additions & 2 deletions tests/test_scf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,7 @@ def test_scf_while():
}""")


from pytest import main
main([__file__])
if __name__ == '__main__':
test_scf_for()
test_scf_if()
test_scf_while()

0 comments on commit 56825c2

Please sign in to comment.