Fix failing test on Windows Platform (#11589)
* add separator for windows * fixes test_is_copy_consistent on Windows * fixing writing encoding issue on extended test (for Windows) * resolving comments
This commit is contained in:
@@ -70,7 +70,7 @@ class CopyCheckTester(unittest.TestCase):
|
||||
expected = comment + f"\nclass {class_name}(nn.Module):\n" + overwrite_result
|
||||
code = black.format_str(code, mode=black.FileMode([black.TargetVersion.PY35], line_length=119))
|
||||
fname = os.path.join(self.transformer_dir, "new_code.py")
|
||||
with open(fname, "w") as f:
|
||||
with open(fname, "w", newline="\n") as f:
|
||||
f.write(code)
|
||||
if overwrite_result is None:
|
||||
self.assertTrue(len(check_copies.is_copy_consistent(fname)) == 0)
|
||||
|
||||
Reference in New Issue
Block a user