Show More
@@ -918,3 +918,27 b' def wrn():' | |||
|
918 | 918 | finally: |
|
919 | 919 | ip.run_cell("del warnings") |
|
920 | 920 | ip.run_cell("del wrn") |
|
921 | ||
|
922 | ||
|
923 | class TestImportNoDeprecate(tt.TempFileMixin): | |
|
924 | ||
|
925 | def setup(self): | |
|
926 | """Make a valid python temp file.""" | |
|
927 | self.mktmp(""" | |
|
928 | import warnings | |
|
929 | def wrn(): | |
|
930 | warnings.warn( | |
|
931 | "I AM A WARNING", | |
|
932 | DeprecationWarning | |
|
933 | ) | |
|
934 | """) | |
|
935 | ||
|
936 | def test_no_dep(self): | |
|
937 | """ | |
|
938 | No deprecation warning should be raised from imported functions | |
|
939 | """ | |
|
940 | ip.run_cell("from {} import wrn".format(self.fname)) | |
|
941 | ||
|
942 | with tt.AssertNotPrints("I AM A WARNING"): | |
|
943 | ip.run_cell("wrn()") | |
|
944 | ip.run_cell("del wrn") |
General Comments 0
You need to be logged in to leave comments.
Login now