Skip to content

Commit

Permalink
Merge pull request #1049 from pfhayes/patch-1
Browse files Browse the repository at this point in the history
Use __name__ in FromPackageLoader in test_grammar.py
  • Loading branch information
erezsh authored Dec 8, 2021
2 parents d7dff3f + 5de2ae1 commit 8c89670
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8c89670

Please sign in to comment.