--- /dev/null
+.. change::
+ :tags: bug, tests
+
+ Adjusted the test suite which tests the Mypy plugin to accommodate for
+ changes in Mypy 0.990 regarding how it handles message output, which affect
+ how sys.path is interpreted when determining if notes and errors should be
+ printed for particular files. The change broke the test suite as the files
+ within the test directory itself no longer produced messaging when run
+ under the mypy API.
),
]
- args.append(path)
+ if incremental:
+ args.append(path)
+ else:
+ # mypy as of 0.990 is more aggressively blocking messaging
+ # for paths that are in sys.path, and as pytest puts currdir,
+ # test/ etc in sys.path, just copy the source file to the
+ # tempdir we are working in so that we don't have to try to
+ # manipulate sys.path and/or guess what mypy is doing
+ filename = os.path.basename(path)
+ test_program = os.path.join(cachedir, filename)
+ shutil.copyfile(path, test_program)
+ args.append(test_program)
result = api.run(args)
return result
not_located = []
if expected_errors:
- eq_(result[2], 1, msg=result)
+ # mypy 0.990 changed how return codes work, so don't assume a
+ # 1 or a 0 return code here, could be either depending on if
+ # errors were generated or not
print(result[0])