diff --git a/tests/test_grammar.py b/tests/test_grammar.py index 32f4a793..78161899 100644 --- a/tests/test_grammar.py +++ b/tests/test_grammar.py @@ -141,7 +141,7 @@ def test_token_multiline_only_works_with_x_flag(self): self.assertRaises( GrammarError, Lark, g) def test_import_custom_sources(self): - custom_loader = FromPackageLoader('tests', ('grammars', )) + custom_loader = FromPackageLoader(__name__, ('grammars', )) grammar = """ start: startab @@ -154,7 +154,7 @@ def test_import_custom_sources(self): Tree('start', [Tree('startab', [Tree('ab__expr', [Token('ab__A', 'a'), Token('ab__B', 'b')])])])) def test_import_custom_sources2(self): - custom_loader = FromPackageLoader('tests', ('grammars', )) + custom_loader = FromPackageLoader(__name__, ('grammars', )) grammar = """ start: rule_to_import @@ -166,7 +166,7 @@ def test_import_custom_sources2(self): self.assertEqual(next(x.find_data('rule_to_import')).children, ['N']) def test_import_custom_sources3(self): - custom_loader2 = FromPackageLoader('tests') + custom_loader2 = FromPackageLoader(__name__) grammar = """ %import .test_relative_import (start, WS) %ignore WS