Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
duzumaki committed Feb 12, 2024
1 parent f01f901 commit cecca20
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions tests/functional/test_error_handling.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
import os
import re
from concurrent.futures.process import BrokenProcessPool

import pytest # type: ignore

from grimp import build_graph, exceptions


def test_syntax_error_includes_module():
dirname = os.path.dirname(__file__)
filename = os.path.abspath(
os.path.join(dirname, "..", "assets", "syntaxerrorpackage", "foo", "one.py")
)

with pytest.raises(exceptions.SourceSyntaxError) as excinfo:
def test_syntax_error_terminates_executor_pool():
with pytest.raises(BrokenProcessPool):
build_graph("syntaxerrorpackage", cache_dir=None)

expected_exception = exceptions.SourceSyntaxError(
filename=filename, lineno=5, text="fromb . import two\n"
)
assert expected_exception == excinfo.value


def test_missing_root_init_file():
with pytest.raises(
Expand Down

0 comments on commit cecca20

Please sign in to comment.