summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ntpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ntpath.py')
-rw-r--r--Lib/test/test_ntpath.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index 6464950..f809876 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -1,10 +1,11 @@
import ntpath
import os
import sys
+import unittest
+import warnings
from test.support import TestFailed
from test import support, test_genericpath
from tempfile import TemporaryFile
-import unittest
def tester(fn, wantResult):
@@ -21,7 +22,9 @@ def tester(fn, wantResult):
fn = fn.replace('["', '[b"')
fn = fn.replace(", '", ", b'")
fn = fn.replace(', "', ', b"')
- gotResult = eval(fn)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+ gotResult = eval(fn)
if isinstance(wantResult, str):
wantResult = wantResult.encode('ascii')
elif isinstance(wantResult, tuple):
@@ -254,14 +257,10 @@ class TestNtpath(unittest.TestCase):
ntpath.sameopenfile(-1, -1)
-class NtCommonTest(test_genericpath.CommonTest):
+class NtCommonTest(test_genericpath.CommonTest, unittest.TestCase):
pathmodule = ntpath
attributes = ['relpath', 'splitunc']
-def test_main():
- support.run_unittest(TestNtpath, NtCommonTest)
-
-
if __name__ == "__main__":
unittest.main()