Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def get_executable_command(options, allow_pytest, disable_coverage=False):
if options.coverage and not disable_coverage:
executable = ["coverage", "run", "--parallel-mode", "--source=torch"]
else:
executable = [sys.executable]
executable = [sys.executable, "-bb"]
if options.pytest:
if allow_pytest:
executable += ["-m", "pytest"]
Expand Down
3 changes: 2 additions & 1 deletion test/test_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -15157,9 +15157,10 @@ def test_MaxUnpool_index_errors(self, device, module_name, module_size, output_s
[sys.executable, '-c', script],
cwd=os.path.dirname(os.path.realpath(__file__)),
capture_output=True,
text=True,
)

output = str(p.stdout) + '\n' + str(p.stderr)
output = p.stdout + '\n' + p.stderr

error_msg = error_msgs[module_name]

Expand Down
4 changes: 2 additions & 2 deletions test/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ def cpp_warn_fn():

# Checks for cpp context in the warning message
escaped_warning_message = str(warning.message).encode('unicode_escape')
self.assertTrue(re.search(s, str(escaped_warning_message), re.IGNORECASE) is not None)
self.assertTrue(re.search(s, repr(escaped_warning_message), re.IGNORECASE) is not None)

# Checks the Python features of the warning
# Note: the eager mode warning refers to the line in the function
Expand All @@ -764,7 +764,7 @@ def cpp_warn_fn():

# Checks for cpp context in the warning message
escaped_warning_message = str(warning.message).encode('unicode_escape')
self.assertTrue(re.search(s, str(escaped_warning_message), re.IGNORECASE) is not None)
self.assertTrue(re.search(s, repr(escaped_warning_message), re.IGNORECASE) is not None)

# Checks the Python features of the warning
# Note: the jitted warning's lineno refers to the call to the jitted
Expand Down
2 changes: 1 addition & 1 deletion torch/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _is_zipfile(f) -> bool:
start = f.tell()

byte = f.read(1)
while byte != "":
while byte != b"":
read_bytes.append(byte)
if len(read_bytes) == 4:
break
Expand Down