Skip to content

Commit

Permalink
fix: sub module conflict error
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarisW committed Nov 29, 2024
1 parent 761517d commit b79da84
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import os
import sys
import threading

Expand Down Expand Up @@ -41,7 +42,7 @@ def test_include():


def test_include_with_module_name_prefix():
load('parser-cases/include.thrift', module_name='parser_cases.include_thrift')
load('parser-cases' + os.sep + 'include.thrift', module_name='parser_cases.include_thrift')
assert sys.modules['parser_cases.include_thrift'] is not None
assert sys.modules['parser_cases.included_thrift'] is not None
assert sys.modules['parser_cases.include.included_1_thrift'] is not None
Expand All @@ -50,7 +51,7 @@ def test_include_with_module_name_prefix():

def test_include_conflict():
with pytest.raises(ThriftParserError) as excinfo:
load('parser-cases/foo.bar.thrift', module_name='foo.bar_thrift')
load('parser-cases' + os.sep + 'foo.bar.thrift', module_name='foo.bar_thrift')
assert 'Module name conflict between "parser-cases/foo.bar.thrift" and "parser-cases/foo/bar.thrift"' == str(excinfo.value)


Expand Down

0 comments on commit b79da84

Please sign in to comment.