Skip to content

Commit

Permalink
another change
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Dupre <[email protected]>
  • Loading branch information
xadupre committed Jun 26, 2024
1 parent 854b425 commit 0a8ace8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions onnxscript/backend/onnx_export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ def run_function(obj, *inputs):
def extract_functions(name: str, content: str, test_folder: pathlib.Path):
if not test_folder.exists():
test_folder.mkdir(exist_ok=True, parents=True)
init = test_folder / "__init__.py"
init.touch(exist_ok=True)
init = str(test_folder / "__init__.py")
with open(init, "w") as f:

Check warning

Code scanning / lintrunner

PYLINT/W1514 Warning

Using open without explicitly specifying an encoding (unspecified-encoding)
See unspecified-encoding. To disable, use # pylint: disable=unspecified-encoding
f.write("\n")
filename = str(test_folder / f"{name}.py")
with open(filename, "w", encoding="utf-8") as f:
f.write(content + "\n")
Expand All @@ -169,7 +170,7 @@ def extract_functions(name: str, content: str, test_folder: pathlib.Path):
mod = importlib.import_module(import_name)
except (SyntaxError, ImportError) as e:
try:
import tests
import tests # pylint: disable=import-outside-toplevel

test_file = tests.__file__
except ImportError:
Expand Down

0 comments on commit 0a8ace8

Please sign in to comment.